From c1980701fe4cc0a7da61106a349754977ae53557 Mon Sep 17 00:00:00 2001 From: "fern-api[bot]" <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 02:05:14 +0000 Subject: [PATCH] SDK regeneration --- .fern/metadata.json | 17 ++ poetry.lock | 48 +++++- pyproject.toml | 5 +- src/square/bank_accounts/client.py | 9 +- src/square/bank_accounts/raw_client.py | 18 +-- src/square/bookings/client.py | 9 +- .../custom_attribute_definitions/client.py | 9 +- .../raw_client.py | 18 +-- .../bookings/custom_attributes/client.py | 9 +- .../bookings/custom_attributes/raw_client.py | 18 +-- .../bookings/location_profiles/client.py | 9 +- .../bookings/location_profiles/raw_client.py | 18 +-- src/square/bookings/raw_client.py | 18 +-- .../bookings/team_member_profiles/client.py | 9 +- .../team_member_profiles/raw_client.py | 18 +-- src/square/cards/client.py | 9 +- src/square/cards/raw_client.py | 18 +-- src/square/cash_drawers/shifts/client.py | 18 ++- src/square/cash_drawers/shifts/raw_client.py | 34 ++-- src/square/catalog/client.py | 9 +- src/square/catalog/raw_client.py | 18 +-- src/square/channels/client.py | 9 +- src/square/channels/raw_client.py | 18 +-- src/square/checkout/payment_links/client.py | 9 +- .../checkout/payment_links/raw_client.py | 18 +-- src/square/core/client_wrapper.py | 4 +- src/square/core/custom_pagination.py | 152 ++++++++++++++++++ src/square/core/http_sse/__init__.py | 42 +++++ src/square/core/http_sse/_api.py | 112 +++++++++++++ src/square/core/http_sse/_decoders.py | 61 +++++++ src/square/core/http_sse/_exceptions.py | 7 + src/square/core/http_sse/_models.py | 17 ++ src/square/core/pagination.py | 28 ++-- src/square/core/pydantic_utilities.py | 4 +- src/square/core/unchecked_base_model.py | 37 ++++- src/square/customers/client.py | 9 +- .../custom_attribute_definitions/client.py | 9 +- .../raw_client.py | 18 +-- .../customers/custom_attributes/client.py | 9 +- .../customers/custom_attributes/raw_client.py | 18 +-- src/square/customers/groups/client.py | 9 +- src/square/customers/groups/raw_client.py | 18 +-- src/square/customers/raw_client.py | 18 +-- src/square/customers/segments/client.py | 9 +- src/square/customers/segments/raw_client.py | 18 +-- src/square/devices/client.py | 9 +- src/square/devices/codes/client.py | 9 +- src/square/devices/codes/raw_client.py | 18 +-- src/square/devices/raw_client.py | 18 +-- src/square/disputes/client.py | 9 +- src/square/disputes/evidence/client.py | 9 +- src/square/disputes/evidence/raw_client.py | 18 +-- src/square/disputes/raw_client.py | 18 +-- src/square/employees/client.py | 9 +- src/square/employees/raw_client.py | 18 +-- src/square/gift_cards/activities/client.py | 9 +- .../gift_cards/activities/raw_client.py | 18 +-- src/square/gift_cards/client.py | 9 +- src/square/gift_cards/raw_client.py | 18 +-- src/square/inventory/client.py | 34 ++-- src/square/inventory/raw_client.py | 66 +++----- src/square/invoices/client.py | 9 +- src/square/invoices/raw_client.py | 18 +-- src/square/labor/break_types/client.py | 9 +- src/square/labor/break_types/raw_client.py | 18 +-- src/square/labor/employee_wages/client.py | 9 +- src/square/labor/employee_wages/raw_client.py | 18 +-- src/square/labor/team_member_wages/client.py | 9 +- .../labor/team_member_wages/raw_client.py | 18 +-- src/square/labor/workweek_configs/client.py | 9 +- .../labor/workweek_configs/raw_client.py | 18 +-- .../custom_attribute_definitions/client.py | 9 +- .../raw_client.py | 18 +-- .../locations/custom_attributes/client.py | 9 +- .../locations/custom_attributes/raw_client.py | 18 +-- .../loyalty/programs/promotions/client.py | 9 +- .../loyalty/programs/promotions/raw_client.py | 18 +-- src/square/merchants/client.py | 9 +- .../custom_attribute_definitions/client.py | 9 +- .../raw_client.py | 18 +-- .../merchants/custom_attributes/client.py | 9 +- .../merchants/custom_attributes/raw_client.py | 18 +-- src/square/merchants/raw_client.py | 18 +-- .../custom_attribute_definitions/client.py | 9 +- .../raw_client.py | 18 +-- src/square/orders/custom_attributes/client.py | 9 +- .../orders/custom_attributes/raw_client.py | 18 +-- src/square/payments/client.py | 9 +- src/square/payments/raw_client.py | 18 +-- src/square/payouts/client.py | 18 ++- src/square/payouts/raw_client.py | 34 ++-- src/square/refunds/client.py | 9 +- src/square/refunds/raw_client.py | 18 +-- .../catalog_item_modifier_list_info.py | 6 +- .../requests/catalog_modifier_override.py | 4 +- src/square/requests/custom_attribute.py | 2 +- .../requests/custom_attribute_definition.py | 2 +- ...ination_details_external_refund_details.py | 2 +- src/square/requests/event_data.py | 2 +- .../requests/external_payment_details.py | 2 +- src/square/requests/invoice.py | 4 +- .../requests/invoice_payment_request.py | 2 +- src/square/subscriptions/client.py | 9 +- src/square/subscriptions/raw_client.py | 18 +-- src/square/transfer_orders/client.py | 9 +- src/square/transfer_orders/raw_client.py | 18 +-- .../batch_get_catalog_objects_response.py | 26 +-- .../batch_upsert_catalog_objects_response.py | 26 +-- src/square/types/catalog_category.py | 2 +- src/square/types/catalog_item.py | 26 +-- .../types/catalog_item_modifier_list_info.py | 6 +- src/square/types/catalog_item_option.py | 23 +-- src/square/types/catalog_modifier_list.py | 25 +-- src/square/types/catalog_modifier_override.py | 4 +- src/square/types/catalog_object_batch.py | 26 +-- src/square/types/catalog_object_category.py | 2 +- src/square/types/catalog_object_item.py | 10 +- .../types/catalog_object_item_option.py | 10 +- .../types/catalog_object_modifier_list.py | 10 +- .../types/catalog_object_subscription_plan.py | 10 +- src/square/types/catalog_subscription_plan.py | 25 +-- .../types/create_catalog_image_request.py | 24 +-- .../types/create_catalog_image_response.py | 26 +-- .../types/create_payment_link_response.py | 11 -- src/square/types/custom_attribute.py | 2 +- .../types/custom_attribute_definition.py | 2 +- ...ination_details_external_refund_details.py | 2 +- src/square/types/event_data.py | 2 +- src/square/types/external_payment_details.py | 2 +- src/square/types/get_booking_request.py | 2 +- .../get_business_booking_profile_request.py | 2 +- src/square/types/get_card_request.py | 2 +- .../types/get_catalog_object_response.py | 26 +-- .../types/get_customer_group_request.py | 2 +- src/square/types/get_customer_request.py | 2 +- .../types/get_customer_segment_request.py | 2 +- .../types/get_dispute_evidence_request.py | 2 +- src/square/types/get_dispute_request.py | 2 +- src/square/types/get_employee_request.py | 2 +- src/square/types/get_gift_card_request.py | 2 +- .../types/get_inventory_adjustment_request.py | 2 +- .../get_inventory_physical_count_request.py | 2 +- .../types/get_inventory_transfer_request.py | 2 +- src/square/types/get_location_request.py | 2 +- .../types/get_loyalty_account_request.py | 2 +- .../types/get_loyalty_program_request.py | 2 +- .../types/get_loyalty_promotion_request.py | 2 +- .../types/get_loyalty_reward_request.py | 2 +- src/square/types/get_merchant_request.py | 2 +- src/square/types/get_order_request.py | 2 +- src/square/types/get_payment_link_request.py | 2 +- src/square/types/get_snippet_request.py | 2 +- ...get_team_member_booking_profile_request.py | 2 +- src/square/types/get_team_member_request.py | 2 +- src/square/types/get_transaction_request.py | 2 +- src/square/types/get_vendor_request.py | 2 +- src/square/types/get_wage_setting_request.py | 2 +- .../types/get_webhook_subscription_request.py | 2 +- src/square/types/invoice.py | 4 +- src/square/types/invoice_payment_request.py | 2 +- src/square/types/list_catalog_response.py | 26 +-- .../types/payment_link_related_resources.py | 26 +-- .../types/search_catalog_items_response.py | 26 +-- .../types/search_catalog_objects_response.py | 26 +-- .../types/update_catalog_image_response.py | 26 +-- .../types/upsert_catalog_object_response.py | 26 +-- src/square/types/v1get_payment_request.py | 2 +- src/square/types/v1get_settlement_request.py | 2 +- src/square/webhooks/subscriptions/client.py | 9 +- .../webhooks/subscriptions/raw_client.py | 18 +-- 170 files changed, 1345 insertions(+), 1049 deletions(-) create mode 100644 .fern/metadata.json create mode 100644 src/square/core/custom_pagination.py create mode 100644 src/square/core/http_sse/__init__.py create mode 100644 src/square/core/http_sse/_api.py create mode 100644 src/square/core/http_sse/_decoders.py create mode 100644 src/square/core/http_sse/_exceptions.py create mode 100644 src/square/core/http_sse/_models.py diff --git a/.fern/metadata.json b/.fern/metadata.json new file mode 100644 index 00000000..5b320faa --- /dev/null +++ b/.fern/metadata.json @@ -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 + } +} \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index fef37956..9decbf87 100644 --- a/poetry.lock +++ b/poetry.lock @@ -38,13 +38,13 @@ trio = ["trio (>=0.26.1)"] [[package]] name = "certifi" -version = "2025.10.5" +version = "2025.11.12" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2025.10.5-py3-none-any.whl", hash = "sha256:0f212c2744a9bb6de0c56639a6f68afe01ecd92d91f14ae897c4fe7bbeeef0de"}, - {file = "certifi-2025.10.5.tar.gz", hash = "sha256:47c09d31ccf2acf0be3f701ea53595ee7e0b8fa08801c6624be771df09ae7b43"}, + {file = "certifi-2025.11.12-py3-none-any.whl", hash = "sha256:97de8790030bbd5c2d96b7ec782fc2f7820ef8dba6db909ccf95449f2d062d4b"}, + {file = "certifi-2025.11.12.tar.gz", hash = "sha256:d8ab5478f2ecd78af242878415affce761ca6bc54a22a27e026d7c25357c3316"}, ] [[package]] @@ -60,13 +60,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.3.0" +version = "1.3.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.3.0-py3-none-any.whl", hash = "sha256:4d111e6e0c13d0644cad6ddaa7ed0261a0b36971f6d23e7ec9b4b9097da78a10"}, - {file = "exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88"}, + {file = "exceptiongroup-1.3.1-py3-none-any.whl", hash = "sha256:a7a39a3bd276781e98394987d3a5701d0c4edffb633bb7a5144577f82c773598"}, + {file = "exceptiongroup-1.3.1.tar.gz", hash = "sha256:8b412432c6055b0b7d14c310000ae93352ed6754f70fa8f7c34141f91c4e3219"}, ] [package.dependencies] @@ -75,6 +75,20 @@ typing-extensions = {version = ">=4.6.0", markers = "python_version < \"3.13\""} [package.extras] test = ["pytest (>=6)"] +[[package]] +name = "execnet" +version = "2.1.2" +description = "execnet: rapid multi-Python deployment" +optional = false +python-versions = ">=3.8" +files = [ + {file = "execnet-2.1.2-py3-none-any.whl", hash = "sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec"}, + {file = "execnet-2.1.2.tar.gz", hash = "sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd"}, +] + +[package.extras] +testing = ["hatch", "pre-commit", "pytest", "tox"] + [[package]] name = "h11" version = "0.16.0" @@ -418,6 +432,26 @@ pytest = ">=7.0.0,<9" docs = ["sphinx (>=5.3)", "sphinx-rtd-theme (>=1.0)"] testing = ["coverage (>=6.2)", "hypothesis (>=5.7.1)"] +[[package]] +name = "pytest-xdist" +version = "3.6.1" +description = "pytest xdist plugin for distributed testing, most importantly across multiple CPUs" +optional = false +python-versions = ">=3.8" +files = [ + {file = "pytest_xdist-3.6.1-py3-none-any.whl", hash = "sha256:9ed4adfb68a016610848639bb7e02c9352d5d9f03d04809919e2dafc3be4cca7"}, + {file = "pytest_xdist-3.6.1.tar.gz", hash = "sha256:ead156a4db231eec769737f57668ef58a2084a34b2e55c4a8fa20d861107300d"}, +] + +[package.dependencies] +execnet = ">=2.1" +pytest = ">=7.0.0" + +[package.extras] +psutil = ["psutil (>=3.0)"] +setproctitle = ["setproctitle"] +testing = ["filelock"] + [[package]] name = "python-dateutil" version = "2.9.0.post0" @@ -557,4 +591,4 @@ files = [ [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "8551b871abee465e23fb0966d51f2c155fd257b55bdcb0c02d095de19f92f358" +content-hash = "bcf31a142c86d9e556553c8c260a93b563ac64a043076dbd48b26111d422c26e" diff --git a/pyproject.toml b/pyproject.toml index 3526b024..ee301f65 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 = [] @@ -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] @@ -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" diff --git a/src/square/bank_accounts/client.py b/src/square/bank_accounts/client.py index c710f15c..bb738b1b 100644 --- a/src/square/bank_accounts/client.py +++ b/src/square/bank_accounts/client.py @@ -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 @@ -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. @@ -60,7 +61,7 @@ def list( Returns ------- - SyncPager[BankAccount] + SyncPager[BankAccount, ListBankAccountsResponse] Success Examples @@ -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. @@ -203,7 +204,7 @@ async def list( Returns ------- - AsyncPager[BankAccount] + AsyncPager[BankAccount, ListBankAccountsResponse] Success Examples diff --git a/src/square/bank_accounts/raw_client.py b/src/square/bank_accounts/raw_client.py index 1cf95c31..0b79ce9b 100644 --- a/src/square/bank_accounts/raw_client.py +++ b/src/square/bank_accounts/raw_client.py @@ -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 @@ -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. @@ -54,7 +54,7 @@ def list( Returns ------- - SyncPager[BankAccount] + SyncPager[BankAccount, ListBankAccountsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -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) @@ -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. @@ -212,7 +210,7 @@ async def list( Returns ------- - AsyncPager[BankAccount] + AsyncPager[BankAccount, ListBankAccountsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -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) diff --git a/src/square/bookings/client.py b/src/square/bookings/client.py index c8899695..724f37a5 100644 --- a/src/square/bookings/client.py +++ b/src/square/bookings/client.py @@ -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 @@ -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. @@ -99,7 +100,7 @@ def list( Returns ------- - SyncPager[Booking] + SyncPager[Booking, ListBookingsResponse] Success Examples @@ -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. @@ -599,7 +600,7 @@ async def list( Returns ------- - AsyncPager[Booking] + AsyncPager[Booking, ListBookingsResponse] Success Examples diff --git a/src/square/bookings/custom_attribute_definitions/client.py b/src/square/bookings/custom_attribute_definitions/client.py index 13fe4564..24b27d12 100644 --- a/src/square/bookings/custom_attribute_definitions/client.py +++ b/src/square/bookings/custom_attribute_definitions/client.py @@ -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, ) @@ -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. @@ -64,7 +65,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] Success Examples @@ -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. @@ -348,7 +349,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] Success Examples diff --git a/src/square/bookings/custom_attribute_definitions/raw_client.py b/src/square/bookings/custom_attribute_definitions/raw_client.py index d2567958..188bf4c2 100644 --- a/src/square/bookings/custom_attribute_definitions/raw_client.py +++ b/src/square/bookings/custom_attribute_definitions/raw_client.py @@ -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 @@ -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. @@ -59,7 +59,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -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) @@ -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. @@ -383,7 +381,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListBookingCustomAttributeDefinitionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -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) diff --git a/src/square/bookings/custom_attributes/client.py b/src/square/bookings/custom_attributes/client.py index 88c89339..ee66d78c 100644 --- a/src/square/bookings/custom_attributes/client.py +++ b/src/square/bookings/custom_attributes/client.py @@ -12,6 +12,7 @@ from ...types.bulk_upsert_booking_custom_attributes_response import BulkUpsertBookingCustomAttributesResponse from ...types.custom_attribute import CustomAttribute from ...types.delete_booking_custom_attribute_response import DeleteBookingCustomAttributeResponse +from ...types.list_booking_custom_attributes_response import ListBookingCustomAttributesResponse from ...types.retrieve_booking_custom_attribute_response import RetrieveBookingCustomAttributeResponse from ...types.upsert_booking_custom_attribute_response import UpsertBookingCustomAttributeResponse from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient @@ -131,7 +132,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: """ Lists a booking's custom attributes. @@ -163,7 +164,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListBookingCustomAttributesResponse] Success Examples @@ -497,7 +498,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: """ Lists a booking's custom attributes. @@ -529,7 +530,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse] Success Examples diff --git a/src/square/bookings/custom_attributes/raw_client.py b/src/square/bookings/custom_attributes/raw_client.py index fa0525e2..2d5a414e 100644 --- a/src/square/bookings/custom_attributes/raw_client.py +++ b/src/square/bookings/custom_attributes/raw_client.py @@ -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 @@ -160,7 +160,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: """ Lists a booking's custom attributes. @@ -192,7 +192,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListBookingCustomAttributesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -224,9 +224,7 @@ def list( with_definitions=with_definitions, 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) @@ -565,7 +563,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse]: """ Lists a booking's custom attributes. @@ -597,7 +595,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListBookingCustomAttributesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -632,9 +630,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) diff --git a/src/square/bookings/location_profiles/client.py b/src/square/bookings/location_profiles/client.py index aeffbc01..b778bd2a 100644 --- a/src/square/bookings/location_profiles/client.py +++ b/src/square/bookings/location_profiles/client.py @@ -5,6 +5,7 @@ from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions +from ...types.list_location_booking_profiles_response import ListLocationBookingProfilesResponse from ...types.location_booking_profile import LocationBookingProfile from .raw_client import AsyncRawLocationProfilesClient, RawLocationProfilesClient @@ -30,7 +31,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LocationBookingProfile]: + ) -> SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: """ Lists location booking profiles of a seller. @@ -47,7 +48,7 @@ def list( Returns ------- - SyncPager[LocationBookingProfile] + SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] Success Examples @@ -91,7 +92,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LocationBookingProfile]: + ) -> AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: """ Lists location booking profiles of a seller. @@ -108,7 +109,7 @@ async def list( Returns ------- - AsyncPager[LocationBookingProfile] + AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] Success Examples diff --git a/src/square/bookings/location_profiles/raw_client.py b/src/square/bookings/location_profiles/raw_client.py index 22d7d6be..2810e589 100644 --- a/src/square/bookings/location_profiles/raw_client.py +++ b/src/square/bookings/location_profiles/raw_client.py @@ -5,7 +5,7 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper -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.list_location_booking_profiles_response import ListLocationBookingProfilesResponse @@ -22,7 +22,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LocationBookingProfile]: + ) -> SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: """ Lists location booking profiles of a seller. @@ -39,7 +39,7 @@ def list( Returns ------- - SyncPager[LocationBookingProfile] + SyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -68,9 +68,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) @@ -87,7 +85,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LocationBookingProfile]: + ) -> AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse]: """ Lists location booking profiles of a seller. @@ -104,7 +102,7 @@ async def list( Returns ------- - AsyncPager[LocationBookingProfile] + AsyncPager[LocationBookingProfile, ListLocationBookingProfilesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -136,9 +134,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) diff --git a/src/square/bookings/raw_client.py b/src/square/bookings/raw_client.py index 307d72d8..a922521d 100644 --- a/src/square/bookings/raw_client.py +++ b/src/square/bookings/raw_client.py @@ -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 @@ -44,7 +44,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. @@ -79,7 +79,7 @@ def list( Returns ------- - SyncPager[Booking] + SyncPager[Booking, ListBookingsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -118,9 +118,7 @@ def list( start_at_max=start_at_max, 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) @@ -604,7 +602,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. @@ -639,7 +637,7 @@ async def list( Returns ------- - AsyncPager[Booking] + AsyncPager[Booking, ListBookingsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -681,9 +679,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) diff --git a/src/square/bookings/team_member_profiles/client.py b/src/square/bookings/team_member_profiles/client.py index 8d3dae39..d32b5dbe 100644 --- a/src/square/bookings/team_member_profiles/client.py +++ b/src/square/bookings/team_member_profiles/client.py @@ -6,6 +6,7 @@ from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions from ...types.get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse +from ...types.list_team_member_booking_profiles_response import ListTeamMemberBookingProfilesResponse from ...types.team_member_booking_profile import TeamMemberBookingProfile from .raw_client import AsyncRawTeamMemberProfilesClient, RawTeamMemberProfilesClient @@ -33,7 +34,7 @@ def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberBookingProfile]: + ) -> SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: """ Lists booking profiles for team members. @@ -56,7 +57,7 @@ def list( Returns ------- - SyncPager[TeamMemberBookingProfile] + SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] Success Examples @@ -143,7 +144,7 @@ async def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberBookingProfile]: + ) -> AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: """ Lists booking profiles for team members. @@ -166,7 +167,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberBookingProfile] + AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] Success Examples diff --git a/src/square/bookings/team_member_profiles/raw_client.py b/src/square/bookings/team_member_profiles/raw_client.py index 99feb486..6cef3353 100644 --- a/src/square/bookings/team_member_profiles/raw_client.py +++ b/src/square/bookings/team_member_profiles/raw_client.py @@ -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.get_team_member_booking_profile_response import GetTeamMemberBookingProfileResponse @@ -27,7 +27,7 @@ def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberBookingProfile]: + ) -> SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: """ Lists booking profiles for team members. @@ -50,7 +50,7 @@ def list( Returns ------- - SyncPager[TeamMemberBookingProfile] + SyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -83,9 +83,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) @@ -143,7 +141,7 @@ async def list( cursor: typing.Optional[str] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberBookingProfile]: + ) -> AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse]: """ Lists booking profiles for team members. @@ -166,7 +164,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberBookingProfile] + AsyncPager[TeamMemberBookingProfile, ListTeamMemberBookingProfilesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -202,9 +200,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) diff --git a/src/square/cards/client.py b/src/square/cards/client.py index ff00ded3..74c8b8e7 100644 --- a/src/square/cards/client.py +++ b/src/square/cards/client.py @@ -10,6 +10,7 @@ from ..types.create_card_response import CreateCardResponse from ..types.disable_card_response import DisableCardResponse from ..types.get_card_response import GetCardResponse +from ..types.list_cards_response import ListCardsResponse from ..types.sort_order import SortOrder from .raw_client import AsyncRawCardsClient, RawCardsClient @@ -41,7 +42,7 @@ def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Card]: + ) -> SyncPager[Card, ListCardsResponse]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -74,7 +75,7 @@ def list( Returns ------- - SyncPager[Card] + SyncPager[Card, ListCardsResponse] Success Examples @@ -271,7 +272,7 @@ async def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Card]: + ) -> AsyncPager[Card, ListCardsResponse]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -304,7 +305,7 @@ async def list( Returns ------- - AsyncPager[Card] + AsyncPager[Card, ListCardsResponse] Success Examples diff --git a/src/square/cards/raw_client.py b/src/square/cards/raw_client.py index 3056d8d0..c60727ee 100644 --- a/src/square/cards/raw_client.py +++ b/src/square/cards/raw_client.py @@ -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 @@ -36,7 +36,7 @@ def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Card]: + ) -> SyncPager[Card, ListCardsResponse]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -69,7 +69,7 @@ def list( Returns ------- - SyncPager[Card] + SyncPager[Card, ListCardsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -104,9 +104,7 @@ def list( sort_order=sort_order, 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) @@ -278,7 +276,7 @@ async def list( reference_id: typing.Optional[str] = None, sort_order: typing.Optional[SortOrder] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Card]: + ) -> AsyncPager[Card, ListCardsResponse]: """ Retrieves a list of cards owned by the account making the request. A max of 25 cards will be returned. @@ -311,7 +309,7 @@ async def list( Returns ------- - AsyncPager[Card] + AsyncPager[Card, ListCardsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -349,9 +347,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) diff --git a/src/square/cash_drawers/shifts/client.py b/src/square/cash_drawers/shifts/client.py index fa698f2b..bd5a8a0d 100644 --- a/src/square/cash_drawers/shifts/client.py +++ b/src/square/cash_drawers/shifts/client.py @@ -8,6 +8,8 @@ from ...types.cash_drawer_shift_event import CashDrawerShiftEvent from ...types.cash_drawer_shift_summary import CashDrawerShiftSummary from ...types.get_cash_drawer_shift_response import GetCashDrawerShiftResponse +from ...types.list_cash_drawer_shift_events_response import ListCashDrawerShiftEventsResponse +from ...types.list_cash_drawer_shifts_response import ListCashDrawerShiftsResponse from ...types.sort_order import SortOrder from .raw_client import AsyncRawShiftsClient, RawShiftsClient @@ -37,7 +39,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftSummary]: + ) -> SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -69,7 +71,7 @@ def list( Returns ------- - SyncPager[CashDrawerShiftSummary] + SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] Success Examples @@ -149,7 +151,7 @@ def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftEvent]: + ) -> SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: """ Provides a paginated list of events for a single cash drawer shift. @@ -173,7 +175,7 @@ def list_events( Returns ------- - SyncPager[CashDrawerShiftEvent] + SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] Success Examples @@ -225,7 +227,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftSummary]: + ) -> AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -257,7 +259,7 @@ async def list( Returns ------- - AsyncPager[CashDrawerShiftSummary] + AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] Success Examples @@ -354,7 +356,7 @@ async def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftEvent]: + ) -> AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: """ Provides a paginated list of events for a single cash drawer shift. @@ -378,7 +380,7 @@ async def list_events( Returns ------- - AsyncPager[CashDrawerShiftEvent] + AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] Success Examples diff --git a/src/square/cash_drawers/shifts/raw_client.py b/src/square/cash_drawers/shifts/raw_client.py index facd1eba..7819b495 100644 --- a/src/square/cash_drawers/shifts/raw_client.py +++ b/src/square/cash_drawers/shifts/raw_client.py @@ -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.cash_drawer_shift_event import CashDrawerShiftEvent @@ -32,7 +32,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftSummary]: + ) -> SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -64,7 +64,7 @@ def list( Returns ------- - SyncPager[CashDrawerShiftSummary] + SyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -101,9 +101,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) @@ -163,7 +161,7 @@ def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CashDrawerShiftEvent]: + ) -> SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: """ Provides a paginated list of events for a single cash drawer shift. @@ -187,7 +185,7 @@ def list_events( Returns ------- - SyncPager[CashDrawerShiftEvent] + SyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -219,9 +217,7 @@ def list_events( 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) @@ -242,7 +238,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftSummary]: + ) -> AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse]: """ Provides the details for all of the cash drawer shifts for a location in a date range. @@ -274,7 +270,7 @@ async def list( Returns ------- - AsyncPager[CashDrawerShiftSummary] + AsyncPager[CashDrawerShiftSummary, ListCashDrawerShiftsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -314,9 +310,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) @@ -376,7 +370,7 @@ async def list_events( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CashDrawerShiftEvent]: + ) -> AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse]: """ Provides a paginated list of events for a single cash drawer shift. @@ -400,7 +394,7 @@ async def list_events( Returns ------- - AsyncPager[CashDrawerShiftEvent] + AsyncPager[CashDrawerShiftEvent, ListCashDrawerShiftEventsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -435,9 +429,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) diff --git a/src/square/catalog/client.py b/src/square/catalog/client.py index a13255b5..b644e1c9 100644 --- a/src/square/catalog/client.py +++ b/src/square/catalog/client.py @@ -18,6 +18,7 @@ from ..types.catalog_item_product_type import CatalogItemProductType from ..types.catalog_object import CatalogObject from ..types.catalog_object_type import CatalogObjectType +from ..types.list_catalog_response import ListCatalogResponse from ..types.search_catalog_items_request_stock_level import SearchCatalogItemsRequestStockLevel from ..types.search_catalog_items_response import SearchCatalogItemsResponse from ..types.search_catalog_objects_response import SearchCatalogObjectsResponse @@ -333,7 +334,7 @@ def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CatalogObject]: + ) -> SyncPager[CatalogObject, ListCatalogResponse]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -378,7 +379,7 @@ def list( Returns ------- - SyncPager[CatalogObject] + SyncPager[CatalogObject, ListCatalogResponse] Success Examples @@ -1101,7 +1102,7 @@ async def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CatalogObject]: + ) -> AsyncPager[CatalogObject, ListCatalogResponse]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -1146,7 +1147,7 @@ async def list( Returns ------- - AsyncPager[CatalogObject] + AsyncPager[CatalogObject, ListCatalogResponse] Success Examples diff --git a/src/square/catalog/raw_client.py b/src/square/catalog/raw_client.py index 8c408b9a..a2fd5d89 100644 --- a/src/square/catalog/raw_client.py +++ b/src/square/catalog/raw_client.py @@ -6,7 +6,7 @@ from ..core.api_error import ApiError from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ..core.http_response import AsyncHttpResponse, HttpResponse -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 @@ -329,7 +329,7 @@ def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CatalogObject]: + ) -> SyncPager[CatalogObject, ListCatalogResponse]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -374,7 +374,7 @@ def list( Returns ------- - SyncPager[CatalogObject] + SyncPager[CatalogObject, ListCatalogResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -405,9 +405,7 @@ def list( catalog_version=catalog_version, 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) @@ -1078,7 +1076,7 @@ async def list( types: typing.Optional[str] = None, catalog_version: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CatalogObject]: + ) -> AsyncPager[CatalogObject, ListCatalogResponse]: """ Returns a list of all [CatalogObject](entity:CatalogObject)s of the specified types in the catalog. @@ -1123,7 +1121,7 @@ async def list( Returns ------- - AsyncPager[CatalogObject] + AsyncPager[CatalogObject, ListCatalogResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1157,9 +1155,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) diff --git a/src/square/channels/client.py b/src/square/channels/client.py index 05979621..59b5610c 100644 --- a/src/square/channels/client.py +++ b/src/square/channels/client.py @@ -8,6 +8,7 @@ from ..types.bulk_retrieve_channels_response import BulkRetrieveChannelsResponse from ..types.channel import Channel from ..types.channel_status import ChannelStatus +from ..types.list_channels_response import ListChannelsResponse from ..types.reference_type import ReferenceType from ..types.retrieve_channel_response import RetrieveChannelResponse from .raw_client import AsyncRawChannelsClient, RawChannelsClient @@ -40,7 +41,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Channel]: + ) -> SyncPager[Channel, ListChannelsResponse]: """ @@ -67,7 +68,7 @@ def list( Returns ------- - SyncPager[Channel] + SyncPager[Channel, ListChannelsResponse] Success Examples @@ -189,7 +190,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Channel]: + ) -> AsyncPager[Channel, ListChannelsResponse]: """ @@ -216,7 +217,7 @@ async def list( Returns ------- - AsyncPager[Channel] + AsyncPager[Channel, ListChannelsResponse] Success Examples diff --git a/src/square/channels/raw_client.py b/src/square/channels/raw_client.py index 9fa4886d..9e647c4c 100644 --- a/src/square/channels/raw_client.py +++ b/src/square/channels/raw_client.py @@ -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.bulk_retrieve_channels_response import BulkRetrieveChannelsResponse @@ -34,7 +34,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Channel]: + ) -> SyncPager[Channel, ListChannelsResponse]: """ @@ -61,7 +61,7 @@ def list( Returns ------- - SyncPager[Channel] + SyncPager[Channel, ListChannelsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -96,9 +96,7 @@ def list( limit=limit, 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) @@ -202,7 +200,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Channel]: + ) -> AsyncPager[Channel, ListChannelsResponse]: """ @@ -229,7 +227,7 @@ async def list( Returns ------- - AsyncPager[Channel] + AsyncPager[Channel, ListChannelsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -267,9 +265,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) diff --git a/src/square/checkout/payment_links/client.py b/src/square/checkout/payment_links/client.py index 26ece991..b1bed60b 100644 --- a/src/square/checkout/payment_links/client.py +++ b/src/square/checkout/payment_links/client.py @@ -13,6 +13,7 @@ from ...types.create_payment_link_response import CreatePaymentLinkResponse from ...types.delete_payment_link_response import DeletePaymentLinkResponse from ...types.get_payment_link_response import GetPaymentLinkResponse +from ...types.list_payment_links_response import ListPaymentLinksResponse from ...types.payment_link import PaymentLink from ...types.update_payment_link_response import UpdatePaymentLinkResponse from .raw_client import AsyncRawPaymentLinksClient, RawPaymentLinksClient @@ -42,7 +43,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentLink]: + ) -> SyncPager[PaymentLink, ListPaymentLinksResponse]: """ Lists all payment links. @@ -66,7 +67,7 @@ def list( Returns ------- - SyncPager[PaymentLink] + SyncPager[PaymentLink, ListPaymentLinksResponse] Success Examples @@ -301,7 +302,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentLink]: + ) -> AsyncPager[PaymentLink, ListPaymentLinksResponse]: """ Lists all payment links. @@ -325,7 +326,7 @@ async def list( Returns ------- - AsyncPager[PaymentLink] + AsyncPager[PaymentLink, ListPaymentLinksResponse] Success Examples diff --git a/src/square/checkout/payment_links/raw_client.py b/src/square/checkout/payment_links/raw_client.py index d1ff1b26..a0c93ab4 100644 --- a/src/square/checkout/payment_links/raw_client.py +++ b/src/square/checkout/payment_links/raw_client.py @@ -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 @@ -37,7 +37,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentLink]: + ) -> SyncPager[PaymentLink, ListPaymentLinksResponse]: """ Lists all payment links. @@ -61,7 +61,7 @@ def list( Returns ------- - SyncPager[PaymentLink] + SyncPager[PaymentLink, ListPaymentLinksResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -90,9 +90,7 @@ def list( limit=limit, 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) @@ -340,7 +338,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentLink]: + ) -> AsyncPager[PaymentLink, ListPaymentLinksResponse]: """ Lists all payment links. @@ -364,7 +362,7 @@ async def list( Returns ------- - AsyncPager[PaymentLink] + AsyncPager[PaymentLink, ListPaymentLinksResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -396,9 +394,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) diff --git a/src/square/core/client_wrapper.py b/src/square/core/client_wrapper.py index bc088c7e..9494af09 100644 --- a/src/square/core/client_wrapper.py +++ b/src/square/core/client_wrapper.py @@ -24,10 +24,10 @@ def __init__( def get_headers(self) -> typing.Dict[str, str]: headers: typing.Dict[str, str] = { - "User-Agent": "squareup/43.2.0.20251016", + "User-Agent": "squareup/43.3.0.20251016", "X-Fern-Language": "Python", "X-Fern-SDK-Name": "squareup", - "X-Fern-SDK-Version": "43.2.0.20251016", + "X-Fern-SDK-Version": "43.3.0.20251016", **(self.get_custom_headers() or {}), } token = self._get_token() diff --git a/src/square/core/custom_pagination.py b/src/square/core/custom_pagination.py new file mode 100644 index 00000000..5de2c7a8 --- /dev/null +++ b/src/square/core/custom_pagination.py @@ -0,0 +1,152 @@ +# This file was auto-generated by Fern from our API Definition. + +""" +Custom Pagination Support + +This file is designed to be modified by SDK users to implement their own +pagination logic. The generator will import SyncCustomPager and AsyncCustomPager +from this module when custom pagination is used. + +Users should: +1. Implement their custom pager (e.g., PayrocPager, MyCustomPager, etc.) +2. Create adapter classes (SyncCustomPager/AsyncCustomPager) that bridge + between the generated SDK code and their custom pager implementation +""" + +from __future__ import annotations + +from typing import Any, AsyncIterator, Generic, Iterator, TypeVar + +# Import the base utilities you'll need +# Adjust these imports based on your actual structure +try: + from .client_wrapper import AsyncClientWrapper, SyncClientWrapper +except ImportError: + # Fallback for type hints + AsyncClientWrapper = Any # type: ignore + SyncClientWrapper = Any # type: ignore + +TItem = TypeVar("TItem") +TResponse = TypeVar("TResponse") + + +class SyncCustomPager(Generic[TItem, TResponse]): + """ + Adapter for custom synchronous pagination. + + The generator will call this with: + SyncCustomPager(initial_response=response, client_wrapper=client_wrapper) + + Implement this class to extract pagination metadata from your response + and delegate to your custom pager implementation. + + Example implementation: + + class SyncCustomPager(Generic[TItem, TResponse]): + def __init__( + self, + *, + initial_response: TResponse, + client_wrapper: SyncClientWrapper, + ): + # Extract data and pagination metadata from response + data = initial_response.data # Adjust based on your response structure + links = initial_response.links + + # Initialize your custom pager + self._pager = MyCustomPager( + current_page=Page(data), + httpx_client=client_wrapper.httpx_client, + get_headers=client_wrapper.get_headers, + # ... other parameters + ) + + def __iter__(self): + return iter(self._pager) + + # Delegate other methods to your pager... + """ + + def __init__( + self, + *, + initial_response: TResponse, + client_wrapper: SyncClientWrapper, + ): + """ + Initialize the custom pager. + + Args: + initial_response: The parsed API response from the first request + client_wrapper: The client wrapper providing HTTP client and utilities + """ + raise NotImplementedError( + "SyncCustomPager must be implemented. " + "Please implement this class in core/custom_pagination.py to define your pagination logic. " + "See the class docstring for examples." + ) + + def __iter__(self) -> Iterator[TItem]: + """Iterate through all items across all pages.""" + raise NotImplementedError("Must implement __iter__ method") + + +class AsyncCustomPager(Generic[TItem, TResponse]): + """ + Adapter for custom asynchronous pagination. + + The generator will call this with: + AsyncCustomPager(initial_response=response, client_wrapper=client_wrapper) + + Implement this class to extract pagination metadata from your response + and delegate to your custom async pager implementation. + + Example implementation: + + class AsyncCustomPager(Generic[TItem, TResponse]): + def __init__( + self, + *, + initial_response: TResponse, + client_wrapper: AsyncClientWrapper, + ): + # Extract data and pagination metadata from response + data = initial_response.data # Adjust based on your response structure + links = initial_response.links + + # Initialize your custom async pager + self._pager = MyAsyncCustomPager( + current_page=Page(data), + httpx_client=client_wrapper.httpx_client, + get_headers=client_wrapper.get_headers, + # ... other parameters + ) + + async def __aiter__(self): + return self._pager.__aiter__() + + # Delegate other methods to your pager... + """ + + def __init__( + self, + *, + initial_response: TResponse, + client_wrapper: AsyncClientWrapper, + ): + """ + Initialize the custom async pager. + + Args: + initial_response: The parsed API response from the first request + client_wrapper: The client wrapper providing HTTP client and utilities + """ + raise NotImplementedError( + "AsyncCustomPager must be implemented. " + "Please implement this class in core/custom_pagination.py to define your pagination logic. " + "See the class docstring for examples." + ) + + async def __aiter__(self) -> AsyncIterator[TItem]: + """Asynchronously iterate through all items across all pages.""" + raise NotImplementedError("Must implement __aiter__ method") diff --git a/src/square/core/http_sse/__init__.py b/src/square/core/http_sse/__init__.py new file mode 100644 index 00000000..730e5a33 --- /dev/null +++ b/src/square/core/http_sse/__init__.py @@ -0,0 +1,42 @@ +# This file was auto-generated by Fern from our API Definition. + +# isort: skip_file + +import typing +from importlib import import_module + +if typing.TYPE_CHECKING: + from ._api import EventSource, aconnect_sse, connect_sse + from ._exceptions import SSEError + from ._models import ServerSentEvent +_dynamic_imports: typing.Dict[str, str] = { + "EventSource": "._api", + "SSEError": "._exceptions", + "ServerSentEvent": "._models", + "aconnect_sse": "._api", + "connect_sse": "._api", +} + + +def __getattr__(attr_name: str) -> typing.Any: + module_name = _dynamic_imports.get(attr_name) + if module_name is None: + raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}") + try: + module = import_module(module_name, __package__) + if module_name == f".{attr_name}": + return module + else: + return getattr(module, attr_name) + except ImportError as e: + raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e + except AttributeError as e: + raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e + + +def __dir__(): + lazy_attrs = list(_dynamic_imports.keys()) + return sorted(lazy_attrs) + + +__all__ = ["EventSource", "SSEError", "ServerSentEvent", "aconnect_sse", "connect_sse"] diff --git a/src/square/core/http_sse/_api.py b/src/square/core/http_sse/_api.py new file mode 100644 index 00000000..f900b3b6 --- /dev/null +++ b/src/square/core/http_sse/_api.py @@ -0,0 +1,112 @@ +# This file was auto-generated by Fern from our API Definition. + +import re +from contextlib import asynccontextmanager, contextmanager +from typing import Any, AsyncGenerator, AsyncIterator, Iterator, cast + +import httpx +from ._decoders import SSEDecoder +from ._exceptions import SSEError +from ._models import ServerSentEvent + + +class EventSource: + def __init__(self, response: httpx.Response) -> None: + self._response = response + + def _check_content_type(self) -> None: + content_type = self._response.headers.get("content-type", "").partition(";")[0] + if "text/event-stream" not in content_type: + raise SSEError( + f"Expected response header Content-Type to contain 'text/event-stream', got {content_type!r}" + ) + + def _get_charset(self) -> str: + """Extract charset from Content-Type header, fallback to UTF-8.""" + content_type = self._response.headers.get("content-type", "") + + # Parse charset parameter using regex + charset_match = re.search(r"charset=([^;\s]+)", content_type, re.IGNORECASE) + if charset_match: + charset = charset_match.group(1).strip("\"'") + # Validate that it's a known encoding + try: + # Test if the charset is valid by trying to encode/decode + "test".encode(charset).decode(charset) + return charset + except (LookupError, UnicodeError): + # If charset is invalid, fall back to UTF-8 + pass + + # Default to UTF-8 if no charset specified or invalid charset + return "utf-8" + + @property + def response(self) -> httpx.Response: + return self._response + + def iter_sse(self) -> Iterator[ServerSentEvent]: + self._check_content_type() + decoder = SSEDecoder() + charset = self._get_charset() + + buffer = "" + for chunk in self._response.iter_bytes(): + # Decode chunk using detected charset + text_chunk = chunk.decode(charset, errors="replace") + buffer += text_chunk + + # Process complete lines + while "\n" in buffer: + line, buffer = buffer.split("\n", 1) + line = line.rstrip("\r") + sse = decoder.decode(line) + # when we reach a "\n\n" => line = '' + # => decoder will attempt to return an SSE Event + if sse is not None: + yield sse + + # Process any remaining data in buffer + if buffer.strip(): + line = buffer.rstrip("\r") + sse = decoder.decode(line) + if sse is not None: + yield sse + + async def aiter_sse(self) -> AsyncGenerator[ServerSentEvent, None]: + self._check_content_type() + decoder = SSEDecoder() + lines = cast(AsyncGenerator[str, None], self._response.aiter_lines()) + try: + async for line in lines: + line = line.rstrip("\n") + sse = decoder.decode(line) + if sse is not None: + yield sse + finally: + await lines.aclose() + + +@contextmanager +def connect_sse(client: httpx.Client, method: str, url: str, **kwargs: Any) -> Iterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) + + +@asynccontextmanager +async def aconnect_sse( + client: httpx.AsyncClient, + method: str, + url: str, + **kwargs: Any, +) -> AsyncIterator[EventSource]: + headers = kwargs.pop("headers", {}) + headers["Accept"] = "text/event-stream" + headers["Cache-Control"] = "no-store" + + async with client.stream(method, url, headers=headers, **kwargs) as response: + yield EventSource(response) diff --git a/src/square/core/http_sse/_decoders.py b/src/square/core/http_sse/_decoders.py new file mode 100644 index 00000000..339b0890 --- /dev/null +++ b/src/square/core/http_sse/_decoders.py @@ -0,0 +1,61 @@ +# This file was auto-generated by Fern from our API Definition. + +from typing import List, Optional + +from ._models import ServerSentEvent + + +class SSEDecoder: + def __init__(self) -> None: + self._event = "" + self._data: List[str] = [] + self._last_event_id = "" + self._retry: Optional[int] = None + + def decode(self, line: str) -> Optional[ServerSentEvent]: + # See: https://html.spec.whatwg.org/multipage/server-sent-events.html#event-stream-interpretation # noqa: E501 + + if not line: + if not self._event and not self._data and not self._last_event_id and self._retry is None: + return None + + sse = ServerSentEvent( + event=self._event, + data="\n".join(self._data), + id=self._last_event_id, + retry=self._retry, + ) + + # NOTE: as per the SSE spec, do not reset last_event_id. + self._event = "" + self._data = [] + self._retry = None + + return sse + + if line.startswith(":"): + return None + + fieldname, _, value = line.partition(":") + + if value.startswith(" "): + value = value[1:] + + if fieldname == "event": + self._event = value + elif fieldname == "data": + self._data.append(value) + elif fieldname == "id": + if "\0" in value: + pass + else: + self._last_event_id = value + elif fieldname == "retry": + try: + self._retry = int(value) + except (TypeError, ValueError): + pass + else: + pass # Field is ignored. + + return None diff --git a/src/square/core/http_sse/_exceptions.py b/src/square/core/http_sse/_exceptions.py new file mode 100644 index 00000000..81605a8a --- /dev/null +++ b/src/square/core/http_sse/_exceptions.py @@ -0,0 +1,7 @@ +# This file was auto-generated by Fern from our API Definition. + +import httpx + + +class SSEError(httpx.TransportError): + pass diff --git a/src/square/core/http_sse/_models.py b/src/square/core/http_sse/_models.py new file mode 100644 index 00000000..1af57f8f --- /dev/null +++ b/src/square/core/http_sse/_models.py @@ -0,0 +1,17 @@ +# This file was auto-generated by Fern from our API Definition. + +import json +from dataclasses import dataclass +from typing import Any, Optional + + +@dataclass(frozen=True) +class ServerSentEvent: + event: str = "message" + data: str = "" + id: str = "" + retry: Optional[int] = None + + def json(self) -> Any: + """Parse the data field as JSON.""" + return json.loads(self.data) diff --git a/src/square/core/pagination.py b/src/square/core/pagination.py index 97bcb645..760b0899 100644 --- a/src/square/core/pagination.py +++ b/src/square/core/pagination.py @@ -5,10 +5,10 @@ from dataclasses import dataclass from typing import AsyncIterator, Awaitable, Callable, Generic, Iterator, List, Optional, TypeVar -from .http_response import BaseHttpResponse - # Generic to represent the underlying type of the results within a page T = TypeVar("T") +# Generic to represent the type of the API response +R = TypeVar("R") # SDKs implement a Page ABC per-pagination request, the endpoint then returns a pager that wraps this type @@ -23,11 +23,11 @@ @dataclass(frozen=True) -class SyncPager(Generic[T]): - get_next: Optional[Callable[[], Optional[SyncPager[T]]]] +class SyncPager(Generic[T, R]): + get_next: Optional[Callable[[], Optional[SyncPager[T, R]]]] has_next: bool items: Optional[List[T]] - response: Optional[BaseHttpResponse] + response: R # Here we type ignore the iterator to avoid a mypy error # caused by the type conflict with Pydanitc's __iter__ method @@ -37,8 +37,8 @@ def __iter__(self) -> Iterator[T]: # type: ignore[override] if page.items is not None: yield from page.items - def iter_pages(self) -> Iterator[SyncPager[T]]: - page: Optional[SyncPager[T]] = self + def iter_pages(self) -> Iterator[SyncPager[T, R]]: + page: Optional[SyncPager[T, R]] = self while page is not None: yield page @@ -49,16 +49,16 @@ def iter_pages(self) -> Iterator[SyncPager[T]]: if page is None or page.items is None or len(page.items) == 0: return - def next_page(self) -> Optional[SyncPager[T]]: + def next_page(self) -> Optional[SyncPager[T, R]]: return self.get_next() if self.get_next is not None else None @dataclass(frozen=True) -class AsyncPager(Generic[T]): - get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T]]]]] +class AsyncPager(Generic[T, R]): + get_next: Optional[Callable[[], Awaitable[Optional[AsyncPager[T, R]]]]] has_next: bool items: Optional[List[T]] - response: Optional[BaseHttpResponse] + response: R async def __aiter__(self) -> AsyncIterator[T]: async for page in self.iter_pages(): @@ -66,8 +66,8 @@ async def __aiter__(self) -> AsyncIterator[T]: for item in page.items: yield item - async def iter_pages(self) -> AsyncIterator[AsyncPager[T]]: - page: Optional[AsyncPager[T]] = self + async def iter_pages(self) -> AsyncIterator[AsyncPager[T, R]]: + page: Optional[AsyncPager[T, R]] = self while page is not None: yield page @@ -78,5 +78,5 @@ async def iter_pages(self) -> AsyncIterator[AsyncPager[T]]: if page is None or page.items is None or len(page.items) == 0: return - async def next_page(self) -> Optional[AsyncPager[T]]: + async def next_page(self) -> Optional[AsyncPager[T, R]]: return await self.get_next() if self.get_next is not None else None diff --git a/src/square/core/pydantic_utilities.py b/src/square/core/pydantic_utilities.py index 8906cdfa..185e5c4f 100644 --- a/src/square/core/pydantic_utilities.py +++ b/src/square/core/pydantic_utilities.py @@ -220,7 +220,9 @@ def universal_root_validator( ) -> Callable[[AnyCallable], AnyCallable]: def decorator(func: AnyCallable) -> AnyCallable: if IS_PYDANTIC_V2: - return cast(AnyCallable, pydantic.model_validator(mode="before" if pre else "after")(func)) # type: ignore[attr-defined] + # In Pydantic v2, for RootModel we always use "before" mode + # The custom validators transform the input value before the model is created + return cast(AnyCallable, pydantic.model_validator(mode="before")(func)) # type: ignore[attr-defined] return cast(AnyCallable, pydantic.root_validator(pre=pre)(func)) # type: ignore[call-overload] return decorator diff --git a/src/square/core/unchecked_base_model.py b/src/square/core/unchecked_base_model.py index ae59845f..9ea71ca6 100644 --- a/src/square/core/unchecked_base_model.py +++ b/src/square/core/unchecked_base_model.py @@ -175,7 +175,42 @@ def _convert_undiscriminated_union_type(union_type: typing.Type[typing.Any], obj except Exception: continue - # If none of the types work, just return the first successful cast + # If none of the types work, try matching literal fields first, then fall back + # First pass: try types where all literal fields match the object's values + for inner_type in inner_types: + if inspect.isclass(inner_type) and issubclass(inner_type, pydantic.BaseModel): + fields = _get_model_fields(inner_type) + literal_fields_match = True + + for field_name, field in fields.items(): + # Check if this field has a Literal type + if IS_PYDANTIC_V2: + field_type = field.annotation # type: ignore # Pydantic v2 + else: + field_type = field.outer_type_ # type: ignore # Pydantic v1 + + if is_literal_type(field_type): # type: ignore[arg-type] + field_default = _get_field_default(field) + name_or_alias = get_field_to_alias_mapping(inner_type).get(field_name, field_name) + # Get the value from the object + if isinstance(object_, dict): + object_value = object_.get(name_or_alias) + else: + object_value = getattr(object_, name_or_alias, None) + + # If the literal field value doesn't match, this type is not a match + if object_value is not None and field_default != object_value: + literal_fields_match = False + break + + # If all literal fields match, try to construct this type + if literal_fields_match: + try: + return construct_type(object_=object_, type_=inner_type) + except Exception: + continue + + # Second pass: if no literal matches, just return the first successful cast for inner_type in inner_types: try: return construct_type(object_=object_, type_=inner_type) diff --git a/src/square/customers/client.py b/src/square/customers/client.py index a4f268c0..3ae9e1be 100644 --- a/src/square/customers/client.py +++ b/src/square/customers/client.py @@ -21,6 +21,7 @@ from ..types.customer_sort_field import CustomerSortField from ..types.delete_customer_response import DeleteCustomerResponse from ..types.get_customer_response import GetCustomerResponse +from ..types.list_customers_response import ListCustomersResponse from ..types.search_customers_response import SearchCustomersResponse from ..types.sort_order import SortOrder from ..types.update_customer_response import UpdateCustomerResponse @@ -69,7 +70,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Customer]: + ) -> SyncPager[Customer, ListCustomersResponse]: """ Lists customer profiles associated with a Square account. @@ -112,7 +113,7 @@ def list( Returns ------- - SyncPager[Customer] + SyncPager[Customer, ListCustomersResponse] Success Examples @@ -855,7 +856,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Customer]: + ) -> AsyncPager[Customer, ListCustomersResponse]: """ Lists customer profiles associated with a Square account. @@ -898,7 +899,7 @@ async def list( Returns ------- - AsyncPager[Customer] + AsyncPager[Customer, ListCustomersResponse] Success Examples diff --git a/src/square/customers/custom_attribute_definitions/client.py b/src/square/customers/custom_attribute_definitions/client.py index 0e738370..126fb37f 100644 --- a/src/square/customers/custom_attribute_definitions/client.py +++ b/src/square/customers/custom_attribute_definitions/client.py @@ -18,6 +18,7 @@ DeleteCustomerCustomAttributeDefinitionResponse, ) from ...types.get_customer_custom_attribute_definition_response import GetCustomerCustomAttributeDefinitionResponse +from ...types.list_customer_custom_attribute_definitions_response import ListCustomerCustomAttributeDefinitionsResponse from ...types.update_customer_custom_attribute_definition_response import ( UpdateCustomerCustomAttributeDefinitionResponse, ) @@ -48,7 +49,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -74,7 +75,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] Success Examples @@ -421,7 +422,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -447,7 +448,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] Success Examples diff --git a/src/square/customers/custom_attribute_definitions/raw_client.py b/src/square/customers/custom_attribute_definitions/raw_client.py index 0a60225d..69c4ff0e 100644 --- a/src/square/customers/custom_attribute_definitions/raw_client.py +++ b/src/square/customers/custom_attribute_definitions/raw_client.py @@ -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 @@ -43,7 +43,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -69,7 +69,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -98,9 +98,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) @@ -437,7 +435,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse]: """ Lists the customer-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -463,7 +461,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListCustomerCustomAttributeDefinitionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -495,9 +493,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) diff --git a/src/square/customers/custom_attributes/client.py b/src/square/customers/custom_attributes/client.py index d6984d0c..e7b193b4 100644 --- a/src/square/customers/custom_attributes/client.py +++ b/src/square/customers/custom_attributes/client.py @@ -9,6 +9,7 @@ from ...types.custom_attribute import CustomAttribute from ...types.delete_customer_custom_attribute_response import DeleteCustomerCustomAttributeResponse from ...types.get_customer_custom_attribute_response import GetCustomerCustomAttributeResponse +from ...types.list_customer_custom_attributes_response import ListCustomerCustomAttributesResponse from ...types.upsert_customer_custom_attribute_response import UpsertCustomerCustomAttributeResponse from .raw_client import AsyncRawCustomAttributesClient, RawCustomAttributesClient @@ -39,7 +40,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -75,7 +76,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] Success Examples @@ -309,7 +310,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -345,7 +346,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] Success Examples diff --git a/src/square/customers/custom_attributes/raw_client.py b/src/square/customers/custom_attributes/raw_client.py index 02b43b97..bd97fb7e 100644 --- a/src/square/customers/custom_attributes/raw_client.py +++ b/src/square/customers/custom_attributes/raw_client.py @@ -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 @@ -34,7 +34,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -70,7 +70,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -102,9 +102,7 @@ def list( with_definitions=with_definitions, 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) @@ -325,7 +323,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a customer profile. @@ -361,7 +359,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListCustomerCustomAttributesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -396,9 +394,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) diff --git a/src/square/customers/groups/client.py b/src/square/customers/groups/client.py index 8418c51b..fb9efafd 100644 --- a/src/square/customers/groups/client.py +++ b/src/square/customers/groups/client.py @@ -11,6 +11,7 @@ from ...types.customer_group import CustomerGroup from ...types.delete_customer_group_response import DeleteCustomerGroupResponse from ...types.get_customer_group_response import GetCustomerGroupResponse +from ...types.list_customer_groups_response import ListCustomerGroupsResponse from ...types.remove_group_from_customer_response import RemoveGroupFromCustomerResponse from ...types.update_customer_group_response import UpdateCustomerGroupResponse from .raw_client import AsyncRawGroupsClient, RawGroupsClient @@ -40,7 +41,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerGroup]: + ) -> SyncPager[CustomerGroup, ListCustomerGroupsResponse]: """ Retrieves the list of customer groups of a business. @@ -63,7 +64,7 @@ def list( Returns ------- - SyncPager[CustomerGroup] + SyncPager[CustomerGroup, ListCustomerGroupsResponse] Success Examples @@ -334,7 +335,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerGroup]: + ) -> AsyncPager[CustomerGroup, ListCustomerGroupsResponse]: """ Retrieves the list of customer groups of a business. @@ -357,7 +358,7 @@ async def list( Returns ------- - AsyncPager[CustomerGroup] + AsyncPager[CustomerGroup, ListCustomerGroupsResponse] Success Examples diff --git a/src/square/customers/groups/raw_client.py b/src/square/customers/groups/raw_client.py index e3c954ee..2637aaa3 100644 --- a/src/square/customers/groups/raw_client.py +++ b/src/square/customers/groups/raw_client.py @@ -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 @@ -35,7 +35,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerGroup]: + ) -> SyncPager[CustomerGroup, ListCustomerGroupsResponse]: """ Retrieves the list of customer groups of a business. @@ -58,7 +58,7 @@ def list( Returns ------- - SyncPager[CustomerGroup] + SyncPager[CustomerGroup, ListCustomerGroupsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -87,9 +87,7 @@ def list( limit=limit, 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) @@ -383,7 +381,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerGroup]: + ) -> AsyncPager[CustomerGroup, ListCustomerGroupsResponse]: """ Retrieves the list of customer groups of a business. @@ -406,7 +404,7 @@ async def list( Returns ------- - AsyncPager[CustomerGroup] + AsyncPager[CustomerGroup, ListCustomerGroupsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -438,9 +436,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) diff --git a/src/square/customers/raw_client.py b/src/square/customers/raw_client.py index e46f9920..ad3972c7 100644 --- a/src/square/customers/raw_client.py +++ b/src/square/customers/raw_client.py @@ -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 @@ -47,7 +47,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Customer]: + ) -> SyncPager[Customer, ListCustomersResponse]: """ Lists customer profiles associated with a Square account. @@ -90,7 +90,7 @@ def list( Returns ------- - SyncPager[Customer] + SyncPager[Customer, ListCustomersResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -125,9 +125,7 @@ def list( count=count, 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) @@ -822,7 +820,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, count: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Customer]: + ) -> AsyncPager[Customer, ListCustomersResponse]: """ Lists customer profiles associated with a Square account. @@ -865,7 +863,7 @@ async def list( Returns ------- - AsyncPager[Customer] + AsyncPager[Customer, ListCustomersResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -903,9 +901,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) diff --git a/src/square/customers/segments/client.py b/src/square/customers/segments/client.py index d0925abe..d95eab9e 100644 --- a/src/square/customers/segments/client.py +++ b/src/square/customers/segments/client.py @@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions from ...types.customer_segment import CustomerSegment from ...types.get_customer_segment_response import GetCustomerSegmentResponse +from ...types.list_customer_segments_response import ListCustomerSegmentsResponse from .raw_client import AsyncRawSegmentsClient, RawSegmentsClient @@ -31,7 +32,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerSegment]: + ) -> SyncPager[CustomerSegment, ListCustomerSegmentsResponse]: """ Retrieves the list of customer segments of a business. @@ -54,7 +55,7 @@ def list( Returns ------- - SyncPager[CustomerSegment] + SyncPager[CustomerSegment, ListCustomerSegmentsResponse] Success Examples @@ -131,7 +132,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerSegment]: + ) -> AsyncPager[CustomerSegment, ListCustomerSegmentsResponse]: """ Retrieves the list of customer segments of a business. @@ -154,7 +155,7 @@ async def list( Returns ------- - AsyncPager[CustomerSegment] + AsyncPager[CustomerSegment, ListCustomerSegmentsResponse] Success Examples diff --git a/src/square/customers/segments/raw_client.py b/src/square/customers/segments/raw_client.py index 70fb0b0d..aead0dfe 100644 --- a/src/square/customers/segments/raw_client.py +++ b/src/square/customers/segments/raw_client.py @@ -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.customer_segment import CustomerSegment @@ -25,7 +25,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomerSegment]: + ) -> SyncPager[CustomerSegment, ListCustomerSegmentsResponse]: """ Retrieves the list of customer segments of a business. @@ -48,7 +48,7 @@ def list( Returns ------- - SyncPager[CustomerSegment] + SyncPager[CustomerSegment, ListCustomerSegmentsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -77,9 +77,7 @@ def list( limit=limit, 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) @@ -135,7 +133,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomerSegment]: + ) -> AsyncPager[CustomerSegment, ListCustomerSegmentsResponse]: """ Retrieves the list of customer segments of a business. @@ -158,7 +156,7 @@ async def list( Returns ------- - AsyncPager[CustomerSegment] + AsyncPager[CustomerSegment, ListCustomerSegmentsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -190,9 +188,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) diff --git a/src/square/devices/client.py b/src/square/devices/client.py index f739356b..f4e42b47 100644 --- a/src/square/devices/client.py +++ b/src/square/devices/client.py @@ -9,6 +9,7 @@ from ..core.request_options import RequestOptions from ..types.device import Device from ..types.get_device_response import GetDeviceResponse +from ..types.list_devices_response import ListDevicesResponse from ..types.sort_order import SortOrder from .raw_client import AsyncRawDevicesClient, RawDevicesClient @@ -41,7 +42,7 @@ def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Device]: + ) -> SyncPager[Device, ListDevicesResponse]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -69,7 +70,7 @@ def list( Returns ------- - SyncPager[Device] + SyncPager[Device, ListDevicesResponse] Success Examples @@ -160,7 +161,7 @@ async def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Device]: + ) -> AsyncPager[Device, ListDevicesResponse]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -188,7 +189,7 @@ async def list( Returns ------- - AsyncPager[Device] + AsyncPager[Device, ListDevicesResponse] Success Examples diff --git a/src/square/devices/codes/client.py b/src/square/devices/codes/client.py index 456e6f93..5d4c2819 100644 --- a/src/square/devices/codes/client.py +++ b/src/square/devices/codes/client.py @@ -10,6 +10,7 @@ from ...types.device_code import DeviceCode from ...types.device_code_status import DeviceCodeStatus from ...types.get_device_code_response import GetDeviceCodeResponse +from ...types.list_device_codes_response import ListDeviceCodesResponse from ...types.product_type import ProductType from .raw_client import AsyncRawCodesClient, RawCodesClient @@ -40,7 +41,7 @@ def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeviceCode]: + ) -> SyncPager[DeviceCode, ListDeviceCodesResponse]: """ Lists all DeviceCodes associated with the merchant. @@ -69,7 +70,7 @@ def list( Returns ------- - SyncPager[DeviceCode] + SyncPager[DeviceCode, ListDeviceCodesResponse] Success Examples @@ -204,7 +205,7 @@ async def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeviceCode]: + ) -> AsyncPager[DeviceCode, ListDeviceCodesResponse]: """ Lists all DeviceCodes associated with the merchant. @@ -233,7 +234,7 @@ async def list( Returns ------- - AsyncPager[DeviceCode] + AsyncPager[DeviceCode, ListDeviceCodesResponse] Success Examples diff --git a/src/square/devices/codes/raw_client.py b/src/square/devices/codes/raw_client.py index 2ed34670..b6aaabfb 100644 --- a/src/square/devices/codes/raw_client.py +++ b/src/square/devices/codes/raw_client.py @@ -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 @@ -35,7 +35,7 @@ def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DeviceCode]: + ) -> SyncPager[DeviceCode, ListDeviceCodesResponse]: """ Lists all DeviceCodes associated with the merchant. @@ -64,7 +64,7 @@ def list( Returns ------- - SyncPager[DeviceCode] + SyncPager[DeviceCode, ListDeviceCodesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -97,9 +97,7 @@ def list( status=status, 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) @@ -217,7 +215,7 @@ async def list( product_type: typing.Optional[ProductType] = None, status: typing.Optional[DeviceCodeStatus] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DeviceCode]: + ) -> AsyncPager[DeviceCode, ListDeviceCodesResponse]: """ Lists all DeviceCodes associated with the merchant. @@ -246,7 +244,7 @@ async def list( Returns ------- - AsyncPager[DeviceCode] + AsyncPager[DeviceCode, ListDeviceCodesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -282,9 +280,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) diff --git a/src/square/devices/raw_client.py b/src/square/devices/raw_client.py index 0fb3d170..3a5b0f9b 100644 --- a/src/square/devices/raw_client.py +++ b/src/square/devices/raw_client.py @@ -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.device import Device @@ -28,7 +28,7 @@ def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Device]: + ) -> SyncPager[Device, ListDevicesResponse]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -56,7 +56,7 @@ def list( Returns ------- - SyncPager[Device] + SyncPager[Device, ListDevicesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -89,9 +89,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) @@ -149,7 +147,7 @@ async def list( limit: typing.Optional[int] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Device]: + ) -> AsyncPager[Device, ListDevicesResponse]: """ List devices associated with the merchant. Currently, only Terminal API devices are supported. @@ -177,7 +175,7 @@ async def list( Returns ------- - AsyncPager[Device] + AsyncPager[Device, ListDevicesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -213,9 +211,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) diff --git a/src/square/disputes/client.py b/src/square/disputes/client.py index 040fd04d..88bb04dc 100644 --- a/src/square/disputes/client.py +++ b/src/square/disputes/client.py @@ -16,6 +16,7 @@ from ..types.dispute_evidence_type import DisputeEvidenceType from ..types.dispute_state import DisputeState from ..types.get_dispute_response import GetDisputeResponse +from ..types.list_disputes_response import ListDisputesResponse from ..types.submit_evidence_response import SubmitEvidenceResponse from .raw_client import AsyncRawDisputesClient, RawDisputesClient @@ -49,7 +50,7 @@ def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Dispute]: + ) -> SyncPager[Dispute, ListDisputesResponse]: """ Returns a list of disputes associated with a particular account. @@ -72,7 +73,7 @@ def list( Returns ------- - SyncPager[Dispute] + SyncPager[Dispute, ListDisputesResponse] Success Examples @@ -341,7 +342,7 @@ async def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Dispute]: + ) -> AsyncPager[Dispute, ListDisputesResponse]: """ Returns a list of disputes associated with a particular account. @@ -364,7 +365,7 @@ async def list( Returns ------- - AsyncPager[Dispute] + AsyncPager[Dispute, ListDisputesResponse] Success Examples diff --git a/src/square/disputes/evidence/client.py b/src/square/disputes/evidence/client.py index a0ada53b..1f549aac 100644 --- a/src/square/disputes/evidence/client.py +++ b/src/square/disputes/evidence/client.py @@ -8,6 +8,7 @@ from ...types.delete_dispute_evidence_response import DeleteDisputeEvidenceResponse from ...types.dispute_evidence import DisputeEvidence from ...types.get_dispute_evidence_response import GetDisputeEvidenceResponse +from ...types.list_dispute_evidence_response import ListDisputeEvidenceResponse from .raw_client import AsyncRawEvidenceClient, RawEvidenceClient @@ -32,7 +33,7 @@ def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DisputeEvidence]: + ) -> SyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: """ Returns a list of evidence associated with a dispute. @@ -51,7 +52,7 @@ def list( Returns ------- - SyncPager[DisputeEvidence] + SyncPager[DisputeEvidence, ListDisputeEvidenceResponse] Success Examples @@ -172,7 +173,7 @@ async def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DisputeEvidence]: + ) -> AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: """ Returns a list of evidence associated with a dispute. @@ -191,7 +192,7 @@ async def list( Returns ------- - AsyncPager[DisputeEvidence] + AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse] Success Examples diff --git a/src/square/disputes/evidence/raw_client.py b/src/square/disputes/evidence/raw_client.py index c6db9277..3f71bdeb 100644 --- a/src/square/disputes/evidence/raw_client.py +++ b/src/square/disputes/evidence/raw_client.py @@ -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.delete_dispute_evidence_response import DeleteDisputeEvidenceResponse @@ -26,7 +26,7 @@ def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[DisputeEvidence]: + ) -> SyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: """ Returns a list of evidence associated with a dispute. @@ -45,7 +45,7 @@ def list( Returns ------- - SyncPager[DisputeEvidence] + SyncPager[DisputeEvidence, ListDisputeEvidenceResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -73,9 +73,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) @@ -179,7 +177,7 @@ async def list( *, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[DisputeEvidence]: + ) -> AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse]: """ Returns a list of evidence associated with a dispute. @@ -198,7 +196,7 @@ async def list( Returns ------- - AsyncPager[DisputeEvidence] + AsyncPager[DisputeEvidence, ListDisputeEvidenceResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -229,9 +227,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) diff --git a/src/square/disputes/raw_client.py b/src/square/disputes/raw_client.py index b2d7a2f4..a0dc9983 100644 --- a/src/square/disputes/raw_client.py +++ b/src/square/disputes/raw_client.py @@ -9,7 +9,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 ..requests.create_dispute_evidence_file_request import CreateDisputeEvidenceFileRequestParams @@ -38,7 +38,7 @@ def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Dispute]: + ) -> SyncPager[Dispute, ListDisputesResponse]: """ Returns a list of disputes associated with a particular account. @@ -61,7 +61,7 @@ def list( Returns ------- - SyncPager[Dispute] + SyncPager[Dispute, ListDisputesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -92,9 +92,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) @@ -368,7 +366,7 @@ async def list( states: typing.Optional[DisputeState] = None, location_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Dispute]: + ) -> AsyncPager[Dispute, ListDisputesResponse]: """ Returns a list of disputes associated with a particular account. @@ -391,7 +389,7 @@ async def list( Returns ------- - AsyncPager[Dispute] + AsyncPager[Dispute, ListDisputesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -425,9 +423,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) diff --git a/src/square/employees/client.py b/src/square/employees/client.py index aa0cee9f..93376d9d 100644 --- a/src/square/employees/client.py +++ b/src/square/employees/client.py @@ -8,6 +8,7 @@ from ..types.employee import Employee from ..types.employee_status import EmployeeStatus from ..types.get_employee_response import GetEmployeeResponse +from ..types.list_employees_response import ListEmployeesResponse from .raw_client import AsyncRawEmployeesClient, RawEmployeesClient @@ -34,7 +35,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Employee]: + ) -> SyncPager[Employee, ListEmployeesResponse]: """ @@ -57,7 +58,7 @@ def list( Returns ------- - SyncPager[Employee] + SyncPager[Employee, ListEmployeesResponse] Success Examples @@ -138,7 +139,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Employee]: + ) -> AsyncPager[Employee, ListEmployeesResponse]: """ @@ -161,7 +162,7 @@ async def list( Returns ------- - AsyncPager[Employee] + AsyncPager[Employee, ListEmployeesResponse] Success Examples diff --git a/src/square/employees/raw_client.py b/src/square/employees/raw_client.py index 62fa76c0..fadff481 100644 --- a/src/square/employees/raw_client.py +++ b/src/square/employees/raw_client.py @@ -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.employee import Employee @@ -28,7 +28,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Employee]: + ) -> SyncPager[Employee, ListEmployeesResponse]: """ @@ -51,7 +51,7 @@ def list( Returns ------- - SyncPager[Employee] + SyncPager[Employee, ListEmployeesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -84,9 +84,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) @@ -144,7 +142,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Employee]: + ) -> AsyncPager[Employee, ListEmployeesResponse]: """ @@ -167,7 +165,7 @@ async def list( Returns ------- - AsyncPager[Employee] + AsyncPager[Employee, ListEmployeesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -203,9 +201,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) diff --git a/src/square/gift_cards/activities/client.py b/src/square/gift_cards/activities/client.py index 922ff563..561fdab0 100644 --- a/src/square/gift_cards/activities/client.py +++ b/src/square/gift_cards/activities/client.py @@ -8,6 +8,7 @@ from ...requests.gift_card_activity import GiftCardActivityParams from ...types.create_gift_card_activity_response import CreateGiftCardActivityResponse from ...types.gift_card_activity import GiftCardActivity +from ...types.list_gift_card_activities_response import ListGiftCardActivitiesResponse from .raw_client import AsyncRawActivitiesClient, RawActivitiesClient # this is used as the default value for optional parameters @@ -41,7 +42,7 @@ def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCardActivity]: + ) -> SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -92,7 +93,7 @@ def list( Returns ------- - SyncPager[GiftCardActivity] + SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] Success Examples @@ -211,7 +212,7 @@ async def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCardActivity]: + ) -> AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -262,7 +263,7 @@ async def list( Returns ------- - AsyncPager[GiftCardActivity] + AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] Success Examples diff --git a/src/square/gift_cards/activities/raw_client.py b/src/square/gift_cards/activities/raw_client.py index 1bdebbcd..8f6e798d 100644 --- a/src/square/gift_cards/activities/raw_client.py +++ b/src/square/gift_cards/activities/raw_client.py @@ -6,7 +6,7 @@ from ...core.api_error import ApiError from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper from ...core.http_response import AsyncHttpResponse, HttpResponse -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 @@ -35,7 +35,7 @@ def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCardActivity]: + ) -> SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -86,7 +86,7 @@ def list( Returns ------- - SyncPager[GiftCardActivity] + SyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -127,9 +127,7 @@ def list( sort_order=sort_order, 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) @@ -210,7 +208,7 @@ async def list( cursor: typing.Optional[str] = None, sort_order: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCardActivity]: + ) -> AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse]: """ Lists gift card activities. By default, you get gift card activities for all gift cards in the seller's account. You can optionally specify query parameters to @@ -261,7 +259,7 @@ async def list( Returns ------- - AsyncPager[GiftCardActivity] + AsyncPager[GiftCardActivity, ListGiftCardActivitiesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -305,9 +303,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) diff --git a/src/square/gift_cards/client.py b/src/square/gift_cards/client.py index 0129152c..37d6e91c 100644 --- a/src/square/gift_cards/client.py +++ b/src/square/gift_cards/client.py @@ -14,6 +14,7 @@ from ..types.get_gift_card_response import GetGiftCardResponse from ..types.gift_card import GiftCard from ..types.link_customer_to_gift_card_response import LinkCustomerToGiftCardResponse +from ..types.list_gift_cards_response import ListGiftCardsResponse from ..types.unlink_customer_from_gift_card_response import UnlinkCustomerFromGiftCardResponse from .raw_client import AsyncRawGiftCardsClient, RawGiftCardsClient @@ -49,7 +50,7 @@ def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCard]: + ) -> SyncPager[GiftCard, ListGiftCardsResponse]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -83,7 +84,7 @@ def list( Returns ------- - SyncPager[GiftCard] + SyncPager[GiftCard, ListGiftCardsResponse] Success Examples @@ -395,7 +396,7 @@ async def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCard]: + ) -> AsyncPager[GiftCard, ListGiftCardsResponse]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -429,7 +430,7 @@ async def list( Returns ------- - AsyncPager[GiftCard] + AsyncPager[GiftCard, ListGiftCardsResponse] Success Examples diff --git a/src/square/gift_cards/raw_client.py b/src/square/gift_cards/raw_client.py index 5baf1150..a34df1a7 100644 --- a/src/square/gift_cards/raw_client.py +++ b/src/square/gift_cards/raw_client.py @@ -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 @@ -38,7 +38,7 @@ def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[GiftCard]: + ) -> SyncPager[GiftCard, ListGiftCardsResponse]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -72,7 +72,7 @@ def list( Returns ------- - SyncPager[GiftCard] + SyncPager[GiftCard, ListGiftCardsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -107,9 +107,7 @@ def list( customer_id=customer_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) @@ -443,7 +441,7 @@ async def list( cursor: typing.Optional[str] = None, customer_id: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[GiftCard]: + ) -> AsyncPager[GiftCard, ListGiftCardsResponse]: """ Lists all gift cards. You can specify optional filters to retrieve a subset of the gift cards. Results are sorted by `created_at` in ascending order. @@ -477,7 +475,7 @@ async def list( Returns ------- - AsyncPager[GiftCard] + AsyncPager[GiftCard, ListGiftCardsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -515,9 +513,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) diff --git a/src/square/inventory/client.py b/src/square/inventory/client.py index ade24214..7ae7a02b 100644 --- a/src/square/inventory/client.py +++ b/src/square/inventory/client.py @@ -10,6 +10,8 @@ from ..types.batch_get_inventory_changes_response import BatchGetInventoryChangesResponse from ..types.batch_get_inventory_counts_response import BatchGetInventoryCountsResponse from ..types.get_inventory_adjustment_response import GetInventoryAdjustmentResponse +from ..types.get_inventory_changes_response import GetInventoryChangesResponse +from ..types.get_inventory_count_response import GetInventoryCountResponse from ..types.get_inventory_physical_count_response import GetInventoryPhysicalCountResponse from ..types.get_inventory_transfer_response import GetInventoryTransferResponse from ..types.inventory_change import InventoryChange @@ -434,7 +436,7 @@ def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange]: + ) -> SyncPager[InventoryChange, BatchGetInventoryChangesResponse]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -488,7 +490,7 @@ def batch_get_changes( Returns ------- - SyncPager[InventoryChange] + SyncPager[InventoryChange, BatchGetInventoryChangesResponse] Success Examples @@ -534,7 +536,7 @@ def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount]: + ) -> SyncPager[InventoryCount, BatchGetInventoryCountsResponse]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -582,7 +584,7 @@ def batch_get_counts( Returns ------- - SyncPager[InventoryCount] + SyncPager[InventoryCount, BatchGetInventoryCountsResponse] Success Examples @@ -724,7 +726,7 @@ def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount]: + ) -> SyncPager[InventoryCount, GetInventoryCountResponse]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -751,7 +753,7 @@ def get( Returns ------- - SyncPager[InventoryCount] + SyncPager[InventoryCount, GetInventoryCountResponse] Success Examples @@ -783,7 +785,7 @@ def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange]: + ) -> SyncPager[InventoryChange, GetInventoryChangesResponse]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -819,7 +821,7 @@ def changes( Returns ------- - SyncPager[InventoryChange] + SyncPager[InventoryChange, GetInventoryChangesResponse] Success Examples @@ -1305,7 +1307,7 @@ async def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange]: + ) -> AsyncPager[InventoryChange, BatchGetInventoryChangesResponse]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -1359,7 +1361,7 @@ async def batch_get_changes( Returns ------- - AsyncPager[InventoryChange] + AsyncPager[InventoryChange, BatchGetInventoryChangesResponse] Success Examples @@ -1414,7 +1416,7 @@ async def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount]: + ) -> AsyncPager[InventoryCount, BatchGetInventoryCountsResponse]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -1462,7 +1464,7 @@ async def batch_get_counts( Returns ------- - AsyncPager[InventoryCount] + AsyncPager[InventoryCount, BatchGetInventoryCountsResponse] Success Examples @@ -1639,7 +1641,7 @@ async def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount]: + ) -> AsyncPager[InventoryCount, GetInventoryCountResponse]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -1666,7 +1668,7 @@ async def get( Returns ------- - AsyncPager[InventoryCount] + AsyncPager[InventoryCount, GetInventoryCountResponse] Success Examples @@ -1707,7 +1709,7 @@ async def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange]: + ) -> AsyncPager[InventoryChange, GetInventoryChangesResponse]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -1743,7 +1745,7 @@ async def changes( Returns ------- - AsyncPager[InventoryChange] + AsyncPager[InventoryChange, GetInventoryChangesResponse] Success Examples diff --git a/src/square/inventory/raw_client.py b/src/square/inventory/raw_client.py index 3b66f1db..3068807d 100644 --- a/src/square/inventory/raw_client.py +++ b/src/square/inventory/raw_client.py @@ -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 @@ -453,7 +453,7 @@ def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange]: + ) -> SyncPager[InventoryChange, BatchGetInventoryChangesResponse]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -507,7 +507,7 @@ def batch_get_changes( Returns ------- - SyncPager[InventoryChange] + SyncPager[InventoryChange, BatchGetInventoryChangesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -552,9 +552,7 @@ def batch_get_changes( limit=limit, 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) @@ -570,7 +568,7 @@ def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount]: + ) -> SyncPager[InventoryCount, BatchGetInventoryCountsResponse]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -618,7 +616,7 @@ def batch_get_counts( Returns ------- - SyncPager[InventoryCount] + SyncPager[InventoryCount, BatchGetInventoryCountsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -659,9 +657,7 @@ def batch_get_counts( limit=limit, 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) @@ -796,7 +792,7 @@ def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryCount]: + ) -> SyncPager[InventoryCount, GetInventoryCountResponse]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -823,7 +819,7 @@ def get( Returns ------- - SyncPager[InventoryCount] + SyncPager[InventoryCount, GetInventoryCountResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -853,9 +849,7 @@ def get( 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) @@ -868,7 +862,7 @@ def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[InventoryChange]: + ) -> SyncPager[InventoryChange, GetInventoryChangesResponse]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -904,7 +898,7 @@ def changes( Returns ------- - SyncPager[InventoryChange] + SyncPager[InventoryChange, GetInventoryChangesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -934,9 +928,7 @@ def changes( 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) @@ -1367,7 +1359,7 @@ async def batch_get_changes( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange]: + ) -> AsyncPager[InventoryChange, BatchGetInventoryChangesResponse]: """ Returns historical physical counts and adjustments based on the provided filter criteria. @@ -1421,7 +1413,7 @@ async def batch_get_changes( Returns ------- - AsyncPager[InventoryChange] + AsyncPager[InventoryChange, BatchGetInventoryChangesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1469,9 +1461,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) @@ -1487,7 +1477,7 @@ async def batch_get_counts( states: typing.Optional[typing.Sequence[InventoryState]] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount]: + ) -> AsyncPager[InventoryCount, BatchGetInventoryCountsResponse]: """ Returns current counts for the provided [CatalogObject](entity:CatalogObject)s at the requested @@ -1535,7 +1525,7 @@ async def batch_get_counts( Returns ------- - AsyncPager[InventoryCount] + AsyncPager[InventoryCount, BatchGetInventoryCountsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1579,9 +1569,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) @@ -1716,7 +1704,7 @@ async def get( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryCount]: + ) -> AsyncPager[InventoryCount, GetInventoryCountResponse]: """ Retrieves the current calculated stock count for a given [CatalogObject](entity:CatalogObject) at a given set of @@ -1743,7 +1731,7 @@ async def get( Returns ------- - AsyncPager[InventoryCount] + AsyncPager[InventoryCount, GetInventoryCountResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1776,9 +1764,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) @@ -1791,7 +1777,7 @@ async def changes( location_ids: typing.Optional[str] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[InventoryChange]: + ) -> AsyncPager[InventoryChange, GetInventoryChangesResponse]: """ Returns a set of physical counts and inventory adjustments for the provided [CatalogObject](entity:CatalogObject) at the requested @@ -1827,7 +1813,7 @@ async def changes( Returns ------- - AsyncPager[InventoryChange] + AsyncPager[InventoryChange, GetInventoryChangesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1860,9 +1846,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) diff --git a/src/square/invoices/client.py b/src/square/invoices/client.py index b62fe981..4e1fe1ae 100644 --- a/src/square/invoices/client.py +++ b/src/square/invoices/client.py @@ -16,6 +16,7 @@ from ..types.delete_invoice_response import DeleteInvoiceResponse from ..types.get_invoice_response import GetInvoiceResponse from ..types.invoice import Invoice +from ..types.list_invoices_response import ListInvoicesResponse from ..types.publish_invoice_response import PublishInvoiceResponse from ..types.search_invoices_response import SearchInvoicesResponse from ..types.update_invoice_response import UpdateInvoiceResponse @@ -47,7 +48,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Invoice]: + ) -> SyncPager[Invoice, ListInvoicesResponse]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -73,7 +74,7 @@ def list( Returns ------- - SyncPager[Invoice] + SyncPager[Invoice, ListInvoicesResponse] Success Examples @@ -629,7 +630,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Invoice]: + ) -> AsyncPager[Invoice, ListInvoicesResponse]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -655,7 +656,7 @@ async def list( Returns ------- - AsyncPager[Invoice] + AsyncPager[Invoice, ListInvoicesResponse] Success Examples diff --git a/src/square/invoices/raw_client.py b/src/square/invoices/raw_client.py index c8d95bf8..a5813087 100644 --- a/src/square/invoices/raw_client.py +++ b/src/square/invoices/raw_client.py @@ -9,7 +9,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 @@ -43,7 +43,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Invoice]: + ) -> SyncPager[Invoice, ListInvoicesResponse]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -69,7 +69,7 @@ def list( Returns ------- - SyncPager[Invoice] + SyncPager[Invoice, ListInvoicesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -100,9 +100,7 @@ def list( limit=limit, 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) @@ -668,7 +666,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Invoice]: + ) -> AsyncPager[Invoice, ListInvoicesResponse]: """ Returns a list of invoices for a given location. The response is paginated. If truncated, the response includes a `cursor` that you @@ -694,7 +692,7 @@ async def list( Returns ------- - AsyncPager[Invoice] + AsyncPager[Invoice, ListInvoicesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -728,9 +726,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) diff --git a/src/square/labor/break_types/client.py b/src/square/labor/break_types/client.py index d803f191..f18a9209 100644 --- a/src/square/labor/break_types/client.py +++ b/src/square/labor/break_types/client.py @@ -10,6 +10,7 @@ from ...types.create_break_type_response import CreateBreakTypeResponse from ...types.delete_break_type_response import DeleteBreakTypeResponse from ...types.get_break_type_response import GetBreakTypeResponse +from ...types.list_break_types_response import ListBreakTypesResponse from ...types.update_break_type_response import UpdateBreakTypeResponse from .raw_client import AsyncRawBreakTypesClient, RawBreakTypesClient @@ -39,7 +40,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BreakType]: + ) -> SyncPager[BreakType, ListBreakTypesResponse]: """ Returns a paginated list of `BreakType` instances for a business. @@ -61,7 +62,7 @@ def list( Returns ------- - SyncPager[BreakType] + SyncPager[BreakType, ListBreakTypesResponse] Success Examples @@ -277,7 +278,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BreakType]: + ) -> AsyncPager[BreakType, ListBreakTypesResponse]: """ Returns a paginated list of `BreakType` instances for a business. @@ -299,7 +300,7 @@ async def list( Returns ------- - AsyncPager[BreakType] + AsyncPager[BreakType, ListBreakTypesResponse] Success Examples diff --git a/src/square/labor/break_types/raw_client.py b/src/square/labor/break_types/raw_client.py index 3e8aa51d..e5c7ddd1 100644 --- a/src/square/labor/break_types/raw_client.py +++ b/src/square/labor/break_types/raw_client.py @@ -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 @@ -34,7 +34,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[BreakType]: + ) -> SyncPager[BreakType, ListBreakTypesResponse]: """ Returns a paginated list of `BreakType` instances for a business. @@ -56,7 +56,7 @@ def list( Returns ------- - SyncPager[BreakType] + SyncPager[BreakType, ListBreakTypesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -87,9 +87,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) @@ -307,7 +305,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[BreakType]: + ) -> AsyncPager[BreakType, ListBreakTypesResponse]: """ Returns a paginated list of `BreakType` instances for a business. @@ -329,7 +327,7 @@ async def list( Returns ------- - AsyncPager[BreakType] + AsyncPager[BreakType, ListBreakTypesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -363,9 +361,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) diff --git a/src/square/labor/employee_wages/client.py b/src/square/labor/employee_wages/client.py index 38ed7146..e2b854f5 100644 --- a/src/square/labor/employee_wages/client.py +++ b/src/square/labor/employee_wages/client.py @@ -7,6 +7,7 @@ from ...core.request_options import RequestOptions from ...types.employee_wage import EmployeeWage from ...types.get_employee_wage_response import GetEmployeeWageResponse +from ...types.list_employee_wages_response import ListEmployeeWagesResponse from .raw_client import AsyncRawEmployeeWagesClient, RawEmployeeWagesClient @@ -32,7 +33,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[EmployeeWage]: + ) -> SyncPager[EmployeeWage, ListEmployeeWagesResponse]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -53,7 +54,7 @@ def list( Returns ------- - SyncPager[EmployeeWage] + SyncPager[EmployeeWage, ListEmployeeWagesResponse] Success Examples @@ -132,7 +133,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[EmployeeWage]: + ) -> AsyncPager[EmployeeWage, ListEmployeeWagesResponse]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -153,7 +154,7 @@ async def list( Returns ------- - AsyncPager[EmployeeWage] + AsyncPager[EmployeeWage, ListEmployeeWagesResponse] Success Examples diff --git a/src/square/labor/employee_wages/raw_client.py b/src/square/labor/employee_wages/raw_client.py index 3292919f..bb4985b0 100644 --- a/src/square/labor/employee_wages/raw_client.py +++ b/src/square/labor/employee_wages/raw_client.py @@ -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.employee_wage import EmployeeWage @@ -26,7 +26,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[EmployeeWage]: + ) -> SyncPager[EmployeeWage, ListEmployeeWagesResponse]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -47,7 +47,7 @@ def list( Returns ------- - SyncPager[EmployeeWage] + SyncPager[EmployeeWage, ListEmployeeWagesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -78,9 +78,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) @@ -137,7 +135,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[EmployeeWage]: + ) -> AsyncPager[EmployeeWage, ListEmployeeWagesResponse]: """ Returns a paginated list of `EmployeeWage` instances for a business. @@ -158,7 +156,7 @@ async def list( Returns ------- - AsyncPager[EmployeeWage] + AsyncPager[EmployeeWage, ListEmployeeWagesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -192,9 +190,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) diff --git a/src/square/labor/team_member_wages/client.py b/src/square/labor/team_member_wages/client.py index d1efb74e..d0b61c42 100644 --- a/src/square/labor/team_member_wages/client.py +++ b/src/square/labor/team_member_wages/client.py @@ -6,6 +6,7 @@ from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions from ...types.get_team_member_wage_response import GetTeamMemberWageResponse +from ...types.list_team_member_wages_response import ListTeamMemberWagesResponse from ...types.team_member_wage import TeamMemberWage from .raw_client import AsyncRawTeamMemberWagesClient, RawTeamMemberWagesClient @@ -32,7 +33,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberWage]: + ) -> SyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -54,7 +55,7 @@ def list( Returns ------- - SyncPager[TeamMemberWage] + SyncPager[TeamMemberWage, ListTeamMemberWagesResponse] Success Examples @@ -133,7 +134,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberWage]: + ) -> AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -155,7 +156,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberWage] + AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse] Success Examples diff --git a/src/square/labor/team_member_wages/raw_client.py b/src/square/labor/team_member_wages/raw_client.py index f4143b31..d28f5217 100644 --- a/src/square/labor/team_member_wages/raw_client.py +++ b/src/square/labor/team_member_wages/raw_client.py @@ -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.get_team_member_wage_response import GetTeamMemberWageResponse @@ -26,7 +26,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TeamMemberWage]: + ) -> SyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -48,7 +48,7 @@ def list( Returns ------- - SyncPager[TeamMemberWage] + SyncPager[TeamMemberWage, ListTeamMemberWagesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -79,9 +79,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) @@ -138,7 +136,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TeamMemberWage]: + ) -> AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse]: """ Returns a paginated list of `TeamMemberWage` instances for a business. @@ -160,7 +158,7 @@ async def list( Returns ------- - AsyncPager[TeamMemberWage] + AsyncPager[TeamMemberWage, ListTeamMemberWagesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -194,9 +192,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) diff --git a/src/square/labor/workweek_configs/client.py b/src/square/labor/workweek_configs/client.py index 3d6825ca..7e539bb5 100644 --- a/src/square/labor/workweek_configs/client.py +++ b/src/square/labor/workweek_configs/client.py @@ -6,6 +6,7 @@ from ...core.pagination import AsyncPager, SyncPager from ...core.request_options import RequestOptions from ...requests.workweek_config import WorkweekConfigParams +from ...types.list_workweek_configs_response import ListWorkweekConfigsResponse from ...types.update_workweek_config_response import UpdateWorkweekConfigResponse from ...types.workweek_config import WorkweekConfig from .raw_client import AsyncRawWorkweekConfigsClient, RawWorkweekConfigsClient @@ -35,7 +36,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WorkweekConfig]: + ) -> SyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -52,7 +53,7 @@ def list( Returns ------- - SyncPager[WorkweekConfig] + SyncPager[WorkweekConfig, ListWorkweekConfigsResponse] Success Examples @@ -137,7 +138,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WorkweekConfig]: + ) -> AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -154,7 +155,7 @@ async def list( Returns ------- - AsyncPager[WorkweekConfig] + AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse] Success Examples diff --git a/src/square/labor/workweek_configs/raw_client.py b/src/square/labor/workweek_configs/raw_client.py index 5c3fa0c2..6e767b14 100644 --- a/src/square/labor/workweek_configs/raw_client.py +++ b/src/square/labor/workweek_configs/raw_client.py @@ -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 @@ -30,7 +30,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WorkweekConfig]: + ) -> SyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -47,7 +47,7 @@ def list( Returns ------- - SyncPager[WorkweekConfig] + SyncPager[WorkweekConfig, ListWorkweekConfigsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -76,9 +76,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) @@ -146,7 +144,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WorkweekConfig]: + ) -> AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse]: """ Returns a list of `WorkweekConfig` instances for a business. @@ -163,7 +161,7 @@ async def list( Returns ------- - AsyncPager[WorkweekConfig] + AsyncPager[WorkweekConfig, ListWorkweekConfigsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -195,9 +193,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) diff --git a/src/square/locations/custom_attribute_definitions/client.py b/src/square/locations/custom_attribute_definitions/client.py index b0cd91ec..7233ff94 100644 --- a/src/square/locations/custom_attribute_definitions/client.py +++ b/src/square/locations/custom_attribute_definitions/client.py @@ -13,6 +13,7 @@ from ...types.delete_location_custom_attribute_definition_response import ( DeleteLocationCustomAttributeDefinitionResponse, ) +from ...types.list_location_custom_attribute_definitions_response import ListLocationCustomAttributeDefinitionsResponse from ...types.retrieve_location_custom_attribute_definition_response import ( RetrieveLocationCustomAttributeDefinitionResponse, ) @@ -48,7 +49,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -75,7 +76,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] Success Examples @@ -335,7 +336,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -362,7 +363,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] Success Examples diff --git a/src/square/locations/custom_attribute_definitions/raw_client.py b/src/square/locations/custom_attribute_definitions/raw_client.py index 3c013fb1..7af097a2 100644 --- a/src/square/locations/custom_attribute_definitions/raw_client.py +++ b/src/square/locations/custom_attribute_definitions/raw_client.py @@ -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 @@ -43,7 +43,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -70,7 +70,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -101,9 +101,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) @@ -358,7 +356,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse]: """ Lists the location-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -385,7 +383,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListLocationCustomAttributeDefinitionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -419,9 +417,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) diff --git a/src/square/locations/custom_attributes/client.py b/src/square/locations/custom_attributes/client.py index 0628e070..1ec6dfcb 100644 --- a/src/square/locations/custom_attributes/client.py +++ b/src/square/locations/custom_attributes/client.py @@ -16,6 +16,7 @@ from ...types.bulk_upsert_location_custom_attributes_response import BulkUpsertLocationCustomAttributesResponse from ...types.custom_attribute import CustomAttribute from ...types.delete_location_custom_attribute_response import DeleteLocationCustomAttributeResponse +from ...types.list_location_custom_attributes_response import ListLocationCustomAttributesResponse from ...types.retrieve_location_custom_attribute_response import RetrieveLocationCustomAttributeResponse from ...types.upsert_location_custom_attribute_response import UpsertLocationCustomAttributeResponse from ...types.visibility_filter import VisibilityFilter @@ -158,7 +159,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -195,7 +196,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListLocationCustomAttributesResponse] Success Examples @@ -551,7 +552,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -588,7 +589,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse] Success Examples diff --git a/src/square/locations/custom_attributes/raw_client.py b/src/square/locations/custom_attributes/raw_client.py index 60d188b8..4476e8db 100644 --- a/src/square/locations/custom_attributes/raw_client.py +++ b/src/square/locations/custom_attributes/raw_client.py @@ -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 @@ -168,7 +168,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -205,7 +205,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListLocationCustomAttributesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -239,9 +239,7 @@ def list( with_definitions=with_definitions, 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) @@ -577,7 +575,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a location. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -614,7 +612,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListLocationCustomAttributesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -651,9 +649,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) diff --git a/src/square/loyalty/programs/promotions/client.py b/src/square/loyalty/programs/promotions/client.py index 325137ed..3030ab2a 100644 --- a/src/square/loyalty/programs/promotions/client.py +++ b/src/square/loyalty/programs/promotions/client.py @@ -9,6 +9,7 @@ from ....types.cancel_loyalty_promotion_response import CancelLoyaltyPromotionResponse from ....types.create_loyalty_promotion_response import CreateLoyaltyPromotionResponse from ....types.get_loyalty_promotion_response import GetLoyaltyPromotionResponse +from ....types.list_loyalty_promotions_response import ListLoyaltyPromotionsResponse from ....types.loyalty_promotion import LoyaltyPromotion from ....types.loyalty_promotion_status import LoyaltyPromotionStatus from .raw_client import AsyncRawPromotionsClient, RawPromotionsClient @@ -40,7 +41,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LoyaltyPromotion]: + ) -> SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -71,7 +72,7 @@ def list( Returns ------- - SyncPager[LoyaltyPromotion] + SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] Success Examples @@ -275,7 +276,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LoyaltyPromotion]: + ) -> AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -306,7 +307,7 @@ async def list( Returns ------- - AsyncPager[LoyaltyPromotion] + AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] Success Examples diff --git a/src/square/loyalty/programs/promotions/raw_client.py b/src/square/loyalty/programs/promotions/raw_client.py index 9a0de4f9..3e60a737 100644 --- a/src/square/loyalty/programs/promotions/raw_client.py +++ b/src/square/loyalty/programs/promotions/raw_client.py @@ -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 @@ -35,7 +35,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[LoyaltyPromotion]: + ) -> SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -66,7 +66,7 @@ def list( Returns ------- - SyncPager[LoyaltyPromotion] + SyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -98,9 +98,7 @@ def list( limit=limit, 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) @@ -278,7 +276,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[LoyaltyPromotion]: + ) -> AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse]: """ Lists the loyalty promotions associated with a [loyalty program](entity:LoyaltyProgram). Results are sorted by the `created_at` date in descending order (newest to oldest). @@ -309,7 +307,7 @@ async def list( Returns ------- - AsyncPager[LoyaltyPromotion] + AsyncPager[LoyaltyPromotion, ListLoyaltyPromotionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -344,9 +342,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) diff --git a/src/square/merchants/client.py b/src/square/merchants/client.py index 1ac7b162..3288f1a1 100644 --- a/src/square/merchants/client.py +++ b/src/square/merchants/client.py @@ -8,6 +8,7 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions from ..types.get_merchant_response import GetMerchantResponse +from ..types.list_merchants_response import ListMerchantsResponse from ..types.merchant import Merchant from .raw_client import AsyncRawMerchantsClient, RawMerchantsClient @@ -39,7 +40,7 @@ def with_raw_response(self) -> RawMerchantsClient: def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> SyncPager[Merchant]: + ) -> SyncPager[Merchant, ListMerchantsResponse]: """ Provides details about the merchant associated with a given access token. @@ -62,7 +63,7 @@ def list( Returns ------- - SyncPager[Merchant] + SyncPager[Merchant, ListMerchantsResponse] Success Examples @@ -152,7 +153,7 @@ def with_raw_response(self) -> AsyncRawMerchantsClient: async def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncPager[Merchant]: + ) -> AsyncPager[Merchant, ListMerchantsResponse]: """ Provides details about the merchant associated with a given access token. @@ -175,7 +176,7 @@ async def list( Returns ------- - AsyncPager[Merchant] + AsyncPager[Merchant, ListMerchantsResponse] Success Examples diff --git a/src/square/merchants/custom_attribute_definitions/client.py b/src/square/merchants/custom_attribute_definitions/client.py index 72680902..d515b707 100644 --- a/src/square/merchants/custom_attribute_definitions/client.py +++ b/src/square/merchants/custom_attribute_definitions/client.py @@ -13,6 +13,7 @@ from ...types.delete_merchant_custom_attribute_definition_response import ( DeleteMerchantCustomAttributeDefinitionResponse, ) +from ...types.list_merchant_custom_attribute_definitions_response import ListMerchantCustomAttributeDefinitionsResponse from ...types.retrieve_merchant_custom_attribute_definition_response import ( RetrieveMerchantCustomAttributeDefinitionResponse, ) @@ -48,7 +49,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -75,7 +76,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] Success Examples @@ -334,7 +335,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -361,7 +362,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] Success Examples diff --git a/src/square/merchants/custom_attribute_definitions/raw_client.py b/src/square/merchants/custom_attribute_definitions/raw_client.py index fe2e7e6e..776a97fd 100644 --- a/src/square/merchants/custom_attribute_definitions/raw_client.py +++ b/src/square/merchants/custom_attribute_definitions/raw_client.py @@ -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 @@ -43,7 +43,7 @@ def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -70,7 +70,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -101,9 +101,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) @@ -357,7 +355,7 @@ async def list( limit: typing.Optional[int] = None, cursor: typing.Optional[str] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse]: """ Lists the merchant-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. When all response pages are retrieved, the results include all custom attribute definitions @@ -384,7 +382,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListMerchantCustomAttributeDefinitionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -418,9 +416,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) diff --git a/src/square/merchants/custom_attributes/client.py b/src/square/merchants/custom_attributes/client.py index 046e1fcc..85788bd1 100644 --- a/src/square/merchants/custom_attributes/client.py +++ b/src/square/merchants/custom_attributes/client.py @@ -16,6 +16,7 @@ from ...types.bulk_upsert_merchant_custom_attributes_response import BulkUpsertMerchantCustomAttributesResponse from ...types.custom_attribute import CustomAttribute from ...types.delete_merchant_custom_attribute_response import DeleteMerchantCustomAttributeResponse +from ...types.list_merchant_custom_attributes_response import ListMerchantCustomAttributesResponse from ...types.retrieve_merchant_custom_attribute_response import RetrieveMerchantCustomAttributeResponse from ...types.upsert_merchant_custom_attribute_response import UpsertMerchantCustomAttributeResponse from ...types.visibility_filter import VisibilityFilter @@ -150,7 +151,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -187,7 +188,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] Success Examples @@ -535,7 +536,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -572,7 +573,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] Success Examples diff --git a/src/square/merchants/custom_attributes/raw_client.py b/src/square/merchants/custom_attributes/raw_client.py index 3f01f0d0..35e4b219 100644 --- a/src/square/merchants/custom_attributes/raw_client.py +++ b/src/square/merchants/custom_attributes/raw_client.py @@ -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 @@ -168,7 +168,7 @@ def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -205,7 +205,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -239,9 +239,7 @@ def list( with_definitions=with_definitions, 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) @@ -577,7 +575,7 @@ async def list( cursor: typing.Optional[str] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with a merchant. You can use the `with_definitions` query parameter to also retrieve custom attribute definitions @@ -614,7 +612,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListMerchantCustomAttributesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -651,9 +649,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) diff --git a/src/square/merchants/raw_client.py b/src/square/merchants/raw_client.py index 601fb0a0..f196f44b 100644 --- a/src/square/merchants/raw_client.py +++ b/src/square/merchants/raw_client.py @@ -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.get_merchant_response import GetMerchantResponse @@ -21,7 +21,7 @@ def __init__(self, *, client_wrapper: SyncClientWrapper): def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> SyncPager[Merchant]: + ) -> SyncPager[Merchant, ListMerchantsResponse]: """ Provides details about the merchant associated with a given access token. @@ -44,7 +44,7 @@ def list( Returns ------- - SyncPager[Merchant] + SyncPager[Merchant, ListMerchantsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -71,9 +71,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) @@ -126,7 +124,7 @@ def __init__(self, *, client_wrapper: AsyncClientWrapper): async def list( self, *, cursor: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None - ) -> AsyncPager[Merchant]: + ) -> AsyncPager[Merchant, ListMerchantsResponse]: """ Provides details about the merchant associated with a given access token. @@ -149,7 +147,7 @@ async def list( Returns ------- - AsyncPager[Merchant] + AsyncPager[Merchant, ListMerchantsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -179,9 +177,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) diff --git a/src/square/orders/custom_attribute_definitions/client.py b/src/square/orders/custom_attribute_definitions/client.py index 07d6b80d..2803b2a4 100644 --- a/src/square/orders/custom_attribute_definitions/client.py +++ b/src/square/orders/custom_attribute_definitions/client.py @@ -9,6 +9,7 @@ from ...types.create_order_custom_attribute_definition_response import CreateOrderCustomAttributeDefinitionResponse from ...types.custom_attribute_definition import CustomAttributeDefinition from ...types.delete_order_custom_attribute_definition_response import DeleteOrderCustomAttributeDefinitionResponse +from ...types.list_order_custom_attribute_definitions_response import ListOrderCustomAttributeDefinitionsResponse from ...types.retrieve_order_custom_attribute_definition_response import RetrieveOrderCustomAttributeDefinitionResponse from ...types.update_order_custom_attribute_definition_response import UpdateOrderCustomAttributeDefinitionResponse from ...types.visibility_filter import VisibilityFilter @@ -40,7 +41,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -70,7 +71,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] Success Examples @@ -320,7 +321,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -350,7 +351,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] Success Examples diff --git a/src/square/orders/custom_attribute_definitions/raw_client.py b/src/square/orders/custom_attribute_definitions/raw_client.py index 4a9b8183..b5f799ad 100644 --- a/src/square/orders/custom_attribute_definitions/raw_client.py +++ b/src/square/orders/custom_attribute_definitions/raw_client.py @@ -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 @@ -35,7 +35,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttributeDefinition]: + ) -> SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -65,7 +65,7 @@ def list( Returns ------- - SyncPager[CustomAttributeDefinition] + SyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -96,9 +96,7 @@ def list( limit=limit, 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) @@ -340,7 +338,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttributeDefinition]: + ) -> AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse]: """ Lists the order-related [custom attribute definitions](entity:CustomAttributeDefinition) that belong to a Square seller account. @@ -370,7 +368,7 @@ async def list( Returns ------- - AsyncPager[CustomAttributeDefinition] + AsyncPager[CustomAttributeDefinition, ListOrderCustomAttributeDefinitionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -404,9 +402,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) diff --git a/src/square/orders/custom_attributes/client.py b/src/square/orders/custom_attributes/client.py index 558e9b0e..403a2d91 100644 --- a/src/square/orders/custom_attributes/client.py +++ b/src/square/orders/custom_attributes/client.py @@ -16,6 +16,7 @@ from ...types.bulk_upsert_order_custom_attributes_response import BulkUpsertOrderCustomAttributesResponse from ...types.custom_attribute import CustomAttribute from ...types.delete_order_custom_attribute_response import DeleteOrderCustomAttributeResponse +from ...types.list_order_custom_attributes_response import ListOrderCustomAttributesResponse from ...types.retrieve_order_custom_attribute_response import RetrieveOrderCustomAttributeResponse from ...types.upsert_order_custom_attribute_response import UpsertOrderCustomAttributeResponse from ...types.visibility_filter import VisibilityFilter @@ -173,7 +174,7 @@ def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -213,7 +214,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListOrderCustomAttributesResponse] Success Examples @@ -592,7 +593,7 @@ async def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -632,7 +633,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse] Success Examples diff --git a/src/square/orders/custom_attributes/raw_client.py b/src/square/orders/custom_attributes/raw_client.py index 7d0f78b8..213dc970 100644 --- a/src/square/orders/custom_attributes/raw_client.py +++ b/src/square/orders/custom_attributes/raw_client.py @@ -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 @@ -176,7 +176,7 @@ def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[CustomAttribute]: + ) -> SyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -216,7 +216,7 @@ def list( Returns ------- - SyncPager[CustomAttribute] + SyncPager[CustomAttribute, ListOrderCustomAttributesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -250,9 +250,7 @@ def list( with_definitions=with_definitions, 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) @@ -600,7 +598,7 @@ async def list( limit: typing.Optional[int] = None, with_definitions: typing.Optional[bool] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[CustomAttribute]: + ) -> AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse]: """ Lists the [custom attributes](entity:CustomAttribute) associated with an order. @@ -640,7 +638,7 @@ async def list( Returns ------- - AsyncPager[CustomAttribute] + AsyncPager[CustomAttribute, ListOrderCustomAttributesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -677,9 +675,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) diff --git a/src/square/payments/client.py b/src/square/payments/client.py index 1c5bbe6b..5110abfe 100644 --- a/src/square/payments/client.py +++ b/src/square/payments/client.py @@ -18,6 +18,7 @@ from ..types.create_payment_response import CreatePaymentResponse from ..types.get_payment_response import GetPaymentResponse from ..types.list_payments_request_sort_field import ListPaymentsRequestSortField +from ..types.list_payments_response import ListPaymentsResponse from ..types.payment import Payment from ..types.update_payment_response import UpdatePaymentResponse from .raw_client import AsyncRawPaymentsClient, RawPaymentsClient @@ -60,7 +61,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payment]: + ) -> SyncPager[Payment, ListPaymentsResponse]: """ Retrieves a list of payments taken by the account making the request. @@ -150,7 +151,7 @@ def list( Returns ------- - SyncPager[Payment] + SyncPager[Payment, ListPaymentsResponse] Success Examples @@ -719,7 +720,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payment]: + ) -> AsyncPager[Payment, ListPaymentsResponse]: """ Retrieves a list of payments taken by the account making the request. @@ -809,7 +810,7 @@ async def list( Returns ------- - AsyncPager[Payment] + AsyncPager[Payment, ListPaymentsResponse] Success Examples diff --git a/src/square/payments/raw_client.py b/src/square/payments/raw_client.py index d1c700c5..e20751dd 100644 --- a/src/square/payments/raw_client.py +++ b/src/square/payments/raw_client.py @@ -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 @@ -55,7 +55,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payment]: + ) -> SyncPager[Payment, ListPaymentsResponse]: """ Retrieves a list of payments taken by the account making the request. @@ -145,7 +145,7 @@ def list( Returns ------- - SyncPager[Payment] + SyncPager[Payment, ListPaymentsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -200,9 +200,7 @@ def list( sort_field=sort_field, 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) @@ -780,7 +778,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payment]: + ) -> AsyncPager[Payment, ListPaymentsResponse]: """ Retrieves a list of payments taken by the account making the request. @@ -870,7 +868,7 @@ async def list( Returns ------- - AsyncPager[Payment] + AsyncPager[Payment, ListPaymentsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -928,9 +926,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) diff --git a/src/square/payouts/client.py b/src/square/payouts/client.py index 8156389a..1c34a918 100644 --- a/src/square/payouts/client.py +++ b/src/square/payouts/client.py @@ -6,6 +6,8 @@ from ..core.pagination import AsyncPager, SyncPager from ..core.request_options import RequestOptions from ..types.get_payout_response import GetPayoutResponse +from ..types.list_payout_entries_response import ListPayoutEntriesResponse +from ..types.list_payouts_response import ListPayoutsResponse from ..types.payout import Payout from ..types.payout_entry import PayoutEntry from ..types.payout_status import PayoutStatus @@ -39,7 +41,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payout]: + ) -> SyncPager[Payout, ListPayoutsResponse]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -83,7 +85,7 @@ def list( Returns ------- - SyncPager[Payout] + SyncPager[Payout, ListPayoutsResponse] Success Examples @@ -159,7 +161,7 @@ def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PayoutEntry]: + ) -> SyncPager[PayoutEntry, ListPayoutEntriesResponse]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -190,7 +192,7 @@ def list_entries( Returns ------- - SyncPager[PayoutEntry] + SyncPager[PayoutEntry, ListPayoutEntriesResponse] Success Examples @@ -243,7 +245,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payout]: + ) -> AsyncPager[Payout, ListPayoutsResponse]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -287,7 +289,7 @@ async def list( Returns ------- - AsyncPager[Payout] + AsyncPager[Payout, ListPayoutsResponse] Success Examples @@ -382,7 +384,7 @@ async def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PayoutEntry]: + ) -> AsyncPager[PayoutEntry, ListPayoutEntriesResponse]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -413,7 +415,7 @@ async def list_entries( Returns ------- - AsyncPager[PayoutEntry] + AsyncPager[PayoutEntry, ListPayoutEntriesResponse] Success Examples diff --git a/src/square/payouts/raw_client.py b/src/square/payouts/raw_client.py index b5d161a5..87bfcff9 100644 --- a/src/square/payouts/raw_client.py +++ b/src/square/payouts/raw_client.py @@ -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.get_payout_response import GetPayoutResponse @@ -34,7 +34,7 @@ def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[Payout]: + ) -> SyncPager[Payout, ListPayoutsResponse]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -78,7 +78,7 @@ def list( Returns ------- - SyncPager[Payout] + SyncPager[Payout, ListPayoutsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -117,9 +117,7 @@ def list( limit=limit, 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) @@ -173,7 +171,7 @@ def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PayoutEntry]: + ) -> SyncPager[PayoutEntry, ListPayoutEntriesResponse]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -204,7 +202,7 @@ def list_entries( Returns ------- - SyncPager[PayoutEntry] + SyncPager[PayoutEntry, ListPayoutEntriesResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -236,9 +234,7 @@ def list_entries( limit=limit, 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) @@ -260,7 +256,7 @@ async def list( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[Payout]: + ) -> AsyncPager[Payout, ListPayoutsResponse]: """ Retrieves a list of all payouts for the default location. You can filter payouts by location ID, status, time range, and order them in ascending or descending order. @@ -304,7 +300,7 @@ async def list( Returns ------- - AsyncPager[Payout] + AsyncPager[Payout, ListPayoutsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -346,9 +342,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) @@ -402,7 +396,7 @@ async def list_entries( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PayoutEntry]: + ) -> AsyncPager[PayoutEntry, ListPayoutEntriesResponse]: """ Retrieves a list of all payout entries for a specific payout. To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. @@ -433,7 +427,7 @@ async def list_entries( Returns ------- - AsyncPager[PayoutEntry] + AsyncPager[PayoutEntry, ListPayoutEntriesResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -468,9 +462,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) diff --git a/src/square/refunds/client.py b/src/square/refunds/client.py index a53d44e3..f3aa76d2 100644 --- a/src/square/refunds/client.py +++ b/src/square/refunds/client.py @@ -10,6 +10,7 @@ from ..requests.money import MoneyParams from ..types.get_payment_refund_response import GetPaymentRefundResponse from ..types.list_payment_refunds_request_sort_field import ListPaymentRefundsRequestSortField +from ..types.list_payment_refunds_response import ListPaymentRefundsResponse from ..types.payment_refund import PaymentRefund from ..types.refund_payment_response import RefundPaymentResponse from .raw_client import AsyncRawRefundsClient, RawRefundsClient @@ -48,7 +49,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentRefund]: + ) -> SyncPager[PaymentRefund, ListPaymentRefundsResponse]: """ Retrieves a list of refunds for the account making the request. @@ -129,7 +130,7 @@ def list( Returns ------- - SyncPager[PaymentRefund] + SyncPager[PaymentRefund, ListPaymentRefundsResponse] Success Examples @@ -387,7 +388,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentRefund]: + ) -> AsyncPager[PaymentRefund, ListPaymentRefundsResponse]: """ Retrieves a list of refunds for the account making the request. @@ -468,7 +469,7 @@ async def list( Returns ------- - AsyncPager[PaymentRefund] + AsyncPager[PaymentRefund, ListPaymentRefundsResponse] Success Examples diff --git a/src/square/refunds/raw_client.py b/src/square/refunds/raw_client.py index 7e6c90a6..9c19e203 100644 --- a/src/square/refunds/raw_client.py +++ b/src/square/refunds/raw_client.py @@ -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 @@ -43,7 +43,7 @@ def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[PaymentRefund]: + ) -> SyncPager[PaymentRefund, ListPaymentRefundsResponse]: """ Retrieves a list of refunds for the account making the request. @@ -124,7 +124,7 @@ def list( Returns ------- - SyncPager[PaymentRefund] + SyncPager[PaymentRefund, ListPaymentRefundsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -171,9 +171,7 @@ def list( sort_field=sort_field, 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) @@ -404,7 +402,7 @@ async def list( updated_at_end_time: typing.Optional[str] = None, sort_field: typing.Optional[ListPaymentRefundsRequestSortField] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[PaymentRefund]: + ) -> AsyncPager[PaymentRefund, ListPaymentRefundsResponse]: """ Retrieves a list of refunds for the account making the request. @@ -485,7 +483,7 @@ async def list( Returns ------- - AsyncPager[PaymentRefund] + AsyncPager[PaymentRefund, ListPaymentRefundsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -535,9 +533,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) diff --git a/src/square/requests/catalog_item_modifier_list_info.py b/src/square/requests/catalog_item_modifier_list_info.py index e355e691..ad9652f9 100644 --- a/src/square/requests/catalog_item_modifier_list_info.py +++ b/src/square/requests/catalog_item_modifier_list_info.py @@ -57,6 +57,6 @@ class CatalogItemModifierListInfoParams(typing_extensions.TypedDict): to a `CatalogItem` instance. """ - allow_quantities: typing_extensions.NotRequired[typing.Optional[typing.Any]] - is_conversational: typing_extensions.NotRequired[typing.Optional[typing.Any]] - hidden_from_customer_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] + allow_quantities: typing_extensions.NotRequired[typing.Any] + is_conversational: typing_extensions.NotRequired[typing.Any] + hidden_from_customer_override: typing_extensions.NotRequired[typing.Any] diff --git a/src/square/requests/catalog_modifier_override.py b/src/square/requests/catalog_modifier_override.py index 7ab8cd0b..dd042fb2 100644 --- a/src/square/requests/catalog_modifier_override.py +++ b/src/square/requests/catalog_modifier_override.py @@ -20,5 +20,5 @@ class CatalogModifierOverrideParams(typing_extensions.TypedDict): __Deprecated__: Use `on_by_default_override` instead. """ - hidden_online_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] - on_by_default_override: typing_extensions.NotRequired[typing.Optional[typing.Any]] + hidden_online_override: typing_extensions.NotRequired[typing.Any] + on_by_default_override: typing_extensions.NotRequired[typing.Any] diff --git a/src/square/requests/custom_attribute.py b/src/square/requests/custom_attribute.py index 97927835..60346299 100644 --- a/src/square/requests/custom_attribute.py +++ b/src/square/requests/custom_attribute.py @@ -28,7 +28,7 @@ class CustomAttributeParams(typing_extensions.TypedDict): underscores (_), and hyphens (-). """ - value: typing_extensions.NotRequired[typing.Optional[typing.Optional[typing.Any]]] + value: typing_extensions.NotRequired[typing.Optional[typing.Any]] """ The value assigned to the custom attribute. It is validated against the custom attribute definition's schema on write operations. For more information about custom diff --git a/src/square/requests/custom_attribute_definition.py b/src/square/requests/custom_attribute_definition.py index bfd768ab..cab5bea0 100644 --- a/src/square/requests/custom_attribute_definition.py +++ b/src/square/requests/custom_attribute_definition.py @@ -31,7 +31,7 @@ class CustomAttributeDefinitionParams(typing_extensions.TypedDict): a definition and must be unique per application, seller, and resource type. """ - schema: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]] + schema: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] """ The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information, see [Custom Attributes Overview](https://developer.squareup.com/docs/devtools/customattributes/overview). This field is required when creating a definition. diff --git a/src/square/requests/destination_details_external_refund_details.py b/src/square/requests/destination_details_external_refund_details.py index 43f2bd10..382e40f7 100644 --- a/src/square/requests/destination_details_external_refund_details.py +++ b/src/square/requests/destination_details_external_refund_details.py @@ -16,7 +16,7 @@ class DestinationDetailsExternalRefundDetailsParams(typing_extensions.TypedDict) following: - CHECK - Refunded using a physical check. - BANK_TRANSFER - Refunded using external bank transfer. - - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. + - OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card. - CRYPTO - Refunded using a crypto currency. - SQUARE_CASH - Refunded using Square Cash App. - SOCIAL - Refunded using peer-to-peer payment applications. diff --git a/src/square/requests/event_data.py b/src/square/requests/event_data.py index aa2c4e11..70ab38aa 100644 --- a/src/square/requests/event_data.py +++ b/src/square/requests/event_data.py @@ -21,7 +21,7 @@ class EventDataParams(typing_extensions.TypedDict): This is true if the affected object has been deleted; otherwise, it's absent. """ - object: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]]] + object: typing_extensions.NotRequired[typing.Optional[typing.Dict[str, typing.Any]]] """ An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. """ diff --git a/src/square/requests/external_payment_details.py b/src/square/requests/external_payment_details.py index 50ce0451..abb715ec 100644 --- a/src/square/requests/external_payment_details.py +++ b/src/square/requests/external_payment_details.py @@ -18,7 +18,7 @@ class ExternalPaymentDetailsParams(typing_extensions.TypedDict): The type of external payment the seller received. It can be one of the following: - CHECK - Paid using a physical check. - BANK_TRANSFER - Paid using external bank transfer. - - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. + - OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card. - CRYPTO - Paid using a crypto currency. - SQUARE_CASH - Paid using Square Cash App. - SOCIAL - Paid using peer-to-peer payment applications. diff --git a/src/square/requests/invoice.py b/src/square/requests/invoice.py index 6b119ae8..7fe72a16 100644 --- a/src/square/requests/invoice.py +++ b/src/square/requests/invoice.py @@ -140,8 +140,8 @@ class InvoiceParams(typing_extensions.TypedDict): When an invoice is created, this field is set to the `timezone` specified for the seller location. The value cannot be changed. - For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles - becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp + For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles + becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/requests/invoice_payment_request.py b/src/square/requests/invoice_payment_request.py index 4514d46f..b1bdcac6 100644 --- a/src/square/requests/invoice_payment_request.py +++ b/src/square/requests/invoice_payment_request.py @@ -51,7 +51,7 @@ class InvoicePaymentRequestParams(typing_extensions.TypedDict): charges the payment source on this date. After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` - of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC + of America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/subscriptions/client.py b/src/square/subscriptions/client.py index 376f3c0b..b4ebec5e 100644 --- a/src/square/subscriptions/client.py +++ b/src/square/subscriptions/client.py @@ -18,6 +18,7 @@ from ..types.create_subscription_response import CreateSubscriptionResponse from ..types.delete_subscription_action_response import DeleteSubscriptionActionResponse from ..types.get_subscription_response import GetSubscriptionResponse +from ..types.list_subscription_events_response import ListSubscriptionEventsResponse from ..types.pause_subscription_response import PauseSubscriptionResponse from ..types.resume_subscription_response import ResumeSubscriptionResponse from ..types.search_subscriptions_response import SearchSubscriptionsResponse @@ -542,7 +543,7 @@ def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[SubscriptionEvent]: + ) -> SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -567,7 +568,7 @@ def list_events( Returns ------- - SyncPager[SubscriptionEvent] + SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] Success Examples @@ -1349,7 +1350,7 @@ async def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[SubscriptionEvent]: + ) -> AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -1374,7 +1375,7 @@ async def list_events( Returns ------- - AsyncPager[SubscriptionEvent] + AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] Success Examples diff --git a/src/square/subscriptions/raw_client.py b/src/square/subscriptions/raw_client.py index 2a08dc2a..da656ca0 100644 --- a/src/square/subscriptions/raw_client.py +++ b/src/square/subscriptions/raw_client.py @@ -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 @@ -602,7 +602,7 @@ def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[SubscriptionEvent]: + ) -> SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -627,7 +627,7 @@ def list_events( Returns ------- - SyncPager[SubscriptionEvent] + SyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -657,9 +657,7 @@ def list_events( limit=limit, 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) @@ -1438,7 +1436,7 @@ async def list_events( cursor: typing.Optional[str] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[SubscriptionEvent]: + ) -> AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse]: """ Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. @@ -1463,7 +1461,7 @@ async def list_events( Returns ------- - AsyncPager[SubscriptionEvent] + AsyncPager[SubscriptionEvent, ListSubscriptionEventsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -1496,9 +1494,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) diff --git a/src/square/transfer_orders/client.py b/src/square/transfer_orders/client.py index e3caacd7..fee6a89e 100644 --- a/src/square/transfer_orders/client.py +++ b/src/square/transfer_orders/client.py @@ -14,6 +14,7 @@ from ..types.delete_transfer_order_response import DeleteTransferOrderResponse from ..types.receive_transfer_order_response import ReceiveTransferOrderResponse from ..types.retrieve_transfer_order_response import RetrieveTransferOrderResponse +from ..types.search_transfer_orders_response import SearchTransferOrdersResponse from ..types.start_transfer_order_response import StartTransferOrderResponse from ..types.transfer_order import TransferOrder from ..types.update_transfer_order_response import UpdateTransferOrderResponse @@ -125,7 +126,7 @@ def search( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TransferOrder]: + ) -> SyncPager[TransferOrder, SearchTransferOrdersResponse]: """ Searches for transfer orders using filters. Returns a paginated list of matching [TransferOrder](entity:TransferOrder)s sorted by creation date. @@ -151,7 +152,7 @@ def search( Returns ------- - SyncPager[TransferOrder] + SyncPager[TransferOrder, SearchTransferOrdersResponse] Success Examples @@ -650,7 +651,7 @@ async def search( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TransferOrder]: + ) -> AsyncPager[TransferOrder, SearchTransferOrdersResponse]: """ Searches for transfer orders using filters. Returns a paginated list of matching [TransferOrder](entity:TransferOrder)s sorted by creation date. @@ -676,7 +677,7 @@ async def search( Returns ------- - AsyncPager[TransferOrder] + AsyncPager[TransferOrder, SearchTransferOrdersResponse] Success Examples diff --git a/src/square/transfer_orders/raw_client.py b/src/square/transfer_orders/raw_client.py index f6e8c471..515b181c 100644 --- a/src/square/transfer_orders/raw_client.py +++ b/src/square/transfer_orders/raw_client.py @@ -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 @@ -116,7 +116,7 @@ def search( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[TransferOrder]: + ) -> SyncPager[TransferOrder, SearchTransferOrdersResponse]: """ Searches for transfer orders using filters. Returns a paginated list of matching [TransferOrder](entity:TransferOrder)s sorted by creation date. @@ -142,7 +142,7 @@ def search( Returns ------- - SyncPager[TransferOrder] + SyncPager[TransferOrder, SearchTransferOrdersResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -179,9 +179,7 @@ def search( limit=limit, 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) @@ -655,7 +653,7 @@ async def search( cursor: typing.Optional[str] = OMIT, limit: typing.Optional[int] = OMIT, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[TransferOrder]: + ) -> AsyncPager[TransferOrder, SearchTransferOrdersResponse]: """ Searches for transfer orders using filters. Returns a paginated list of matching [TransferOrder](entity:TransferOrder)s sorted by creation date. @@ -681,7 +679,7 @@ async def search( Returns ------- - AsyncPager[TransferOrder] + AsyncPager[TransferOrder, SearchTransferOrdersResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -721,9 +719,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) diff --git a/src/square/types/batch_get_catalog_objects_response.py b/src/square/types/batch_get_catalog_objects_response.py index 746c7ad4..97157144 100644 --- a/src/square/types/batch_get_catalog_objects_response.py +++ b/src/square/types/batch_get_catalog_objects_response.py @@ -36,16 +36,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(BatchGetCatalogObjectsResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + BatchGetCatalogObjectsResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/batch_upsert_catalog_objects_response.py b/src/square/types/batch_upsert_catalog_objects_response.py index 214dd202..d9e6158d 100644 --- a/src/square/types/batch_upsert_catalog_objects_response.py +++ b/src/square/types/batch_upsert_catalog_objects_response.py @@ -42,16 +42,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(BatchUpsertCatalogObjectsResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + BatchUpsertCatalogObjectsResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/catalog_category.py b/src/square/types/catalog_category.py index 0afee47e..3c69e61c 100644 --- a/src/square/types/catalog_category.py +++ b/src/square/types/catalog_category.py @@ -85,6 +85,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 +from .catalog_object_category import CatalogObjectCategory # noqa: E402, I001 update_forward_refs(CatalogCategory) diff --git a/src/square/types/catalog_item.py b/src/square/types/catalog_item.py index 0e679cd9..7f62b36b 100644 --- a/src/square/types/catalog_item.py +++ b/src/square/types/catalog_item.py @@ -210,15 +210,17 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(CatalogItem) +from .catalog_object_category import CatalogObjectCategory # noqa: E402, I001 +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + CatalogItem, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/catalog_item_modifier_list_info.py b/src/square/types/catalog_item_modifier_list_info.py index 5c217643..2af03cb9 100644 --- a/src/square/types/catalog_item_modifier_list_info.py +++ b/src/square/types/catalog_item_modifier_list_info.py @@ -59,9 +59,9 @@ class CatalogItemModifierListInfo(UncheckedBaseModel): to a `CatalogItem` instance. """ - allow_quantities: typing.Optional[typing.Optional[typing.Any]] = None - is_conversational: typing.Optional[typing.Optional[typing.Any]] = None - hidden_from_customer_override: typing.Optional[typing.Optional[typing.Any]] = None + allow_quantities: typing.Optional[typing.Any] = None + is_conversational: typing.Optional[typing.Any] = None + hidden_from_customer_override: typing.Optional[typing.Any] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/square/types/catalog_item_option.py b/src/square/types/catalog_item_option.py index 0bc82005..7799ee78 100644 --- a/src/square/types/catalog_item_option.py +++ b/src/square/types/catalog_item_option.py @@ -53,15 +53,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 -update_forward_refs(CatalogItemOption) +update_forward_refs( + CatalogItemOption, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/catalog_modifier_list.py b/src/square/types/catalog_modifier_list.py index 48ce8011..ee851188 100644 --- a/src/square/types/catalog_modifier_list.py +++ b/src/square/types/catalog_modifier_list.py @@ -141,15 +141,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(CatalogModifierList) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + CatalogModifierList, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/catalog_modifier_override.py b/src/square/types/catalog_modifier_override.py index 59bd2851..1a704f45 100644 --- a/src/square/types/catalog_modifier_override.py +++ b/src/square/types/catalog_modifier_override.py @@ -22,8 +22,8 @@ class CatalogModifierOverride(UncheckedBaseModel): __Deprecated__: Use `on_by_default_override` instead. """ - hidden_online_override: typing.Optional[typing.Optional[typing.Any]] = None - on_by_default_override: typing.Optional[typing.Optional[typing.Any]] = None + hidden_online_override: typing.Optional[typing.Any] = None + on_by_default_override: typing.Optional[typing.Any] = None if IS_PYDANTIC_V2: model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2 diff --git a/src/square/types/catalog_object_batch.py b/src/square/types/catalog_object_batch.py index 79b04f9a..1bbb107d 100644 --- a/src/square/types/catalog_object_batch.py +++ b/src/square/types/catalog_object_batch.py @@ -29,16 +29,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(CatalogObjectBatch) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + CatalogObjectBatch, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/catalog_object_category.py b/src/square/types/catalog_object_category.py index a2a78824..99a35db2 100644 --- a/src/square/types/catalog_object_category.py +++ b/src/square/types/catalog_object_category.py @@ -119,6 +119,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 +from .catalog_category import CatalogCategory # noqa: E402, I001 update_forward_refs(CatalogObjectCategory) diff --git a/src/square/types/catalog_object_item.py b/src/square/types/catalog_object_item.py index 1d88d187..36e68c26 100644 --- a/src/square/types/catalog_object_item.py +++ b/src/square/types/catalog_object_item.py @@ -114,14 +114,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 +from .catalog_item import CatalogItem # noqa: E402, I001 update_forward_refs(CatalogObjectItem) diff --git a/src/square/types/catalog_object_item_option.py b/src/square/types/catalog_object_item_option.py index 3b6d321f..5abd62a9 100644 --- a/src/square/types/catalog_object_item_option.py +++ b/src/square/types/catalog_object_item_option.py @@ -114,14 +114,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 +from .catalog_item_option import CatalogItemOption # noqa: E402, I001 update_forward_refs(CatalogObjectItemOption) diff --git a/src/square/types/catalog_object_modifier_list.py b/src/square/types/catalog_object_modifier_list.py index 159a2c9f..15634226 100644 --- a/src/square/types/catalog_object_modifier_list.py +++ b/src/square/types/catalog_object_modifier_list.py @@ -114,14 +114,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 +from .catalog_modifier_list import CatalogModifierList # noqa: E402, I001 update_forward_refs(CatalogObjectModifierList) diff --git a/src/square/types/catalog_object_subscription_plan.py b/src/square/types/catalog_object_subscription_plan.py index b93380b3..15849004 100644 --- a/src/square/types/catalog_object_subscription_plan.py +++ b/src/square/types/catalog_object_subscription_plan.py @@ -114,14 +114,6 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 +from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, I001 update_forward_refs(CatalogObjectSubscriptionPlan) diff --git a/src/square/types/catalog_subscription_plan.py b/src/square/types/catalog_subscription_plan.py index 38e259cb..5bf1a5d0 100644 --- a/src/square/types/catalog_subscription_plan.py +++ b/src/square/types/catalog_subscription_plan.py @@ -57,15 +57,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(CatalogSubscriptionPlan) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + CatalogSubscriptionPlan, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/create_catalog_image_request.py b/src/square/types/create_catalog_image_request.py index e1e2a995..9d00566f 100644 --- a/src/square/types/create_catalog_image_request.py +++ b/src/square/types/create_catalog_image_request.py @@ -49,16 +49,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 -update_forward_refs(CreateCatalogImageRequest) +update_forward_refs( + CreateCatalogImageRequest, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/create_catalog_image_response.py b/src/square/types/create_catalog_image_response.py index 982300ae..65e6ae03 100644 --- a/src/square/types/create_catalog_image_response.py +++ b/src/square/types/create_catalog_image_response.py @@ -32,16 +32,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(CreateCatalogImageResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + CreateCatalogImageResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/create_payment_link_response.py b/src/square/types/create_payment_link_response.py index 80c281e9..f2dbaca6 100644 --- a/src/square/types/create_payment_link_response.py +++ b/src/square/types/create_payment_link_response.py @@ -38,15 +38,4 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 - update_forward_refs(CreatePaymentLinkResponse) diff --git a/src/square/types/custom_attribute.py b/src/square/types/custom_attribute.py index cd1d13cb..7aa30cf7 100644 --- a/src/square/types/custom_attribute.py +++ b/src/square/types/custom_attribute.py @@ -30,7 +30,7 @@ class CustomAttribute(UncheckedBaseModel): underscores (_), and hyphens (-). """ - value: typing.Optional[typing.Optional[typing.Any]] = pydantic.Field(default=None) + value: typing.Optional[typing.Any] = pydantic.Field(default=None) """ The value assigned to the custom attribute. It is validated against the custom attribute definition's schema on write operations. For more information about custom diff --git a/src/square/types/custom_attribute_definition.py b/src/square/types/custom_attribute_definition.py index a944a9c5..9e4687de 100644 --- a/src/square/types/custom_attribute_definition.py +++ b/src/square/types/custom_attribute_definition.py @@ -36,7 +36,7 @@ class CustomAttributeDefinition(UncheckedBaseModel): """ schema_: typing_extensions.Annotated[ - typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]], FieldMetadata(alias="schema") + typing.Optional[typing.Dict[str, typing.Any]], FieldMetadata(alias="schema") ] = pydantic.Field(default=None) """ The JSON schema for the custom attribute definition, which determines the data type of the corresponding custom attributes. For more information, diff --git a/src/square/types/destination_details_external_refund_details.py b/src/square/types/destination_details_external_refund_details.py index 9edb02f3..7642a756 100644 --- a/src/square/types/destination_details_external_refund_details.py +++ b/src/square/types/destination_details_external_refund_details.py @@ -18,7 +18,7 @@ class DestinationDetailsExternalRefundDetails(UncheckedBaseModel): following: - CHECK - Refunded using a physical check. - BANK_TRANSFER - Refunded using external bank transfer. - - OTHER\_GIFT\_CARD - Refunded using a non-Square gift card. + - OTHER\\_GIFT\\_CARD - Refunded using a non-Square gift card. - CRYPTO - Refunded using a crypto currency. - SQUARE_CASH - Refunded using Square Cash App. - SOCIAL - Refunded using peer-to-peer payment applications. diff --git a/src/square/types/event_data.py b/src/square/types/event_data.py index 6cdcadab..f552902c 100644 --- a/src/square/types/event_data.py +++ b/src/square/types/event_data.py @@ -23,7 +23,7 @@ class EventData(UncheckedBaseModel): This is true if the affected object has been deleted; otherwise, it's absent. """ - object: typing.Optional[typing.Dict[str, typing.Optional[typing.Any]]] = pydantic.Field(default=None) + object: typing.Optional[typing.Dict[str, typing.Any]] = pydantic.Field(default=None) """ An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. """ diff --git a/src/square/types/external_payment_details.py b/src/square/types/external_payment_details.py index 15d16e02..1eff2b2f 100644 --- a/src/square/types/external_payment_details.py +++ b/src/square/types/external_payment_details.py @@ -20,7 +20,7 @@ class ExternalPaymentDetails(UncheckedBaseModel): The type of external payment the seller received. It can be one of the following: - CHECK - Paid using a physical check. - BANK_TRANSFER - Paid using external bank transfer. - - OTHER\_GIFT\_CARD - Paid using a non-Square gift card. + - OTHER\\_GIFT\\_CARD - Paid using a non-Square gift card. - CRYPTO - Paid using a crypto currency. - SQUARE_CASH - Paid using Square Cash App. - SOCIAL - Paid using peer-to-peer payment applications. diff --git a/src/square/types/get_booking_request.py b/src/square/types/get_booking_request.py index 903d1cee..bbdd6929 100644 --- a/src/square/types/get_booking_request.py +++ b/src/square/types/get_booking_request.py @@ -2,4 +2,4 @@ import typing -GetBookingRequest = typing.Optional[typing.Any] +GetBookingRequest = typing.Any diff --git a/src/square/types/get_business_booking_profile_request.py b/src/square/types/get_business_booking_profile_request.py index 2e99a602..54cc04a8 100644 --- a/src/square/types/get_business_booking_profile_request.py +++ b/src/square/types/get_business_booking_profile_request.py @@ -2,4 +2,4 @@ import typing -GetBusinessBookingProfileRequest = typing.Optional[typing.Any] +GetBusinessBookingProfileRequest = typing.Any diff --git a/src/square/types/get_card_request.py b/src/square/types/get_card_request.py index ce8ce851..edf428d3 100644 --- a/src/square/types/get_card_request.py +++ b/src/square/types/get_card_request.py @@ -2,4 +2,4 @@ import typing -GetCardRequest = typing.Optional[typing.Any] +GetCardRequest = typing.Any diff --git a/src/square/types/get_catalog_object_response.py b/src/square/types/get_catalog_object_response.py index fcde3695..0689e6b6 100644 --- a/src/square/types/get_catalog_object_response.py +++ b/src/square/types/get_catalog_object_response.py @@ -36,16 +36,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(GetCatalogObjectResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + GetCatalogObjectResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/get_customer_group_request.py b/src/square/types/get_customer_group_request.py index bd9d92ae..e720526f 100644 --- a/src/square/types/get_customer_group_request.py +++ b/src/square/types/get_customer_group_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerGroupRequest = typing.Optional[typing.Any] +GetCustomerGroupRequest = typing.Any diff --git a/src/square/types/get_customer_request.py b/src/square/types/get_customer_request.py index f4fe772a..a0295d25 100644 --- a/src/square/types/get_customer_request.py +++ b/src/square/types/get_customer_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerRequest = typing.Optional[typing.Any] +GetCustomerRequest = typing.Any diff --git a/src/square/types/get_customer_segment_request.py b/src/square/types/get_customer_segment_request.py index 21608589..94551e4b 100644 --- a/src/square/types/get_customer_segment_request.py +++ b/src/square/types/get_customer_segment_request.py @@ -2,4 +2,4 @@ import typing -GetCustomerSegmentRequest = typing.Optional[typing.Any] +GetCustomerSegmentRequest = typing.Any diff --git a/src/square/types/get_dispute_evidence_request.py b/src/square/types/get_dispute_evidence_request.py index 9979e123..dc44679c 100644 --- a/src/square/types/get_dispute_evidence_request.py +++ b/src/square/types/get_dispute_evidence_request.py @@ -2,4 +2,4 @@ import typing -GetDisputeEvidenceRequest = typing.Optional[typing.Any] +GetDisputeEvidenceRequest = typing.Any diff --git a/src/square/types/get_dispute_request.py b/src/square/types/get_dispute_request.py index eb8bec70..cf91a4c3 100644 --- a/src/square/types/get_dispute_request.py +++ b/src/square/types/get_dispute_request.py @@ -2,4 +2,4 @@ import typing -GetDisputeRequest = typing.Optional[typing.Any] +GetDisputeRequest = typing.Any diff --git a/src/square/types/get_employee_request.py b/src/square/types/get_employee_request.py index 62bb6fa3..8b9ca75c 100644 --- a/src/square/types/get_employee_request.py +++ b/src/square/types/get_employee_request.py @@ -2,4 +2,4 @@ import typing -GetEmployeeRequest = typing.Optional[typing.Any] +GetEmployeeRequest = typing.Any diff --git a/src/square/types/get_gift_card_request.py b/src/square/types/get_gift_card_request.py index 4cdd3be9..5e378b06 100644 --- a/src/square/types/get_gift_card_request.py +++ b/src/square/types/get_gift_card_request.py @@ -2,4 +2,4 @@ import typing -GetGiftCardRequest = typing.Optional[typing.Any] +GetGiftCardRequest = typing.Any diff --git a/src/square/types/get_inventory_adjustment_request.py b/src/square/types/get_inventory_adjustment_request.py index f1258352..58d4e171 100644 --- a/src/square/types/get_inventory_adjustment_request.py +++ b/src/square/types/get_inventory_adjustment_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryAdjustmentRequest = typing.Optional[typing.Any] +GetInventoryAdjustmentRequest = typing.Any diff --git a/src/square/types/get_inventory_physical_count_request.py b/src/square/types/get_inventory_physical_count_request.py index 5da8479e..57760a05 100644 --- a/src/square/types/get_inventory_physical_count_request.py +++ b/src/square/types/get_inventory_physical_count_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryPhysicalCountRequest = typing.Optional[typing.Any] +GetInventoryPhysicalCountRequest = typing.Any diff --git a/src/square/types/get_inventory_transfer_request.py b/src/square/types/get_inventory_transfer_request.py index 1b7b324e..ffb0d737 100644 --- a/src/square/types/get_inventory_transfer_request.py +++ b/src/square/types/get_inventory_transfer_request.py @@ -2,4 +2,4 @@ import typing -GetInventoryTransferRequest = typing.Optional[typing.Any] +GetInventoryTransferRequest = typing.Any diff --git a/src/square/types/get_location_request.py b/src/square/types/get_location_request.py index 652d8200..d42756c0 100644 --- a/src/square/types/get_location_request.py +++ b/src/square/types/get_location_request.py @@ -2,4 +2,4 @@ import typing -GetLocationRequest = typing.Optional[typing.Any] +GetLocationRequest = typing.Any diff --git a/src/square/types/get_loyalty_account_request.py b/src/square/types/get_loyalty_account_request.py index e55abe95..91099540 100644 --- a/src/square/types/get_loyalty_account_request.py +++ b/src/square/types/get_loyalty_account_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyAccountRequest = typing.Optional[typing.Any] +GetLoyaltyAccountRequest = typing.Any diff --git a/src/square/types/get_loyalty_program_request.py b/src/square/types/get_loyalty_program_request.py index 49a2688c..d079e21a 100644 --- a/src/square/types/get_loyalty_program_request.py +++ b/src/square/types/get_loyalty_program_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyProgramRequest = typing.Optional[typing.Any] +GetLoyaltyProgramRequest = typing.Any diff --git a/src/square/types/get_loyalty_promotion_request.py b/src/square/types/get_loyalty_promotion_request.py index 943f01b2..520df014 100644 --- a/src/square/types/get_loyalty_promotion_request.py +++ b/src/square/types/get_loyalty_promotion_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyPromotionRequest = typing.Optional[typing.Any] +GetLoyaltyPromotionRequest = typing.Any diff --git a/src/square/types/get_loyalty_reward_request.py b/src/square/types/get_loyalty_reward_request.py index 7bd0591c..af544cf5 100644 --- a/src/square/types/get_loyalty_reward_request.py +++ b/src/square/types/get_loyalty_reward_request.py @@ -2,4 +2,4 @@ import typing -GetLoyaltyRewardRequest = typing.Optional[typing.Any] +GetLoyaltyRewardRequest = typing.Any diff --git a/src/square/types/get_merchant_request.py b/src/square/types/get_merchant_request.py index 1dd24b56..31660385 100644 --- a/src/square/types/get_merchant_request.py +++ b/src/square/types/get_merchant_request.py @@ -2,4 +2,4 @@ import typing -GetMerchantRequest = typing.Optional[typing.Any] +GetMerchantRequest = typing.Any diff --git a/src/square/types/get_order_request.py b/src/square/types/get_order_request.py index 5bcbdf84..68e52624 100644 --- a/src/square/types/get_order_request.py +++ b/src/square/types/get_order_request.py @@ -2,4 +2,4 @@ import typing -GetOrderRequest = typing.Optional[typing.Any] +GetOrderRequest = typing.Any diff --git a/src/square/types/get_payment_link_request.py b/src/square/types/get_payment_link_request.py index 384b63a5..c0a0874a 100644 --- a/src/square/types/get_payment_link_request.py +++ b/src/square/types/get_payment_link_request.py @@ -2,4 +2,4 @@ import typing -GetPaymentLinkRequest = typing.Optional[typing.Any] +GetPaymentLinkRequest = typing.Any diff --git a/src/square/types/get_snippet_request.py b/src/square/types/get_snippet_request.py index 65afb268..b7771d81 100644 --- a/src/square/types/get_snippet_request.py +++ b/src/square/types/get_snippet_request.py @@ -2,4 +2,4 @@ import typing -GetSnippetRequest = typing.Optional[typing.Any] +GetSnippetRequest = typing.Any diff --git a/src/square/types/get_team_member_booking_profile_request.py b/src/square/types/get_team_member_booking_profile_request.py index 3a11ecb5..fa1fe13f 100644 --- a/src/square/types/get_team_member_booking_profile_request.py +++ b/src/square/types/get_team_member_booking_profile_request.py @@ -2,4 +2,4 @@ import typing -GetTeamMemberBookingProfileRequest = typing.Optional[typing.Any] +GetTeamMemberBookingProfileRequest = typing.Any diff --git a/src/square/types/get_team_member_request.py b/src/square/types/get_team_member_request.py index 0735139b..41b8fcf1 100644 --- a/src/square/types/get_team_member_request.py +++ b/src/square/types/get_team_member_request.py @@ -2,4 +2,4 @@ import typing -GetTeamMemberRequest = typing.Optional[typing.Any] +GetTeamMemberRequest = typing.Any diff --git a/src/square/types/get_transaction_request.py b/src/square/types/get_transaction_request.py index ae881606..06c29bef 100644 --- a/src/square/types/get_transaction_request.py +++ b/src/square/types/get_transaction_request.py @@ -2,4 +2,4 @@ import typing -GetTransactionRequest = typing.Optional[typing.Any] +GetTransactionRequest = typing.Any diff --git a/src/square/types/get_vendor_request.py b/src/square/types/get_vendor_request.py index fb1e92df..e6864ab9 100644 --- a/src/square/types/get_vendor_request.py +++ b/src/square/types/get_vendor_request.py @@ -2,4 +2,4 @@ import typing -GetVendorRequest = typing.Optional[typing.Any] +GetVendorRequest = typing.Any diff --git a/src/square/types/get_wage_setting_request.py b/src/square/types/get_wage_setting_request.py index c3fe3429..32607311 100644 --- a/src/square/types/get_wage_setting_request.py +++ b/src/square/types/get_wage_setting_request.py @@ -2,4 +2,4 @@ import typing -GetWageSettingRequest = typing.Optional[typing.Any] +GetWageSettingRequest = typing.Any diff --git a/src/square/types/get_webhook_subscription_request.py b/src/square/types/get_webhook_subscription_request.py index f36ccd35..b5a574d8 100644 --- a/src/square/types/get_webhook_subscription_request.py +++ b/src/square/types/get_webhook_subscription_request.py @@ -2,4 +2,4 @@ import typing -GetWebhookSubscriptionRequest = typing.Optional[typing.Any] +GetWebhookSubscriptionRequest = typing.Any diff --git a/src/square/types/invoice.py b/src/square/types/invoice.py index 6963488e..0d58ca08 100644 --- a/src/square/types/invoice.py +++ b/src/square/types/invoice.py @@ -142,8 +142,8 @@ class Invoice(UncheckedBaseModel): When an invoice is created, this field is set to the `timezone` specified for the seller location. The value cannot be changed. - For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\_Angeles - becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC timestamp + For example, a payment `due_date` of 2021-03-09 with a `timezone` of America/Los\\_Angeles + becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/types/invoice_payment_request.py b/src/square/types/invoice_payment_request.py index f86c1c34..4008b50a 100644 --- a/src/square/types/invoice_payment_request.py +++ b/src/square/types/invoice_payment_request.py @@ -53,7 +53,7 @@ class InvoicePaymentRequest(UncheckedBaseModel): charges the payment source on this date. After this date, the invoice becomes overdue. For example, a payment `due_date` of 2021-03-09 with a `timezone` - of America/Los\_Angeles becomes overdue at midnight on March 9 in America/Los\_Angeles (which equals a UTC + of America/Los\\_Angeles becomes overdue at midnight on March 9 in America/Los\\_Angeles (which equals a UTC timestamp of 2021-03-10T08:00:00Z). """ diff --git a/src/square/types/list_catalog_response.py b/src/square/types/list_catalog_response.py index 2e4c7e1d..86d48d3c 100644 --- a/src/square/types/list_catalog_response.py +++ b/src/square/types/list_catalog_response.py @@ -37,16 +37,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(ListCatalogResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + ListCatalogResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/payment_link_related_resources.py b/src/square/types/payment_link_related_resources.py index c0aee782..c5774874 100644 --- a/src/square/types/payment_link_related_resources.py +++ b/src/square/types/payment_link_related_resources.py @@ -31,16 +31,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(PaymentLinkRelatedResources) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + PaymentLinkRelatedResources, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/search_catalog_items_response.py b/src/square/types/search_catalog_items_response.py index c751e262..dbebd7a5 100644 --- a/src/square/types/search_catalog_items_response.py +++ b/src/square/types/search_catalog_items_response.py @@ -45,16 +45,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(SearchCatalogItemsResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + SearchCatalogItemsResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/search_catalog_objects_response.py b/src/square/types/search_catalog_objects_response.py index 147f1392..e7a218db 100644 --- a/src/square/types/search_catalog_objects_response.py +++ b/src/square/types/search_catalog_objects_response.py @@ -48,16 +48,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(SearchCatalogObjectsResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + SearchCatalogObjectsResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/update_catalog_image_response.py b/src/square/types/update_catalog_image_response.py index cd4b1b3a..c6c9b764 100644 --- a/src/square/types/update_catalog_image_response.py +++ b/src/square/types/update_catalog_image_response.py @@ -32,16 +32,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(UpdateCatalogImageResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + UpdateCatalogImageResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/upsert_catalog_object_response.py b/src/square/types/upsert_catalog_object_response.py index e0c6fb8d..e0f4fd7c 100644 --- a/src/square/types/upsert_catalog_object_response.py +++ b/src/square/types/upsert_catalog_object_response.py @@ -37,16 +37,16 @@ class Config: extra = pydantic.Extra.allow -from .catalog_category import CatalogCategory # noqa: E402, F401, I001 -from .catalog_item import CatalogItem # noqa: E402, F401, I001 -from .catalog_item_option import CatalogItemOption # noqa: E402, F401, I001 -from .catalog_modifier_list import CatalogModifierList # noqa: E402, F401, I001 -from .catalog_object_category import CatalogObjectCategory # noqa: E402, F401, I001 -from .catalog_object_item import CatalogObjectItem # noqa: E402, F401, I001 -from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, F401, I001 -from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, F401, I001 -from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_subscription_plan import CatalogSubscriptionPlan # noqa: E402, F401, I001 -from .catalog_object import CatalogObject # noqa: E402, F401, I001 - -update_forward_refs(UpsertCatalogObjectResponse) +from .catalog_object_item import CatalogObjectItem # noqa: E402, I001 +from .catalog_object_item_option import CatalogObjectItemOption # noqa: E402, I001 +from .catalog_object_modifier_list import CatalogObjectModifierList # noqa: E402, I001 +from .catalog_object_subscription_plan import CatalogObjectSubscriptionPlan # noqa: E402, I001 +from .catalog_object import CatalogObject # noqa: E402, I001 + +update_forward_refs( + UpsertCatalogObjectResponse, + CatalogObjectItem=CatalogObjectItem, + CatalogObjectItemOption=CatalogObjectItemOption, + CatalogObjectSubscriptionPlan=CatalogObjectSubscriptionPlan, + CatalogObjectModifierList=CatalogObjectModifierList, +) diff --git a/src/square/types/v1get_payment_request.py b/src/square/types/v1get_payment_request.py index 6d09cf01..6d3cf15c 100644 --- a/src/square/types/v1get_payment_request.py +++ b/src/square/types/v1get_payment_request.py @@ -2,4 +2,4 @@ import typing -V1GetPaymentRequest = typing.Optional[typing.Any] +V1GetPaymentRequest = typing.Any diff --git a/src/square/types/v1get_settlement_request.py b/src/square/types/v1get_settlement_request.py index f6741366..0204d1e4 100644 --- a/src/square/types/v1get_settlement_request.py +++ b/src/square/types/v1get_settlement_request.py @@ -2,4 +2,4 @@ import typing -V1GetSettlementRequest = typing.Optional[typing.Any] +V1GetSettlementRequest = typing.Any diff --git a/src/square/webhooks/subscriptions/client.py b/src/square/webhooks/subscriptions/client.py index d08f8f11..684bff7c 100644 --- a/src/square/webhooks/subscriptions/client.py +++ b/src/square/webhooks/subscriptions/client.py @@ -9,6 +9,7 @@ from ...types.create_webhook_subscription_response import CreateWebhookSubscriptionResponse from ...types.delete_webhook_subscription_response import DeleteWebhookSubscriptionResponse from ...types.get_webhook_subscription_response import GetWebhookSubscriptionResponse +from ...types.list_webhook_subscriptions_response import ListWebhookSubscriptionsResponse from ...types.sort_order import SortOrder from ...types.test_webhook_subscription_response import TestWebhookSubscriptionResponse from ...types.update_webhook_subscription_response import UpdateWebhookSubscriptionResponse @@ -43,7 +44,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WebhookSubscription]: + ) -> SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: """ Lists all webhook subscriptions owned by your application. @@ -75,7 +76,7 @@ def list( Returns ------- - SyncPager[WebhookSubscription] + SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] Success Examples @@ -372,7 +373,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WebhookSubscription]: + ) -> AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: """ Lists all webhook subscriptions owned by your application. @@ -404,7 +405,7 @@ async def list( Returns ------- - AsyncPager[WebhookSubscription] + AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] Success Examples diff --git a/src/square/webhooks/subscriptions/raw_client.py b/src/square/webhooks/subscriptions/raw_client.py index 9a30e2b0..2f5d0d92 100644 --- a/src/square/webhooks/subscriptions/raw_client.py +++ b/src/square/webhooks/subscriptions/raw_client.py @@ -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 @@ -38,7 +38,7 @@ def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> SyncPager[WebhookSubscription]: + ) -> SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: """ Lists all webhook subscriptions owned by your application. @@ -70,7 +70,7 @@ def list( Returns ------- - SyncPager[WebhookSubscription] + SyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] Success """ _response = self._client_wrapper.httpx_client.request( @@ -103,9 +103,7 @@ def list( limit=limit, 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) @@ -420,7 +418,7 @@ async def list( sort_order: typing.Optional[SortOrder] = None, limit: typing.Optional[int] = None, request_options: typing.Optional[RequestOptions] = None, - ) -> AsyncPager[WebhookSubscription]: + ) -> AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse]: """ Lists all webhook subscriptions owned by your application. @@ -452,7 +450,7 @@ async def list( Returns ------- - AsyncPager[WebhookSubscription] + AsyncPager[WebhookSubscription, ListWebhookSubscriptionsResponse] Success """ _response = await self._client_wrapper.httpx_client.request( @@ -488,9 +486,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)