Merge pull request 'FEATURE/new-wallet-api' (#5) from FEATURE/new-wallet-api into master

Reviewed-on: addwin/pg#5
Reviewed-by: Sayyid Hamid Mahdavi <sahama@noreply.localhost>
This commit is contained in:
Sayyid Hamid Mahdavi 2025-11-04 05:25:31 -05:00
commit 63c43f597e
36 changed files with 669 additions and 2433 deletions

View file

@ -120,8 +120,9 @@ class PaymentRequest(models.Model):
def deposit_submit(self):
data = {
"uuid": str(self.uuid),
"payee_id": str(self.user.uuid),
"payee": str(self.user.uuid),
"payee_type": 1,
"payee_wallet": settings.WALLET_RIAL,
"amount": self.amount,
"details": {
'description': str(_("charge via ipg")),
@ -129,7 +130,7 @@ class PaymentRequest(models.Model):
'application_details_url': ''
},
}
submit_response = deposit_to_user_wallet_submit(settings.WALLET_RIAL_CATEGORY, data)
submit_response = deposit_to_user_wallet_submit(settings.WALLET_RIAL, data)
if not submit_response or not submit_response.uuid:
logger.error(f"[Deposit Submit] Wallet submission failed | payment_id={self.pk}")
@ -147,7 +148,7 @@ class PaymentRequest(models.Model):
return to_success
def deposit_verify(self):
verify_response = deposit_to_user_wallet_verify(settings.WALLET_RIAL_CATEGORY, self.uuid)
verify_response = deposit_to_user_wallet_verify(settings.WALLET_RIAL, self.uuid)
if not verify_response:
logger.error(f"[Deposit Verify] Failed to get response from wallet service | payment_id={self.pk}")

View file

@ -1 +0,0 @@
"""Contains endpoint functions for accessing the API"""

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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,
)

View file

@ -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

View file

@ -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,
)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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 (

View file

@ -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

View file

@ -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/user/wallets/{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

View file

@ -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 (

View file

@ -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,
)

View file

@ -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

View file

@ -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,
)

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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",
)

View file

@ -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]:

View file

@ -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,

View file

@ -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

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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]:

View file

@ -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]:

View file

@ -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]:

View file

@ -255,5 +255,5 @@ CACHES = {
PNA_CORPORATION_PIN = config('PNA_CORPORATION_PIN')
WALLET_BASE_PUBLIC_URL = config('WALLET_BASE_PUBLIC_URL')
WALLET_RIAL_CATEGORY = config('WALLET_RIAL_CATEGORY')
WALLET_RIAL = config('WALLET_RIAL')
IPG_BASE_PUBLIC_URL = config('IPG_BASE_PUBLIC_URL')

View file

@ -7,11 +7,11 @@ from django.db import models
from httpx import Request
from gooyal_wallet_client import AuthenticatedClient
from gooyal_wallet_client.models import MyWallet, UserTransaction, ApplicationDeposit, ApplicationWithdraw
from gooyal_wallet_client.api.wallet import (wallet_api_application_deposit_create_2,
wallet_api_application_deposit_verify_retrieve_2,
wallet_api_application_withdraw_create_2,
wallet_api_application_withdraw_verify_retrieve_2)
from gooyal_wallet_client.models import Transaction, Account, ApplicationDeposit, ApplicationWithdraw
from gooyal_wallet_client.api.wallet import (wallet_api_application_deposit_create,
wallet_api_application_deposit_verify_retrieve,
wallet_api_application_withdraw_create,
wallet_api_application_withdraw_verify_retrieve)
from gooyal_wallet_client.types import Response
from django.conf import Settings
@ -73,42 +73,42 @@ def get_client():
return client
def deposit_to_user_wallet_submit(category_uuid, data):
def deposit_to_user_wallet_submit(payer_wallet, data):
class Tmp():
def to_dict(self):
return data
deposit_data = Tmp()
client = get_client()
response: ApplicationDeposit = wallet_api_application_deposit_create_2.sync(category_uuid= category_uuid,
response: ApplicationDeposit = wallet_api_application_deposit_create.sync(payer_wallet=payer_wallet,
client=client,
body=deposit_data)
print(response)
return response
def deposit_to_user_wallet_verify(category_uuid, uuid):
def deposit_to_user_wallet_verify(payer_wallet, uuid):
client = get_client()
response: ApplicationDeposit = wallet_api_application_deposit_verify_retrieve_2.sync(category_uuid=category_uuid, uuid=uuid, client=client)
response: ApplicationDeposit = wallet_api_application_deposit_verify_retrieve.sync(payer_wallet=payer_wallet, uuid=uuid, client=client)
print(response)
return response
def withdraw_from_user_wallet_submit(category_uuid, data):
def withdraw_from_user_wallet_submit(payee_wallet, data):
class Tmp():
def to_dict(self):
return data
withdraw_data = Tmp()
client = get_client()
response: ApplicationWithdraw = wallet_api_application_withdraw_create_2.sync(category_uuid=category_uuid, client=client, body=withdraw_data)
response: ApplicationWithdraw = wallet_api_application_withdraw_create.sync(payee_wallet=payee_wallet, client=client, body=withdraw_data)
print(response)
return response
def withdraw_from_user_wallet_verify(category_uuid, uuid):
def withdraw_from_user_wallet_verify(payee_wallet, uuid):
client = get_client()
response: ApplicationWithdraw = wallet_api_application_withdraw_verify_retrieve_2.sync(category_uuid=category_uuid, uuid=uuid, client=client)
response: ApplicationWithdraw = wallet_api_application_withdraw_verify_retrieve.sync(payee_wallet=payee_wallet, uuid=uuid, client=client)
print(response)
return response