From 91ba2a7edf4c74e4f57190262ca4bbe99aa87f0e Mon Sep 17 00:00:00 2001 From: Haydar Ghasemi Date: Wed, 29 Oct 2025 11:31:00 +0330 Subject: [PATCH] fix(pg): new wallet api new wallet api --- gooyal_wallet_client/api/api/__init__.py | 1 - .../api/api/api_charge_create_create.py | 151 ------------ ...wallet_api_application_balance_retrieve.py | 127 ---------- ...llet_api_application_balance_retrieve_2.py | 151 ------------ .../wallet_api_application_deposit_create.py | 15 +- ...wallet_api_application_deposit_create_2.py | 168 ------------- ...api_application_deposit_verify_retrieve.py | 15 +- ...i_application_deposit_verify_retrieve_2.py | 160 ------------ .../wallet/wallet_api_application_retrieve.py | 160 ------------ .../wallet_api_application_retrieve_2.py | 147 ------------ ...allet_api_application_transactions_list.py | 227 ++++++++++++++++++ ..._api_application_transactions_retrieve.py} | 57 +++-- ...api_application_user_balance_retrieve_2.py | 160 ------------ ...=> wallet_api_application_wallets_list.py} | 38 +-- ...llet_api_application_wallets_user_list.py} | 97 ++++---- .../wallet_api_application_withdraw_create.py | 15 +- ...allet_api_application_withdraw_create_2.py | 168 ------------- ...pi_application_withdraw_verify_retrieve.py | 15 +- ..._application_withdraw_verify_retrieve_2.py | 160 ------------ .../wallet/wallet_api_transactions_list.py | 81 ++++++- .../wallet_api_user_balance_retrieve.py | 147 ------------ .../wallet_api_wallet_balance_retrieve.py | 123 ---------- ...n_list_2.py => wallet_api_wallets_list.py} | 72 +++--- gooyal_wallet_client/models/__init__.py | 22 +- .../{application_balance.py => account.py} | 43 +++- .../models/application_deposit.py | 40 ++- .../models/application_transaction.py | 160 ------------ .../models/application_withdraw.py | 40 ++- gooyal_wallet_client/models/charge.py | 150 ------------ gooyal_wallet_client/models/my_wallet.py | 59 ----- ...tion_list.py => paginated_account_list.py} | 20 +- ..._list.py => paginated_transaction_list.py} | 20 +- .../{user_transaction.py => transaction.py} | 58 +++-- 33 files changed, 651 insertions(+), 2416 deletions(-) delete mode 100644 gooyal_wallet_client/api/api/__init__.py delete mode 100644 gooyal_wallet_client/api/api/api_charge_create_create.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve_2.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create_2.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve_2.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_retrieve.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_retrieve_2.py create mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_transactions_list.py rename gooyal_wallet_client/api/wallet/{wallet_api_application_user_balance_retrieve.py => wallet_api_application_transactions_retrieve.py} (75%) delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve_2.py rename gooyal_wallet_client/api/wallet/{wallet_api_application_list.py => wallet_api_application_wallets_list.py} (82%) rename gooyal_wallet_client/api/wallet/{wallet_api_user_transactions_list.py => wallet_api_application_wallets_user_list.py} (64%) delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create_2.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve_2.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_user_balance_retrieve.py delete mode 100644 gooyal_wallet_client/api/wallet/wallet_api_wallet_balance_retrieve.py rename gooyal_wallet_client/api/wallet/{wallet_api_application_list_2.py => wallet_api_wallets_list.py} (74%) rename gooyal_wallet_client/models/{application_balance.py => account.py} (53%) delete mode 100644 gooyal_wallet_client/models/application_transaction.py delete mode 100644 gooyal_wallet_client/models/charge.py delete mode 100644 gooyal_wallet_client/models/my_wallet.py rename gooyal_wallet_client/models/{paginated_user_transaction_list.py => paginated_account_list.py} (85%) rename gooyal_wallet_client/models/{paginated_application_transaction_list.py => paginated_transaction_list.py} (84%) rename gooyal_wallet_client/models/{user_transaction.py => transaction.py} (76%) diff --git a/gooyal_wallet_client/api/api/__init__.py b/gooyal_wallet_client/api/api/__init__.py deleted file mode 100644 index 2d7c0b2..0000000 --- a/gooyal_wallet_client/api/api/__init__.py +++ /dev/null @@ -1 +0,0 @@ -"""Contains endpoint functions for accessing the API""" diff --git a/gooyal_wallet_client/api/api/api_charge_create_create.py b/gooyal_wallet_client/api/api/api_charge_create_create.py deleted file mode 100644 index d85ea99..0000000 --- a/gooyal_wallet_client/api/api/api_charge_create_create.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.charge import Charge -from ...types import Response - - -def _get_kwargs( - *, - body: Charge, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": "/api/charge_create", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Charge]: - if response.status_code == 201: - response_201 = Charge.from_dict(response.json()) - - return response_201 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Charge]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, - body: Charge, -) -> Response[Charge]: - """ - Args: - body (Charge): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Charge] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, - body: Charge, -) -> Optional[Charge]: - """ - Args: - body (Charge): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Charge - """ - - return sync_detailed( - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, - body: Charge, -) -> Response[Charge]: - """ - Args: - body (Charge): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[Charge] - """ - - kwargs = _get_kwargs( - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, - body: Charge, -) -> Optional[Charge]: - """ - Args: - body (Charge): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Charge - """ - - return ( - await asyncio_detailed( - client=client, - body=body, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve.py deleted file mode 100644 index f896c6c..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve.py +++ /dev/null @@ -1,127 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_balance import ApplicationBalance -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/wallet/api/application/balance", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationBalance]: - if response.status_code == 200: - response_200 = ApplicationBalance.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationBalance]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[ApplicationBalance]: - """API for getting specified user or application balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationBalance] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[ApplicationBalance]: - """API for getting specified user or application balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationBalance - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[ApplicationBalance]: - """API for getting specified user or application balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationBalance] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> Optional[ApplicationBalance]: - """API for getting specified user or application balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationBalance - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve_2.py deleted file mode 100644 index 6c10de8..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_balance_retrieve_2.py +++ /dev/null @@ -1,151 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_balance import ApplicationBalance -from ...types import Response - - -def _get_kwargs( - category_uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{category_uuid}/balance", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationBalance]: - if response.status_code == 200: - response_200 = ApplicationBalance.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationBalance]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationBalance]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationBalance] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationBalance]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationBalance - """ - - return sync_detailed( - category_uuid=category_uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationBalance]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationBalance] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationBalance]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationBalance - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create.py b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create.py index 12f96d7..c4f8fa1 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create.py @@ -10,6 +10,7 @@ from ...types import Response def _get_kwargs( + payer_wallet: str, *, body: ApplicationDeposit, ) -> dict[str, Any]: @@ -17,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/wallet/api/application/deposit/", + "url": f"/wallet/api/application/{payer_wallet}/deposit/", } _kwargs["json"] = body.to_dict() @@ -54,12 +55,14 @@ def _build_response( def sync_detailed( + payer_wallet: str, *, client: AuthenticatedClient, body: ApplicationDeposit, ) -> Response[ApplicationDeposit]: """ Args: + payer_wallet (str): body (ApplicationDeposit): Raises: @@ -71,6 +74,7 @@ def sync_detailed( """ kwargs = _get_kwargs( + payer_wallet=payer_wallet, body=body, ) @@ -82,12 +86,14 @@ def sync_detailed( def sync( + payer_wallet: str, *, client: AuthenticatedClient, body: ApplicationDeposit, ) -> Optional[ApplicationDeposit]: """ Args: + payer_wallet (str): body (ApplicationDeposit): Raises: @@ -99,18 +105,21 @@ def sync( """ return sync_detailed( + payer_wallet=payer_wallet, client=client, body=body, ).parsed async def asyncio_detailed( + payer_wallet: str, *, client: AuthenticatedClient, body: ApplicationDeposit, ) -> Response[ApplicationDeposit]: """ Args: + payer_wallet (str): body (ApplicationDeposit): Raises: @@ -122,6 +131,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( + payer_wallet=payer_wallet, body=body, ) @@ -131,12 +141,14 @@ async def asyncio_detailed( async def asyncio( + payer_wallet: str, *, client: AuthenticatedClient, body: ApplicationDeposit, ) -> Optional[ApplicationDeposit]: """ Args: + payer_wallet (str): body (ApplicationDeposit): Raises: @@ -149,6 +161,7 @@ async def asyncio( return ( await asyncio_detailed( + payer_wallet=payer_wallet, client=client, body=body, ) diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create_2.py deleted file mode 100644 index ef013a5..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_create_2.py +++ /dev/null @@ -1,168 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_deposit import ApplicationDeposit -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - *, - body: ApplicationDeposit, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": f"/wallet/api/application/{category_uuid}/deposit/", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationDeposit]: - if response.status_code == 201: - response_201 = ApplicationDeposit.from_dict(response.json()) - - return response_201 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationDeposit]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationDeposit, -) -> Response[ApplicationDeposit]: - """ - Args: - category_uuid (str): - body (ApplicationDeposit): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationDeposit] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationDeposit, -) -> Optional[ApplicationDeposit]: - """ - Args: - category_uuid (str): - body (ApplicationDeposit): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationDeposit - """ - - return sync_detailed( - category_uuid=category_uuid, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationDeposit, -) -> Response[ApplicationDeposit]: - """ - Args: - category_uuid (str): - body (ApplicationDeposit): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationDeposit] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationDeposit, -) -> Optional[ApplicationDeposit]: - """ - Args: - category_uuid (str): - body (ApplicationDeposit): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationDeposit - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - client=client, - body=body, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve.py index fde4421..29042f3 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve.py @@ -10,11 +10,12 @@ from ...types import Response def _get_kwargs( + payer_wallet: str, uuid: str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/wallet/api/application/deposit/{uuid}/verify", + "url": f"/wallet/api/application/{payer_wallet}/deposit/{uuid}/verify", } return _kwargs @@ -46,12 +47,14 @@ def _build_response( def sync_detailed( + payer_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Response[ApplicationDeposit]: """ Args: + payer_wallet (str): uuid (str): Raises: @@ -63,6 +66,7 @@ def sync_detailed( """ kwargs = _get_kwargs( + payer_wallet=payer_wallet, uuid=uuid, ) @@ -74,12 +78,14 @@ def sync_detailed( def sync( + payer_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Optional[ApplicationDeposit]: """ Args: + payer_wallet (str): uuid (str): Raises: @@ -91,18 +97,21 @@ def sync( """ return sync_detailed( + payer_wallet=payer_wallet, uuid=uuid, client=client, ).parsed async def asyncio_detailed( + payer_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Response[ApplicationDeposit]: """ Args: + payer_wallet (str): uuid (str): Raises: @@ -114,6 +123,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( + payer_wallet=payer_wallet, uuid=uuid, ) @@ -123,12 +133,14 @@ async def asyncio_detailed( async def asyncio( + payer_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Optional[ApplicationDeposit]: """ Args: + payer_wallet (str): uuid (str): Raises: @@ -141,6 +153,7 @@ async def asyncio( return ( await asyncio_detailed( + payer_wallet=payer_wallet, uuid=uuid, client=client, ) diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve_2.py deleted file mode 100644 index e21cbdb..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_deposit_verify_retrieve_2.py +++ /dev/null @@ -1,160 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_deposit import ApplicationDeposit -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{category_uuid}/deposit/{uuid}/verify", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationDeposit]: - if response.status_code == 200: - response_200 = ApplicationDeposit.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationDeposit]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationDeposit]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationDeposit] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationDeposit]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationDeposit - """ - - return sync_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationDeposit]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationDeposit] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationDeposit]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationDeposit - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve.py deleted file mode 100644 index 9ef9349..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve.py +++ /dev/null @@ -1,160 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_transaction import ApplicationTransaction -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{category_uuid}/{uuid}/", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationTransaction]: - if response.status_code == 200: - response_200 = ApplicationTransaction.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationTransaction]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationTransaction]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationTransaction] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationTransaction]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationTransaction - """ - - return sync_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationTransaction]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationTransaction] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationTransaction]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationTransaction - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve_2.py deleted file mode 100644 index 50d6347..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_retrieve_2.py +++ /dev/null @@ -1,147 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_transaction import ApplicationTransaction -from ...types import Response - - -def _get_kwargs( - uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{uuid}/", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationTransaction]: - if response.status_code == 200: - response_200 = ApplicationTransaction.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationTransaction]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationTransaction]: - """ - Args: - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationTransaction] - """ - - kwargs = _get_kwargs( - uuid=uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationTransaction]: - """ - Args: - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationTransaction - """ - - return sync_detailed( - uuid=uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationTransaction]: - """ - Args: - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationTransaction] - """ - - kwargs = _get_kwargs( - uuid=uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationTransaction]: - """ - Args: - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationTransaction - """ - - return ( - await asyncio_detailed( - uuid=uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_transactions_list.py b/gooyal_wallet_client/api/wallet/wallet_api_application_transactions_list.py new file mode 100644 index 0000000..e808f0e --- /dev/null +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_transactions_list.py @@ -0,0 +1,227 @@ +from http import HTTPStatus +from typing import Any, Optional, Union +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.paginated_transaction_list import PaginatedTransactionList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> dict[str, Any]: + params: dict[str, Any] = {} + + params["limit"] = limit + + params["offset"] = offset + + json_payee: Union[Unset, str] = UNSET + if not isinstance(payee, Unset): + json_payee = str(payee) + params["payee"] = json_payee + + json_payer: Union[Unset, str] = UNSET + if not isinstance(payer, Unset): + json_payer = str(payer) + params["payer"] = json_payer + + json_wallets = [] + for wallets_item_data in wallets: + wallets_item = str(wallets_item_data) + json_wallets.append(wallets_item) + + params["wallets"] = json_wallets + + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/wallet/api/application/transactions/", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Optional[PaginatedTransactionList]: + if response.status_code == 200: + response_200 = PaginatedTransactionList.from_dict(response.json()) + + return response_200 + + if client.raise_on_unexpected_status: + raise errors.UnexpectedStatus(response.status_code, response.content) + else: + return None + + +def _build_response( + *, client: Union[AuthenticatedClient, Client], response: httpx.Response +) -> Response[PaginatedTransactionList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + *, + client: AuthenticatedClient, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Response[PaginatedTransactionList]: + """ + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedTransactionList] + """ + + kwargs = _get_kwargs( + limit=limit, + offset=offset, + payee=payee, + payer=payer, + wallets=wallets, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Optional[PaginatedTransactionList]: + """ + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedTransactionList + """ + + return sync_detailed( + client=client, + limit=limit, + offset=offset, + payee=payee, + payer=payer, + wallets=wallets, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Response[PaginatedTransactionList]: + """ + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[PaginatedTransactionList] + """ + + kwargs = _get_kwargs( + limit=limit, + offset=offset, + payee=payee, + payer=payer, + wallets=wallets, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + limit: Union[Unset, int] = UNSET, + offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Optional[PaginatedTransactionList]: + """ + Args: + limit (Union[Unset, int]): + offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + PaginatedTransactionList + """ + + return ( + await asyncio_detailed( + client=client, + limit=limit, + offset=offset, + payee=payee, + payer=payer, + wallets=wallets, + ) + ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_application_transactions_retrieve.py similarity index 75% rename from gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve.py rename to gooyal_wallet_client/api/wallet/wallet_api_application_transactions_retrieve.py index 2062248..1939f25 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_transactions_retrieve.py @@ -1,28 +1,29 @@ from http import HTTPStatus from typing import Any, Optional, Union +from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.my_wallet import MyWallet +from ...models.transaction import Transaction from ...types import Response def _get_kwargs( - uuid: str, + uuid: UUID, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/wallet/api/application/user_balance/{uuid}", + "url": f"/wallet/api/application/transactions/{uuid}/", } return _kwargs -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MyWallet]: +def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Transaction]: if response.status_code == 200: - response_200 = MyWallet.from_dict(response.json()) + response_200 = Transaction.from_dict(response.json()) return response_200 @@ -32,7 +33,7 @@ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: htt return None -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MyWallet]: +def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Transaction]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -42,21 +43,20 @@ def _build_response(*, client: Union[AuthenticatedClient, Client], response: htt def sync_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting specified user or application balance. - +) -> Response[Transaction]: + """ Args: - uuid (str): + uuid (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[MyWallet] + Response[Transaction] """ kwargs = _get_kwargs( @@ -71,21 +71,20 @@ def sync_detailed( def sync( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting specified user or application balance. - +) -> Optional[Transaction]: + """ Args: - uuid (str): + uuid (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - MyWallet + Transaction """ return sync_detailed( @@ -95,21 +94,20 @@ def sync( async def asyncio_detailed( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting specified user or application balance. - +) -> Response[Transaction]: + """ Args: - uuid (str): + uuid (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[MyWallet] + Response[Transaction] """ kwargs = _get_kwargs( @@ -122,21 +120,20 @@ async def asyncio_detailed( async def asyncio( - uuid: str, + uuid: UUID, *, client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting specified user or application balance. - +) -> Optional[Transaction]: + """ Args: - uuid (str): + uuid (UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - MyWallet + Transaction """ return ( diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve_2.py deleted file mode 100644 index f77f03f..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_user_balance_retrieve_2.py +++ /dev/null @@ -1,160 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.my_wallet import MyWallet -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{category_uuid}/user/{uuid}/balance", - } - - return _kwargs - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MyWallet]: - if response.status_code == 200: - response_200 = MyWallet.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MyWallet]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return sync_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting specified user or application balance. - - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_list.py b/gooyal_wallet_client/api/wallet/wallet_api_application_wallets_list.py similarity index 82% rename from gooyal_wallet_client/api/wallet/wallet_api_application_list.py rename to gooyal_wallet_client/api/wallet/wallet_api_application_wallets_list.py index b3c7624..9d5a57b 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_list.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_wallets_list.py @@ -5,7 +5,7 @@ import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.paginated_application_transaction_list import PaginatedApplicationTransactionList +from ...models.paginated_account_list import PaginatedAccountList from ...types import UNSET, Response, Unset @@ -24,7 +24,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": "/wallet/api/application/", + "url": "/wallet/api/application/wallets/", "params": params, } @@ -33,9 +33,9 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PaginatedApplicationTransactionList]: +) -> Optional[PaginatedAccountList]: if response.status_code == 200: - response_200 = PaginatedApplicationTransactionList.from_dict(response.json()) + response_200 = PaginatedAccountList.from_dict(response.json()) return response_200 @@ -47,7 +47,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[PaginatedApplicationTransactionList]: +) -> Response[PaginatedAccountList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,8 +61,9 @@ def sync_detailed( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedApplicationTransactionList]: - """ +) -> Response[PaginatedAccountList]: + """API for getting specified user or application balance. + Args: limit (Union[Unset, int]): offset (Union[Unset, int]): @@ -72,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedApplicationTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( @@ -92,8 +93,9 @@ def sync( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedApplicationTransactionList]: - """ +) -> Optional[PaginatedAccountList]: + """API for getting specified user or application balance. + Args: limit (Union[Unset, int]): offset (Union[Unset, int]): @@ -103,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedApplicationTransactionList + PaginatedAccountList """ return sync_detailed( @@ -118,8 +120,9 @@ async def asyncio_detailed( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedApplicationTransactionList]: - """ +) -> Response[PaginatedAccountList]: + """API for getting specified user or application balance. + Args: limit (Union[Unset, int]): offset (Union[Unset, int]): @@ -129,7 +132,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedApplicationTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( @@ -147,8 +150,9 @@ async def asyncio( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedApplicationTransactionList]: - """ +) -> Optional[PaginatedAccountList]: + """API for getting specified user or application balance. + Args: limit (Union[Unset, int]): offset (Union[Unset, int]): @@ -158,7 +162,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedApplicationTransactionList + PaginatedAccountList """ return ( diff --git a/gooyal_wallet_client/api/wallet/wallet_api_user_transactions_list.py b/gooyal_wallet_client/api/wallet/wallet_api_application_wallets_user_list.py similarity index 64% rename from gooyal_wallet_client/api/wallet/wallet_api_user_transactions_list.py rename to gooyal_wallet_client/api/wallet/wallet_api_application_wallets_user_list.py index 50cbc86..54d843e 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_user_transactions_list.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_wallets_user_list.py @@ -1,19 +1,21 @@ from http import HTTPStatus from typing import Any, Optional, Union +from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.paginated_user_transaction_list import PaginatedUserTransactionList +from ...models.paginated_account_list import PaginatedAccountList from ...types import UNSET, Response, Unset def _get_kwargs( - category_uuid: str, + owner: str, *, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, + wallet: list[UUID], ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -21,11 +23,18 @@ def _get_kwargs( params["offset"] = offset + json_wallet = [] + for wallet_item_data in wallet: + wallet_item = str(wallet_item_data) + json_wallet.append(wallet_item) + + params["wallet"] = json_wallet + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { "method": "get", - "url": f"/wallet/api/user/{category_uuid}/transactions/", + "url": f"/wallet/api/application/wallets/user/{owner}/", "params": params, } @@ -34,9 +43,9 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PaginatedUserTransactionList]: +) -> Optional[PaginatedAccountList]: if response.status_code == 200: - response_200 = PaginatedUserTransactionList.from_dict(response.json()) + response_200 = PaginatedAccountList.from_dict(response.json()) return response_200 @@ -48,7 +57,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[PaginatedUserTransactionList]: +) -> Response[PaginatedAccountList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,35 +67,34 @@ def _build_response( def sync_detailed( - category_uuid: str, + owner: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedUserTransactionList]: - """GET: API for getting list of transactions for authenticated user - POST: API for creating transaction for transferring funds from authenticated user to application - owner. (deprecated) - args: - - user: authenticated user + wallet: list[UUID], +) -> Response[PaginatedAccountList]: + """API for getting specified user wallet. Args: - category_uuid (str): + owner (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedUserTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( - category_uuid=category_uuid, + owner=owner, limit=limit, offset=offset, + wallet=wallet, ) response = client.get_httpx_client().request( @@ -97,69 +105,67 @@ def sync_detailed( def sync( - category_uuid: str, + owner: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedUserTransactionList]: - """GET: API for getting list of transactions for authenticated user - POST: API for creating transaction for transferring funds from authenticated user to application - owner. (deprecated) - args: - - user: authenticated user + wallet: list[UUID], +) -> Optional[PaginatedAccountList]: + """API for getting specified user wallet. Args: - category_uuid (str): + owner (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedUserTransactionList + PaginatedAccountList """ return sync_detailed( - category_uuid=category_uuid, + owner=owner, client=client, limit=limit, offset=offset, + wallet=wallet, ).parsed async def asyncio_detailed( - category_uuid: str, + owner: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedUserTransactionList]: - """GET: API for getting list of transactions for authenticated user - POST: API for creating transaction for transferring funds from authenticated user to application - owner. (deprecated) - args: - - user: authenticated user + wallet: list[UUID], +) -> Response[PaginatedAccountList]: + """API for getting specified user wallet. Args: - category_uuid (str): + owner (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedUserTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( - category_uuid=category_uuid, + owner=owner, limit=limit, offset=offset, + wallet=wallet, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -168,36 +174,35 @@ async def asyncio_detailed( async def asyncio( - category_uuid: str, + owner: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedUserTransactionList]: - """GET: API for getting list of transactions for authenticated user - POST: API for creating transaction for transferring funds from authenticated user to application - owner. (deprecated) - args: - - user: authenticated user + wallet: list[UUID], +) -> Optional[PaginatedAccountList]: + """API for getting specified user wallet. Args: - category_uuid (str): + owner (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedUserTransactionList + PaginatedAccountList """ return ( await asyncio_detailed( - category_uuid=category_uuid, + owner=owner, client=client, limit=limit, offset=offset, + wallet=wallet, ) ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create.py b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create.py index 3853436..74d6944 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create.py @@ -10,6 +10,7 @@ from ...types import Response def _get_kwargs( + payee_wallet: str, *, body: ApplicationWithdraw, ) -> dict[str, Any]: @@ -17,7 +18,7 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": "/wallet/api/application/withdraw/", + "url": f"/wallet/api/application/{payee_wallet}/withdraw/", } _kwargs["json"] = body.to_dict() @@ -54,12 +55,14 @@ def _build_response( def sync_detailed( + payee_wallet: str, *, client: AuthenticatedClient, body: ApplicationWithdraw, ) -> Response[ApplicationWithdraw]: """ Args: + payee_wallet (str): body (ApplicationWithdraw): Raises: @@ -71,6 +74,7 @@ def sync_detailed( """ kwargs = _get_kwargs( + payee_wallet=payee_wallet, body=body, ) @@ -82,12 +86,14 @@ def sync_detailed( def sync( + payee_wallet: str, *, client: AuthenticatedClient, body: ApplicationWithdraw, ) -> Optional[ApplicationWithdraw]: """ Args: + payee_wallet (str): body (ApplicationWithdraw): Raises: @@ -99,18 +105,21 @@ def sync( """ return sync_detailed( + payee_wallet=payee_wallet, client=client, body=body, ).parsed async def asyncio_detailed( + payee_wallet: str, *, client: AuthenticatedClient, body: ApplicationWithdraw, ) -> Response[ApplicationWithdraw]: """ Args: + payee_wallet (str): body (ApplicationWithdraw): Raises: @@ -122,6 +131,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( + payee_wallet=payee_wallet, body=body, ) @@ -131,12 +141,14 @@ async def asyncio_detailed( async def asyncio( + payee_wallet: str, *, client: AuthenticatedClient, body: ApplicationWithdraw, ) -> Optional[ApplicationWithdraw]: """ Args: + payee_wallet (str): body (ApplicationWithdraw): Raises: @@ -149,6 +161,7 @@ async def asyncio( return ( await asyncio_detailed( + payee_wallet=payee_wallet, client=client, body=body, ) diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create_2.py deleted file mode 100644 index f4b42ac..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_create_2.py +++ /dev/null @@ -1,168 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_withdraw import ApplicationWithdraw -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - *, - body: ApplicationWithdraw, -) -> dict[str, Any]: - headers: dict[str, Any] = {} - - _kwargs: dict[str, Any] = { - "method": "post", - "url": f"/wallet/api/application/{category_uuid}/withdraw/", - } - - _kwargs["json"] = body.to_dict() - - headers["Content-Type"] = "application/json" - - _kwargs["headers"] = headers - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationWithdraw]: - if response.status_code == 201: - response_201 = ApplicationWithdraw.from_dict(response.json()) - - return response_201 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationWithdraw]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationWithdraw, -) -> Response[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - body (ApplicationWithdraw): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationWithdraw] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - body=body, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationWithdraw, -) -> Optional[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - body (ApplicationWithdraw): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationWithdraw - """ - - return sync_detailed( - category_uuid=category_uuid, - client=client, - body=body, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationWithdraw, -) -> Response[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - body (ApplicationWithdraw): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationWithdraw] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - body=body, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - *, - client: AuthenticatedClient, - body: ApplicationWithdraw, -) -> Optional[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - body (ApplicationWithdraw): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationWithdraw - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - client=client, - body=body, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve.py index dd57a27..757b597 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve.py @@ -10,11 +10,12 @@ from ...types import Response def _get_kwargs( + payee_wallet: str, uuid: str, ) -> dict[str, Any]: _kwargs: dict[str, Any] = { "method": "get", - "url": f"/wallet/api/application/withdraw/{uuid}/verify", + "url": f"/wallet/api/application/{payee_wallet}/withdraw/{uuid}/verify", } return _kwargs @@ -46,12 +47,14 @@ def _build_response( def sync_detailed( + payee_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Response[ApplicationWithdraw]: """ Args: + payee_wallet (str): uuid (str): Raises: @@ -63,6 +66,7 @@ def sync_detailed( """ kwargs = _get_kwargs( + payee_wallet=payee_wallet, uuid=uuid, ) @@ -74,12 +78,14 @@ def sync_detailed( def sync( + payee_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Optional[ApplicationWithdraw]: """ Args: + payee_wallet (str): uuid (str): Raises: @@ -91,18 +97,21 @@ def sync( """ return sync_detailed( + payee_wallet=payee_wallet, uuid=uuid, client=client, ).parsed async def asyncio_detailed( + payee_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Response[ApplicationWithdraw]: """ Args: + payee_wallet (str): uuid (str): Raises: @@ -114,6 +123,7 @@ async def asyncio_detailed( """ kwargs = _get_kwargs( + payee_wallet=payee_wallet, uuid=uuid, ) @@ -123,12 +133,14 @@ async def asyncio_detailed( async def asyncio( + payee_wallet: str, uuid: str, *, client: AuthenticatedClient, ) -> Optional[ApplicationWithdraw]: """ Args: + payee_wallet (str): uuid (str): Raises: @@ -141,6 +153,7 @@ async def asyncio( return ( await asyncio_detailed( + payee_wallet=payee_wallet, uuid=uuid, client=client, ) diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve_2.py b/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve_2.py deleted file mode 100644 index 651a764..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_withdraw_verify_retrieve_2.py +++ /dev/null @@ -1,160 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.application_withdraw import ApplicationWithdraw -from ...types import Response - - -def _get_kwargs( - category_uuid: str, - uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/application/{category_uuid}/withdraw/{uuid}/verify", - } - - return _kwargs - - -def _parse_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[ApplicationWithdraw]: - if response.status_code == 200: - response_200 = ApplicationWithdraw.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response( - *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[ApplicationWithdraw]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationWithdraw] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationWithdraw - """ - - return sync_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Response[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[ApplicationWithdraw] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - uuid=uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[ApplicationWithdraw]: - """ - Args: - category_uuid (str): - uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - ApplicationWithdraw - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - uuid=uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_transactions_list.py b/gooyal_wallet_client/api/wallet/wallet_api_transactions_list.py index 7880004..328df18 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_transactions_list.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_transactions_list.py @@ -1,11 +1,12 @@ from http import HTTPStatus from typing import Any, Optional, Union +from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.paginated_user_transaction_list import PaginatedUserTransactionList +from ...models.paginated_transaction_list import PaginatedTransactionList from ...types import UNSET, Response, Unset @@ -13,6 +14,9 @@ def _get_kwargs( *, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -20,6 +24,23 @@ def _get_kwargs( params["offset"] = offset + json_payee: Union[Unset, str] = UNSET + if not isinstance(payee, Unset): + json_payee = str(payee) + params["payee"] = json_payee + + json_payer: Union[Unset, str] = UNSET + if not isinstance(payer, Unset): + json_payer = str(payer) + params["payer"] = json_payer + + json_wallets = [] + for wallets_item_data in wallets: + wallets_item = str(wallets_item_data) + json_wallets.append(wallets_item) + + params["wallets"] = json_wallets + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { @@ -33,9 +54,9 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PaginatedUserTransactionList]: +) -> Optional[PaginatedTransactionList]: if response.status_code == 200: - response_200 = PaginatedUserTransactionList.from_dict(response.json()) + response_200 = PaginatedTransactionList.from_dict(response.json()) return response_200 @@ -47,7 +68,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[PaginatedUserTransactionList]: +) -> Response[PaginatedTransactionList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -61,7 +82,10 @@ def sync_detailed( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedUserTransactionList]: + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Response[PaginatedTransactionList]: """GET: API for getting list of transactions for authenticated user POST: API for creating transaction for transferring funds from authenticated user to application owner. (deprecated) @@ -71,18 +95,24 @@ def sync_detailed( Args: limit (Union[Unset, int]): offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedUserTransactionList] + Response[PaginatedTransactionList] """ kwargs = _get_kwargs( limit=limit, offset=offset, + payee=payee, + payer=payer, + wallets=wallets, ) response = client.get_httpx_client().request( @@ -97,7 +127,10 @@ def sync( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedUserTransactionList]: + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Optional[PaginatedTransactionList]: """GET: API for getting list of transactions for authenticated user POST: API for creating transaction for transferring funds from authenticated user to application owner. (deprecated) @@ -107,19 +140,25 @@ def sync( Args: limit (Union[Unset, int]): offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedUserTransactionList + PaginatedTransactionList """ return sync_detailed( client=client, limit=limit, offset=offset, + payee=payee, + payer=payer, + wallets=wallets, ).parsed @@ -128,7 +167,10 @@ async def asyncio_detailed( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedUserTransactionList]: + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Response[PaginatedTransactionList]: """GET: API for getting list of transactions for authenticated user POST: API for creating transaction for transferring funds from authenticated user to application owner. (deprecated) @@ -138,18 +180,24 @@ async def asyncio_detailed( Args: limit (Union[Unset, int]): offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedUserTransactionList] + Response[PaginatedTransactionList] """ kwargs = _get_kwargs( limit=limit, offset=offset, + payee=payee, + payer=payer, + wallets=wallets, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -162,7 +210,10 @@ async def asyncio( client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedUserTransactionList]: + payee: Union[Unset, UUID] = UNSET, + payer: Union[Unset, UUID] = UNSET, + wallets: list[UUID], +) -> Optional[PaginatedTransactionList]: """GET: API for getting list of transactions for authenticated user POST: API for creating transaction for transferring funds from authenticated user to application owner. (deprecated) @@ -172,13 +223,16 @@ async def asyncio( Args: limit (Union[Unset, int]): offset (Union[Unset, int]): + payee (Union[Unset, UUID]): + payer (Union[Unset, UUID]): + wallets (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedUserTransactionList + PaginatedTransactionList """ return ( @@ -186,5 +240,8 @@ async def asyncio( client=client, limit=limit, offset=offset, + payee=payee, + payer=payer, + wallets=wallets, ) ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_user_balance_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_user_balance_retrieve.py deleted file mode 100644 index 2928286..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_user_balance_retrieve.py +++ /dev/null @@ -1,147 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.my_wallet import MyWallet -from ...types import Response - - -def _get_kwargs( - category_uuid: str, -) -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": f"/wallet/api/user/{category_uuid}/balance", - } - - return _kwargs - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MyWallet]: - if response.status_code == 200: - response_200 = MyWallet.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MyWallet]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting authenticated user balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - ) - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting authenticated user balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return sync_detailed( - category_uuid=category_uuid, - client=client, - ).parsed - - -async def asyncio_detailed( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting authenticated user balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs( - category_uuid=category_uuid, - ) - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - category_uuid: str, - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting authenticated user balance. - - Args: - category_uuid (str): - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return ( - await asyncio_detailed( - category_uuid=category_uuid, - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_wallet_balance_retrieve.py b/gooyal_wallet_client/api/wallet/wallet_api_wallet_balance_retrieve.py deleted file mode 100644 index 5a5e38d..0000000 --- a/gooyal_wallet_client/api/wallet/wallet_api_wallet_balance_retrieve.py +++ /dev/null @@ -1,123 +0,0 @@ -from http import HTTPStatus -from typing import Any, Optional, Union - -import httpx - -from ... import errors -from ...client import AuthenticatedClient, Client -from ...models.my_wallet import MyWallet -from ...types import Response - - -def _get_kwargs() -> dict[str, Any]: - _kwargs: dict[str, Any] = { - "method": "get", - "url": "/wallet/api/wallet/balance", - } - - return _kwargs - - -def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[MyWallet]: - if response.status_code == 200: - response_200 = MyWallet.from_dict(response.json()) - - return response_200 - - if client.raise_on_unexpected_status: - raise errors.UnexpectedStatus(response.status_code, response.content) - else: - return None - - -def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[MyWallet]: - return Response( - status_code=HTTPStatus(response.status_code), - content=response.content, - headers=response.headers, - parsed=_parse_response(client=client, response=response), - ) - - -def sync_detailed( - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting authenticated user balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs() - - response = client.get_httpx_client().request( - **kwargs, - ) - - return _build_response(client=client, response=response) - - -def sync( - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting authenticated user balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return sync_detailed( - client=client, - ).parsed - - -async def asyncio_detailed( - *, - client: AuthenticatedClient, -) -> Response[MyWallet]: - """API for getting authenticated user balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - Response[MyWallet] - """ - - kwargs = _get_kwargs() - - response = await client.get_async_httpx_client().request(**kwargs) - - return _build_response(client=client, response=response) - - -async def asyncio( - *, - client: AuthenticatedClient, -) -> Optional[MyWallet]: - """API for getting authenticated user balance. - - Raises: - errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. - httpx.TimeoutException: If the request takes longer than Client.timeout. - - Returns: - MyWallet - """ - - return ( - await asyncio_detailed( - client=client, - ) - ).parsed diff --git a/gooyal_wallet_client/api/wallet/wallet_api_application_list_2.py b/gooyal_wallet_client/api/wallet/wallet_api_wallets_list.py similarity index 74% rename from gooyal_wallet_client/api/wallet/wallet_api_application_list_2.py rename to gooyal_wallet_client/api/wallet/wallet_api_wallets_list.py index 84cbf49..f406ae8 100644 --- a/gooyal_wallet_client/api/wallet/wallet_api_application_list_2.py +++ b/gooyal_wallet_client/api/wallet/wallet_api_wallets_list.py @@ -1,19 +1,20 @@ from http import HTTPStatus from typing import Any, Optional, Union +from uuid import UUID import httpx from ... import errors from ...client import AuthenticatedClient, Client -from ...models.paginated_application_transaction_list import PaginatedApplicationTransactionList +from ...models.paginated_account_list import PaginatedAccountList from ...types import UNSET, Response, Unset def _get_kwargs( - category_uuid: str, *, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, + wallet: list[UUID], ) -> dict[str, Any]: params: dict[str, Any] = {} @@ -21,11 +22,18 @@ def _get_kwargs( params["offset"] = offset + json_wallet = [] + for wallet_item_data in wallet: + wallet_item = str(wallet_item_data) + json_wallet.append(wallet_item) + + params["wallet"] = json_wallet + params = {k: v for k, v in params.items() if v is not UNSET and v is not None} _kwargs: dict[str, Any] = { "method": "get", - "url": f"/wallet/api/application/{category_uuid}/", + "url": "/wallet/api/wallets/", "params": params, } @@ -34,9 +42,9 @@ def _get_kwargs( def _parse_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Optional[PaginatedApplicationTransactionList]: +) -> Optional[PaginatedAccountList]: if response.status_code == 200: - response_200 = PaginatedApplicationTransactionList.from_dict(response.json()) + response_200 = PaginatedAccountList.from_dict(response.json()) return response_200 @@ -48,7 +56,7 @@ def _parse_response( def _build_response( *, client: Union[AuthenticatedClient, Client], response: httpx.Response -) -> Response[PaginatedApplicationTransactionList]: +) -> Response[PaginatedAccountList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -58,30 +66,31 @@ def _build_response( def sync_detailed( - category_uuid: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedApplicationTransactionList]: - """ + wallet: list[UUID], +) -> Response[PaginatedAccountList]: + """API for getting authenticated user balance. + Args: - category_uuid (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedApplicationTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( - category_uuid=category_uuid, limit=limit, offset=offset, + wallet=wallet, ) response = client.get_httpx_client().request( @@ -92,59 +101,61 @@ def sync_detailed( def sync( - category_uuid: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedApplicationTransactionList]: - """ + wallet: list[UUID], +) -> Optional[PaginatedAccountList]: + """API for getting authenticated user balance. + Args: - category_uuid (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedApplicationTransactionList + PaginatedAccountList """ return sync_detailed( - category_uuid=category_uuid, client=client, limit=limit, offset=offset, + wallet=wallet, ).parsed async def asyncio_detailed( - category_uuid: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Response[PaginatedApplicationTransactionList]: - """ + wallet: list[UUID], +) -> Response[PaginatedAccountList]: + """API for getting authenticated user balance. + Args: - category_uuid (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[PaginatedApplicationTransactionList] + Response[PaginatedAccountList] """ kwargs = _get_kwargs( - category_uuid=category_uuid, limit=limit, offset=offset, + wallet=wallet, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -153,31 +164,32 @@ async def asyncio_detailed( async def asyncio( - category_uuid: str, *, client: AuthenticatedClient, limit: Union[Unset, int] = UNSET, offset: Union[Unset, int] = UNSET, -) -> Optional[PaginatedApplicationTransactionList]: - """ + wallet: list[UUID], +) -> Optional[PaginatedAccountList]: + """API for getting authenticated user balance. + Args: - category_uuid (str): limit (Union[Unset, int]): offset (Union[Unset, int]): + wallet (list[UUID]): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - PaginatedApplicationTransactionList + PaginatedAccountList """ return ( await asyncio_detailed( - category_uuid=category_uuid, client=client, limit=limit, offset=offset, + wallet=wallet, ) ).parsed diff --git a/gooyal_wallet_client/models/__init__.py b/gooyal_wallet_client/models/__init__.py index 06a7b4a..4d9841d 100644 --- a/gooyal_wallet_client/models/__init__.py +++ b/gooyal_wallet_client/models/__init__.py @@ -1,25 +1,19 @@ """Contains all the data models used in inputs/outputs""" -from .application_balance import ApplicationBalance +from .account import Account from .application_deposit import ApplicationDeposit -from .application_transaction import ApplicationTransaction from .application_withdraw import ApplicationWithdraw -from .charge import Charge -from .my_wallet import MyWallet -from .paginated_application_transaction_list import PaginatedApplicationTransactionList -from .paginated_user_transaction_list import PaginatedUserTransactionList +from .paginated_account_list import PaginatedAccountList +from .paginated_transaction_list import PaginatedTransactionList from .state_enum import StateEnum -from .user_transaction import UserTransaction +from .transaction import Transaction __all__ = ( - "ApplicationBalance", + "Account", "ApplicationDeposit", - "ApplicationTransaction", "ApplicationWithdraw", - "Charge", - "MyWallet", - "PaginatedApplicationTransactionList", - "PaginatedUserTransactionList", + "PaginatedAccountList", + "PaginatedTransactionList", "StateEnum", - "UserTransaction", + "Transaction", ) diff --git a/gooyal_wallet_client/models/application_balance.py b/gooyal_wallet_client/models/account.py similarity index 53% rename from gooyal_wallet_client/models/application_balance.py rename to gooyal_wallet_client/models/account.py index 3ae824e..25b08bb 100644 --- a/gooyal_wallet_client/models/application_balance.py +++ b/gooyal_wallet_client/models/account.py @@ -1,32 +1,45 @@ from collections.abc import Mapping -from typing import Any, TypeVar, Union +from typing import Any, TypeVar, Union, cast +from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field from ..types import UNSET, Unset -T = TypeVar("T", bound="ApplicationBalance") +T = TypeVar("T", bound="Account") @_attrs_define -class ApplicationBalance: +class Account: """ Attributes: balance (Union[Unset, int]): + wallet (Union[None, UUID, Unset]): """ balance: Union[Unset, int] = UNSET + wallet: Union[None, UUID, Unset] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: balance = self.balance + wallet: Union[None, Unset, str] + if isinstance(self.wallet, Unset): + wallet = UNSET + elif isinstance(self.wallet, UUID): + wallet = str(self.wallet) + else: + wallet = self.wallet + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) if balance is not UNSET: field_dict["balance"] = balance + if wallet is not UNSET: + field_dict["wallet"] = wallet return field_dict @@ -35,12 +48,30 @@ class ApplicationBalance: d = dict(src_dict) balance = d.pop("balance", UNSET) - application_balance = cls( + def _parse_wallet(data: object) -> Union[None, UUID, Unset]: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + wallet_type_0 = UUID(data) + + return wallet_type_0 + except: # noqa: E722 + pass + return cast(Union[None, UUID, Unset], data) + + wallet = _parse_wallet(d.pop("wallet", UNSET)) + + account = cls( balance=balance, + wallet=wallet, ) - application_balance.additional_properties = d - return application_balance + account.additional_properties = d + return account @property def additional_keys(self) -> list[str]: diff --git a/gooyal_wallet_client/models/application_deposit.py b/gooyal_wallet_client/models/application_deposit.py index 9d1772f..71fb885 100644 --- a/gooyal_wallet_client/models/application_deposit.py +++ b/gooyal_wallet_client/models/application_deposit.py @@ -17,10 +17,12 @@ T = TypeVar("T", bound="ApplicationDeposit") class ApplicationDeposit: """ Attributes: - payer_id (str): + payer (str): payer_type (str): - payee_id (UUID): + payer_wallet (UUID): + payee (UUID): payee_type (int): + payee_wallet (UUID): created_at (datetime.datetime): state (StateEnum): * `1` - created * `2` - delayed @@ -35,10 +37,12 @@ class ApplicationDeposit: details (Union[Unset, Any]): """ - payer_id: str + payer: str payer_type: str - payee_id: UUID + payer_wallet: UUID + payee: UUID payee_type: int + payee_wallet: UUID created_at: datetime.datetime state: StateEnum amount: int @@ -48,14 +52,18 @@ class ApplicationDeposit: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - payer_id = self.payer_id + payer = self.payer payer_type = self.payer_type - payee_id = str(self.payee_id) + payer_wallet = str(self.payer_wallet) + + payee = str(self.payee) payee_type = self.payee_type + payee_wallet = str(self.payee_wallet) + created_at = self.created_at.isoformat() state = self.state.value @@ -74,10 +82,12 @@ class ApplicationDeposit: field_dict.update(self.additional_properties) field_dict.update( { - "payer_id": payer_id, + "payer": payer, "payer_type": payer_type, - "payee_id": payee_id, + "payer_wallet": payer_wallet, + "payee": payee, "payee_type": payee_type, + "payee_wallet": payee_wallet, "created_at": created_at, "state": state, "amount": amount, @@ -94,14 +104,18 @@ class ApplicationDeposit: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - payer_id = d.pop("payer_id") + payer = d.pop("payer") payer_type = d.pop("payer_type") - payee_id = UUID(d.pop("payee_id")) + payer_wallet = UUID(d.pop("payer_wallet")) + + payee = UUID(d.pop("payee")) payee_type = d.pop("payee_type") + payee_wallet = UUID(d.pop("payee_wallet")) + created_at = isoparse(d.pop("created_at")) state = StateEnum(d.pop("state")) @@ -120,10 +134,12 @@ class ApplicationDeposit: details = d.pop("details", UNSET) application_deposit = cls( - payer_id=payer_id, + payer=payer, payer_type=payer_type, - payee_id=payee_id, + payer_wallet=payer_wallet, + payee=payee, payee_type=payee_type, + payee_wallet=payee_wallet, created_at=created_at, state=state, amount=amount, diff --git a/gooyal_wallet_client/models/application_transaction.py b/gooyal_wallet_client/models/application_transaction.py deleted file mode 100644 index f504cbc..0000000 --- a/gooyal_wallet_client/models/application_transaction.py +++ /dev/null @@ -1,160 +0,0 @@ -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, Union -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..models.state_enum import StateEnum -from ..types import UNSET, Unset - -T = TypeVar("T", bound="ApplicationTransaction") - - -@_attrs_define -class ApplicationTransaction: - """ - Attributes: - uuid (UUID): - payer_id (str): - payer_type (str): - payee_id (UUID): - payee_type (UUID): - created_at (datetime.datetime): - state (StateEnum): * `1` - created - * `2` - delayed - * `3` - pending - * `4` - incomplete - * `5` - success - * `6` - failed - * `7` - expected_failure - amount (int): - updated_at (datetime.datetime): - details (Any): - role (str): - delay (Union[Unset, int]): - """ - - uuid: UUID - payer_id: str - payer_type: str - payee_id: UUID - payee_type: UUID - created_at: datetime.datetime - state: StateEnum - amount: int - updated_at: datetime.datetime - details: Any - role: str - delay: Union[Unset, int] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - uuid = str(self.uuid) - - payer_id = self.payer_id - - payer_type = self.payer_type - - payee_id = str(self.payee_id) - - payee_type = str(self.payee_type) - - created_at = self.created_at.isoformat() - - state = self.state.value - - amount = self.amount - - updated_at = self.updated_at.isoformat() - - details = self.details - - role = self.role - - delay = self.delay - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "uuid": uuid, - "payer_id": payer_id, - "payer_type": payer_type, - "payee_id": payee_id, - "payee_type": payee_type, - "created_at": created_at, - "state": state, - "amount": amount, - "updated_at": updated_at, - "details": details, - "role": role, - } - ) - if delay is not UNSET: - field_dict["delay"] = delay - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - uuid = UUID(d.pop("uuid")) - - payer_id = d.pop("payer_id") - - payer_type = d.pop("payer_type") - - payee_id = UUID(d.pop("payee_id")) - - payee_type = UUID(d.pop("payee_type")) - - created_at = isoparse(d.pop("created_at")) - - state = StateEnum(d.pop("state")) - - amount = d.pop("amount") - - updated_at = isoparse(d.pop("updated_at")) - - details = d.pop("details") - - role = d.pop("role") - - delay = d.pop("delay", UNSET) - - application_transaction = cls( - uuid=uuid, - payer_id=payer_id, - payer_type=payer_type, - payee_id=payee_id, - payee_type=payee_type, - created_at=created_at, - state=state, - amount=amount, - updated_at=updated_at, - details=details, - role=role, - delay=delay, - ) - - application_transaction.additional_properties = d - return application_transaction - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/gooyal_wallet_client/models/application_withdraw.py b/gooyal_wallet_client/models/application_withdraw.py index 3470f5a..3ddd5b4 100644 --- a/gooyal_wallet_client/models/application_withdraw.py +++ b/gooyal_wallet_client/models/application_withdraw.py @@ -17,10 +17,12 @@ T = TypeVar("T", bound="ApplicationWithdraw") class ApplicationWithdraw: """ Attributes: - payer_id (UUID): + payer (UUID): payer_type (int): - payee_id (str): + payer_wallet (UUID): + payee (str): payee_type (str): + payee_wallet (UUID): created_at (datetime.datetime): state (StateEnum): * `1` - created * `2` - delayed @@ -35,10 +37,12 @@ class ApplicationWithdraw: details (Union[Unset, Any]): """ - payer_id: UUID + payer: UUID payer_type: int - payee_id: str + payer_wallet: UUID + payee: str payee_type: str + payee_wallet: UUID created_at: datetime.datetime state: StateEnum amount: int @@ -48,14 +52,18 @@ class ApplicationWithdraw: additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - payer_id = str(self.payer_id) + payer = str(self.payer) payer_type = self.payer_type - payee_id = self.payee_id + payer_wallet = str(self.payer_wallet) + + payee = self.payee payee_type = self.payee_type + payee_wallet = str(self.payee_wallet) + created_at = self.created_at.isoformat() state = self.state.value @@ -74,10 +82,12 @@ class ApplicationWithdraw: field_dict.update(self.additional_properties) field_dict.update( { - "payer_id": payer_id, + "payer": payer, "payer_type": payer_type, - "payee_id": payee_id, + "payer_wallet": payer_wallet, + "payee": payee, "payee_type": payee_type, + "payee_wallet": payee_wallet, "created_at": created_at, "state": state, "amount": amount, @@ -94,14 +104,18 @@ class ApplicationWithdraw: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - payer_id = UUID(d.pop("payer_id")) + payer = UUID(d.pop("payer")) payer_type = d.pop("payer_type") - payee_id = d.pop("payee_id") + payer_wallet = UUID(d.pop("payer_wallet")) + + payee = d.pop("payee") payee_type = d.pop("payee_type") + payee_wallet = UUID(d.pop("payee_wallet")) + created_at = isoparse(d.pop("created_at")) state = StateEnum(d.pop("state")) @@ -120,10 +134,12 @@ class ApplicationWithdraw: details = d.pop("details", UNSET) application_withdraw = cls( - payer_id=payer_id, + payer=payer, payer_type=payer_type, - payee_id=payee_id, + payer_wallet=payer_wallet, + payee=payee, payee_type=payee_type, + payee_wallet=payee_wallet, created_at=created_at, state=state, amount=amount, diff --git a/gooyal_wallet_client/models/charge.py b/gooyal_wallet_client/models/charge.py deleted file mode 100644 index 25301fb..0000000 --- a/gooyal_wallet_client/models/charge.py +++ /dev/null @@ -1,150 +0,0 @@ -import datetime -from collections.abc import Mapping -from typing import Any, TypeVar, Union, cast -from uuid import UUID - -from attrs import define as _attrs_define -from attrs import field as _attrs_field -from dateutil.parser import isoparse - -from ..models.state_enum import StateEnum - -T = TypeVar("T", bound="Charge") - - -@_attrs_define -class Charge: - """ - Attributes: - uuid (UUID): - user (UUID): - created_at (Union[None, datetime.datetime]): - state (StateEnum): * `1` - created - * `2` - delayed - * `3` - pending - * `4` - incomplete - * `5` - success - * `6` - failed - * `7` - expected_failure - amount (Union[None, int]): - updated_at (Union[None, datetime.datetime]): - """ - - uuid: UUID - user: UUID - created_at: Union[None, datetime.datetime] - state: StateEnum - amount: Union[None, int] - updated_at: Union[None, datetime.datetime] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - uuid = str(self.uuid) - - user = str(self.user) - - created_at: Union[None, str] - if isinstance(self.created_at, datetime.datetime): - created_at = self.created_at.isoformat() - else: - created_at = self.created_at - - state = self.state.value - - amount: Union[None, int] - amount = self.amount - - updated_at: Union[None, str] - if isinstance(self.updated_at, datetime.datetime): - updated_at = self.updated_at.isoformat() - else: - updated_at = self.updated_at - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "uuid": uuid, - "user": user, - "created_at": created_at, - "state": state, - "amount": amount, - "updated_at": updated_at, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - uuid = UUID(d.pop("uuid")) - - user = UUID(d.pop("user")) - - def _parse_created_at(data: object) -> Union[None, datetime.datetime]: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - created_at_type_0 = isoparse(data) - - return created_at_type_0 - except: # noqa: E722 - pass - return cast(Union[None, datetime.datetime], data) - - created_at = _parse_created_at(d.pop("created_at")) - - state = StateEnum(d.pop("state")) - - def _parse_amount(data: object) -> Union[None, int]: - if data is None: - return data - return cast(Union[None, int], data) - - amount = _parse_amount(d.pop("amount")) - - def _parse_updated_at(data: object) -> Union[None, datetime.datetime]: - if data is None: - return data - try: - if not isinstance(data, str): - raise TypeError() - updated_at_type_0 = isoparse(data) - - return updated_at_type_0 - except: # noqa: E722 - pass - return cast(Union[None, datetime.datetime], data) - - updated_at = _parse_updated_at(d.pop("updated_at")) - - charge = cls( - uuid=uuid, - user=user, - created_at=created_at, - state=state, - amount=amount, - updated_at=updated_at, - ) - - charge.additional_properties = d - return charge - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/gooyal_wallet_client/models/my_wallet.py b/gooyal_wallet_client/models/my_wallet.py deleted file mode 100644 index e76505d..0000000 --- a/gooyal_wallet_client/models/my_wallet.py +++ /dev/null @@ -1,59 +0,0 @@ -from collections.abc import Mapping -from typing import Any, TypeVar, Union - -from attrs import define as _attrs_define -from attrs import field as _attrs_field - -from ..types import UNSET, Unset - -T = TypeVar("T", bound="MyWallet") - - -@_attrs_define -class MyWallet: - """ - Attributes: - balance (Union[Unset, int]): - """ - - balance: Union[Unset, int] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - balance = self.balance - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if balance is not UNSET: - field_dict["balance"] = balance - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - balance = d.pop("balance", UNSET) - - my_wallet = cls( - balance=balance, - ) - - my_wallet.additional_properties = d - return my_wallet - - @property - def additional_keys(self) -> list[str]: - return list(self.additional_properties.keys()) - - def __getitem__(self, key: str) -> Any: - return self.additional_properties[key] - - def __setitem__(self, key: str, value: Any) -> None: - self.additional_properties[key] = value - - def __delitem__(self, key: str) -> None: - del self.additional_properties[key] - - def __contains__(self, key: str) -> bool: - return key in self.additional_properties diff --git a/gooyal_wallet_client/models/paginated_user_transaction_list.py b/gooyal_wallet_client/models/paginated_account_list.py similarity index 85% rename from gooyal_wallet_client/models/paginated_user_transaction_list.py rename to gooyal_wallet_client/models/paginated_account_list.py index fb90457..18aee85 100644 --- a/gooyal_wallet_client/models/paginated_user_transaction_list.py +++ b/gooyal_wallet_client/models/paginated_account_list.py @@ -7,24 +7,24 @@ from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.user_transaction import UserTransaction + from ..models.account import Account -T = TypeVar("T", bound="PaginatedUserTransactionList") +T = TypeVar("T", bound="PaginatedAccountList") @_attrs_define -class PaginatedUserTransactionList: +class PaginatedAccountList: """ Attributes: count (int): Example: 123. - results (list['UserTransaction']): + results (list['Account']): next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. """ count: int - results: list["UserTransaction"] + results: list["Account"] next_: Union[None, Unset, str] = UNSET previous: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,7 +66,7 @@ class PaginatedUserTransactionList: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.user_transaction import UserTransaction + from ..models.account import Account d = dict(src_dict) count = d.pop("count") @@ -74,7 +74,7 @@ class PaginatedUserTransactionList: results = [] _results = d.pop("results") for results_item_data in _results: - results_item = UserTransaction.from_dict(results_item_data) + results_item = Account.from_dict(results_item_data) results.append(results_item) @@ -96,15 +96,15 @@ class PaginatedUserTransactionList: previous = _parse_previous(d.pop("previous", UNSET)) - paginated_user_transaction_list = cls( + paginated_account_list = cls( count=count, results=results, next_=next_, previous=previous, ) - paginated_user_transaction_list.additional_properties = d - return paginated_user_transaction_list + paginated_account_list.additional_properties = d + return paginated_account_list @property def additional_keys(self) -> list[str]: diff --git a/gooyal_wallet_client/models/paginated_application_transaction_list.py b/gooyal_wallet_client/models/paginated_transaction_list.py similarity index 84% rename from gooyal_wallet_client/models/paginated_application_transaction_list.py rename to gooyal_wallet_client/models/paginated_transaction_list.py index f72973d..71f2a07 100644 --- a/gooyal_wallet_client/models/paginated_application_transaction_list.py +++ b/gooyal_wallet_client/models/paginated_transaction_list.py @@ -7,24 +7,24 @@ from attrs import field as _attrs_field from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.application_transaction import ApplicationTransaction + from ..models.transaction import Transaction -T = TypeVar("T", bound="PaginatedApplicationTransactionList") +T = TypeVar("T", bound="PaginatedTransactionList") @_attrs_define -class PaginatedApplicationTransactionList: +class PaginatedTransactionList: """ Attributes: count (int): Example: 123. - results (list['ApplicationTransaction']): + results (list['Transaction']): next_ (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=400&limit=100. previous (Union[None, Unset, str]): Example: http://api.example.org/accounts/?offset=200&limit=100. """ count: int - results: list["ApplicationTransaction"] + results: list["Transaction"] next_: Union[None, Unset, str] = UNSET previous: Union[None, Unset, str] = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -66,7 +66,7 @@ class PaginatedApplicationTransactionList: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.application_transaction import ApplicationTransaction + from ..models.transaction import Transaction d = dict(src_dict) count = d.pop("count") @@ -74,7 +74,7 @@ class PaginatedApplicationTransactionList: results = [] _results = d.pop("results") for results_item_data in _results: - results_item = ApplicationTransaction.from_dict(results_item_data) + results_item = Transaction.from_dict(results_item_data) results.append(results_item) @@ -96,15 +96,15 @@ class PaginatedApplicationTransactionList: previous = _parse_previous(d.pop("previous", UNSET)) - paginated_application_transaction_list = cls( + paginated_transaction_list = cls( count=count, results=results, next_=next_, previous=previous, ) - paginated_application_transaction_list.additional_properties = d - return paginated_application_transaction_list + paginated_transaction_list.additional_properties = d + return paginated_transaction_list @property def additional_keys(self) -> list[str]: diff --git a/gooyal_wallet_client/models/user_transaction.py b/gooyal_wallet_client/models/transaction.py similarity index 76% rename from gooyal_wallet_client/models/user_transaction.py rename to gooyal_wallet_client/models/transaction.py index 5b2a0a1..96e122a 100644 --- a/gooyal_wallet_client/models/user_transaction.py +++ b/gooyal_wallet_client/models/transaction.py @@ -10,18 +10,20 @@ from dateutil.parser import isoparse from ..models.state_enum import StateEnum from ..types import UNSET, Unset -T = TypeVar("T", bound="UserTransaction") +T = TypeVar("T", bound="Transaction") @_attrs_define -class UserTransaction: +class Transaction: """ Attributes: uuid (UUID): - payer_id (str): + payer (str): payer_type (str): - payee_id (UUID): - payee_type (UUID): + payer_wallet (str): + payee (UUID): + payee_type (int): + payee_wallet (str): created_at (datetime.datetime): state (StateEnum): * `1` - created * `2` - delayed @@ -38,10 +40,12 @@ class UserTransaction: """ uuid: UUID - payer_id: str + payer: str payer_type: str - payee_id: UUID - payee_type: UUID + payer_wallet: str + payee: UUID + payee_type: int + payee_wallet: str created_at: datetime.datetime state: StateEnum amount: int @@ -54,13 +58,17 @@ class UserTransaction: def to_dict(self) -> dict[str, Any]: uuid = str(self.uuid) - payer_id = self.payer_id + payer = self.payer payer_type = self.payer_type - payee_id = str(self.payee_id) + payer_wallet = self.payer_wallet - payee_type = str(self.payee_type) + payee = str(self.payee) + + payee_type = self.payee_type + + payee_wallet = self.payee_wallet created_at = self.created_at.isoformat() @@ -81,10 +89,12 @@ class UserTransaction: field_dict.update( { "uuid": uuid, - "payer_id": payer_id, + "payer": payer, "payer_type": payer_type, - "payee_id": payee_id, + "payer_wallet": payer_wallet, + "payee": payee, "payee_type": payee_type, + "payee_wallet": payee_wallet, "created_at": created_at, "state": state, "amount": amount, @@ -103,13 +113,17 @@ class UserTransaction: d = dict(src_dict) uuid = UUID(d.pop("uuid")) - payer_id = d.pop("payer_id") + payer = d.pop("payer") payer_type = d.pop("payer_type") - payee_id = UUID(d.pop("payee_id")) + payer_wallet = d.pop("payer_wallet") - payee_type = UUID(d.pop("payee_type")) + payee = UUID(d.pop("payee")) + + payee_type = d.pop("payee_type") + + payee_wallet = d.pop("payee_wallet") created_at = isoparse(d.pop("created_at")) @@ -125,12 +139,14 @@ class UserTransaction: delay = d.pop("delay", UNSET) - user_transaction = cls( + transaction = cls( uuid=uuid, - payer_id=payer_id, + payer=payer, payer_type=payer_type, - payee_id=payee_id, + payer_wallet=payer_wallet, + payee=payee, payee_type=payee_type, + payee_wallet=payee_wallet, created_at=created_at, state=state, amount=amount, @@ -140,8 +156,8 @@ class UserTransaction: delay=delay, ) - user_transaction.additional_properties = d - return user_transaction + transaction.additional_properties = d + return transaction @property def additional_keys(self) -> list[str]: