add openapi-python-client generator + client
This commit is contained in:
@@ -0,0 +1 @@
|
||||
"""Contains endpoint functions for accessing the API"""
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.payment_start import PaymentStart
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_payments/methods/actions/start_payment/",
|
||||
}
|
||||
|
||||
if isinstance(body, PaymentStart):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PaymentStart):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PaymentStart):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PaymentStart]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaymentStart.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[PaymentStart]:
|
||||
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: Union[
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
],
|
||||
) -> Response[PaymentStart]:
|
||||
"""Use this endpoint to start a payment for a given basket.
|
||||
|
||||
Payments must *also* be made for free / 0-amount baskets.
|
||||
|
||||
A basket has the following requirements to be able to be paid:
|
||||
- Terms of Service accepted
|
||||
- Billing information is specified
|
||||
- Is editable (all registrations of the basket must be in ``new`` state)
|
||||
|
||||
You must provide the ID of the active module of the desired payment method for a non-zero payment,
|
||||
otherwise you can omit this.
|
||||
|
||||
This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket
|
||||
is also directly marked as paid.
|
||||
Else, if the requested payment method requires the user to continue on another website, the response
|
||||
will include `is_external_redirect=true`,
|
||||
and you must redirect the user to the URL specified in `link`. If the attribute is false, then you
|
||||
must do the rest of the handling in the front end.
|
||||
|
||||
Args:
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
|
||||
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[PaymentStart]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
],
|
||||
) -> Optional[PaymentStart]:
|
||||
"""Use this endpoint to start a payment for a given basket.
|
||||
|
||||
Payments must *also* be made for free / 0-amount baskets.
|
||||
|
||||
A basket has the following requirements to be able to be paid:
|
||||
- Terms of Service accepted
|
||||
- Billing information is specified
|
||||
- Is editable (all registrations of the basket must be in ``new`` state)
|
||||
|
||||
You must provide the ID of the active module of the desired payment method for a non-zero payment,
|
||||
otherwise you can omit this.
|
||||
|
||||
This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket
|
||||
is also directly marked as paid.
|
||||
Else, if the requested payment method requires the user to continue on another website, the response
|
||||
will include `is_external_redirect=true`,
|
||||
and you must redirect the user to the URL specified in `link`. If the attribute is false, then you
|
||||
must do the rest of the handling in the front end.
|
||||
|
||||
Args:
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
|
||||
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:
|
||||
PaymentStart
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
],
|
||||
) -> Response[PaymentStart]:
|
||||
"""Use this endpoint to start a payment for a given basket.
|
||||
|
||||
Payments must *also* be made for free / 0-amount baskets.
|
||||
|
||||
A basket has the following requirements to be able to be paid:
|
||||
- Terms of Service accepted
|
||||
- Billing information is specified
|
||||
- Is editable (all registrations of the basket must be in ``new`` state)
|
||||
|
||||
You must provide the ID of the active module of the desired payment method for a non-zero payment,
|
||||
otherwise you can omit this.
|
||||
|
||||
This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket
|
||||
is also directly marked as paid.
|
||||
Else, if the requested payment method requires the user to continue on another website, the response
|
||||
will include `is_external_redirect=true`,
|
||||
and you must redirect the user to the URL specified in `link`. If the attribute is false, then you
|
||||
must do the rest of the handling in the front end.
|
||||
|
||||
Args:
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
|
||||
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[PaymentStart]
|
||||
"""
|
||||
|
||||
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: Union[
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
PaymentStart,
|
||||
],
|
||||
) -> Optional[PaymentStart]:
|
||||
"""Use this endpoint to start a payment for a given basket.
|
||||
|
||||
Payments must *also* be made for free / 0-amount baskets.
|
||||
|
||||
A basket has the following requirements to be able to be paid:
|
||||
- Terms of Service accepted
|
||||
- Billing information is specified
|
||||
- Is editable (all registrations of the basket must be in ``new`` state)
|
||||
|
||||
You must provide the ID of the active module of the desired payment method for a non-zero payment,
|
||||
otherwise you can omit this.
|
||||
|
||||
This endpoint will create an Invoice and Payment Intent. In the case of a zero-payment, the basket
|
||||
is also directly marked as paid.
|
||||
Else, if the requested payment method requires the user to continue on another website, the response
|
||||
will include `is_external_redirect=true`,
|
||||
and you must redirect the user to the URL specified in `link`. If the attribute is false, then you
|
||||
must do the rest of the handling in the front end.
|
||||
|
||||
Args:
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
body (PaymentStart): A serializer with a basket as an input to start the payment and with
|
||||
a payment link for the response
|
||||
|
||||
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:
|
||||
PaymentStart
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_payment_method_list import PaginatedPaymentMethodList
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
basket: int,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["basket"] = basket
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
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": "/api/v2/modules_payments/methods/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedPaymentMethodList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedPaymentMethodList.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[PaginatedPaymentMethodList]:
|
||||
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,
|
||||
basket: int,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPaymentMethodList]:
|
||||
"""List available payment methods for the linked basket
|
||||
|
||||
Args:
|
||||
basket (int):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPaymentMethodList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
basket=basket,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket: int,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPaymentMethodList]:
|
||||
"""List available payment methods for the linked basket
|
||||
|
||||
Args:
|
||||
basket (int):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPaymentMethodList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
basket=basket,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket: int,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPaymentMethodList]:
|
||||
"""List available payment methods for the linked basket
|
||||
|
||||
Args:
|
||||
basket (int):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPaymentMethodList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
basket=basket,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket: int,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPaymentMethodList]:
|
||||
"""List available payment methods for the linked basket
|
||||
|
||||
Args:
|
||||
basket (int):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPaymentMethodList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
basket=basket,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+260
@@ -0,0 +1,260 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union, cast
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.cancel_error import CancelError
|
||||
from ...models.payment_intent import PaymentIntent
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["expand"] = expand
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": f"/api/v2/modules_payments/payment_intents/{id}/actions/cancel/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
if isinstance(body, PaymentIntent):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PaymentIntent):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PaymentIntent):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[Union[Any, CancelError]]:
|
||||
if response.status_code == 204:
|
||||
response_204 = cast(Any, None)
|
||||
return response_204
|
||||
if response.status_code == 400:
|
||||
response_400 = CancelError.from_dict(response.json())
|
||||
|
||||
return response_400
|
||||
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[Union[Any, CancelError]]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[Union[Any, CancelError]]:
|
||||
"""This view action cancels a payment intent and returns an error in case the payment intent was not in
|
||||
a cancellable state (paid or already cancelled).
|
||||
|
||||
After cancelling a payment intent, you should redirect the user to do the payment method choice and
|
||||
order validation again.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
|
||||
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[Union[Any, CancelError]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[Union[Any, CancelError]]:
|
||||
"""This view action cancels a payment intent and returns an error in case the payment intent was not in
|
||||
a cancellable state (paid or already cancelled).
|
||||
|
||||
After cancelling a payment intent, you should redirect the user to do the payment method choice and
|
||||
order validation again.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
|
||||
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:
|
||||
Union[Any, CancelError]
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
expand=expand,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[Union[Any, CancelError]]:
|
||||
"""This view action cancels a payment intent and returns an error in case the payment intent was not in
|
||||
a cancellable state (paid or already cancelled).
|
||||
|
||||
After cancelling a payment intent, you should redirect the user to do the payment method choice and
|
||||
order validation again.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
|
||||
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[Union[Any, CancelError]]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
PaymentIntent,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[Union[Any, CancelError]]:
|
||||
"""This view action cancels a payment intent and returns an error in case the payment intent was not in
|
||||
a cancellable state (paid or already cancelled).
|
||||
|
||||
After cancelling a payment intent, you should redirect the user to do the payment method choice and
|
||||
order validation again.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
body (PaymentIntent): A serializer for Payment Intent. This serializer may contain invoice
|
||||
or invoice_id depending on what the expand parameter is.
|
||||
|
||||
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:
|
||||
Union[Any, CancelError]
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
).parsed
|
||||
+260
@@ -0,0 +1,260 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.payment_intent_request_update import PaymentIntentRequestUpdate
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["expand"] = expand
|
||||
|
||||
params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": f"/api/v2/modules_payments/payment_intents/{id}/actions/request_status_update/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
if isinstance(body, PaymentIntentRequestUpdate):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PaymentIntentRequestUpdate):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PaymentIntentRequestUpdate):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaymentIntentRequestUpdate]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaymentIntentRequestUpdate.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[PaymentIntentRequestUpdate]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaymentIntentRequestUpdate]:
|
||||
"""This view action must be provided with the `status` that the frontend has received from an external
|
||||
PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of
|
||||
the `PaymentIntent` is coherent with its status on the external PSP.
|
||||
|
||||
After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of
|
||||
`is_error`, `is_cancelled` or `invoice.is_resolved` have changed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
|
||||
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[PaymentIntentRequestUpdate]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaymentIntentRequestUpdate]:
|
||||
"""This view action must be provided with the `status` that the frontend has received from an external
|
||||
PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of
|
||||
the `PaymentIntent` is coherent with its status on the external PSP.
|
||||
|
||||
After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of
|
||||
`is_error`, `is_cancelled` or `invoice.is_resolved` have changed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
|
||||
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:
|
||||
PaymentIntentRequestUpdate
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
expand=expand,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaymentIntentRequestUpdate]:
|
||||
"""This view action must be provided with the `status` that the frontend has received from an external
|
||||
PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of
|
||||
the `PaymentIntent` is coherent with its status on the external PSP.
|
||||
|
||||
After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of
|
||||
`is_error`, `is_cancelled` or `invoice.is_resolved` have changed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
|
||||
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[PaymentIntentRequestUpdate]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
PaymentIntentRequestUpdate,
|
||||
],
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaymentIntentRequestUpdate]:
|
||||
"""This view action must be provided with the `status` that the frontend has received from an external
|
||||
PSP. Calling this endpoint will trigger an **asynchronous** process that will ensure the status of
|
||||
the `PaymentIntent` is coherent with its status on the external PSP.
|
||||
|
||||
After having called this endpoint, you should poll the detail of the `PaymentIntent` until one of
|
||||
`is_error`, `is_cancelled` or `invoice.is_resolved` have changed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, str]):
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
body (PaymentIntentRequestUpdate): A serializer for Payment Intent Request Update
|
||||
containing the status of the PSP
|
||||
|
||||
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:
|
||||
PaymentIntentRequestUpdate
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
expand=expand,
|
||||
)
|
||||
).parsed
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_payment_intent_list import PaginatedPaymentIntentList
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
basket_id: Union[Unset, int] = UNSET,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["basket_id"] = basket_id
|
||||
|
||||
params["expand"] = expand
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
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": "/api/v2/modules_payments/payment_intents/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedPaymentIntentList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedPaymentIntentList.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[PaginatedPaymentIntentList]:
|
||||
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,
|
||||
basket_id: Union[Unset, int] = UNSET,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPaymentIntentList]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
basket_id (Union[Unset, int]):
|
||||
expand (Union[Unset, str]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPaymentIntentList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
basket_id=basket_id,
|
||||
expand=expand,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket_id: Union[Unset, int] = UNSET,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPaymentIntentList]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
basket_id (Union[Unset, int]):
|
||||
expand (Union[Unset, str]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPaymentIntentList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
basket_id=basket_id,
|
||||
expand=expand,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket_id: Union[Unset, int] = UNSET,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPaymentIntentList]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
basket_id (Union[Unset, int]):
|
||||
expand (Union[Unset, str]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPaymentIntentList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
basket_id=basket_id,
|
||||
expand=expand,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
basket_id: Union[Unset, int] = UNSET,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPaymentIntentList]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
basket_id (Union[Unset, int]):
|
||||
expand (Union[Unset, str]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPaymentIntentList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
basket_id=basket_id,
|
||||
expand=expand,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+167
@@ -0,0 +1,167 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.payment_intent import PaymentIntent
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["expand"] = expand
|
||||
|
||||
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"/api/v2/modules_payments/payment_intents/{id}/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[PaymentIntent]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaymentIntent.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[PaymentIntent]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaymentIntent]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, 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[PaymentIntent]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaymentIntent]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, 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:
|
||||
PaymentIntent
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
expand=expand,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaymentIntent]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, 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[PaymentIntent]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
expand=expand,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
expand: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaymentIntent]:
|
||||
"""API endpoint that allows PaymentIntent to be viewed.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
expand (Union[Unset, 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:
|
||||
PaymentIntent
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
expand=expand,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_payments/payrexx/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModulePaymentPayrexxActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModulePaymentPayrexxActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModulePaymentPayrexxActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModulePaymentPayrexxActiveModule.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[ModulePaymentPayrexxActiveModule]:
|
||||
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: Union[
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
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: Union[
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
ModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (ModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_payment_payrexx_active_module_list import PaginatedModulePaymentPayrexxActiveModuleList
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
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": "/api/v2/modules_payments/payrexx/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModulePaymentPayrexxActiveModuleList.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[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
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,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedModulePaymentPayrexxActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedModulePaymentPayrexxActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedModulePaymentPayrexxActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModulePaymentPayrexxActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedModulePaymentPayrexxActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule
|
||||
from ...models.patched_module_payment_payrexx_active_module import PatchedModulePaymentPayrexxActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_payments/payrexx/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModulePaymentPayrexxActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModulePaymentPayrexxActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModulePaymentPayrexxActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModulePaymentPayrexxActiveModule.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[ModulePaymentPayrexxActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
PatchedModulePaymentPayrexxActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
body (PatchedModulePaymentPayrexxActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPayrexx`
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_payrexx_active_module import ModulePaymentPayrexxActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_payments/payrexx/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModulePaymentPayrexxActiveModule.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[ModulePaymentPayrexxActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[ModulePaymentPayrexxActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModulePaymentPayrexxActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPayrexx`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
ModulePaymentPayrexxActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+195
@@ -0,0 +1,195 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.webhooks import Webhooks
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_payments/payrexx/webhooks/",
|
||||
}
|
||||
|
||||
if isinstance(body, Webhooks):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, Webhooks):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, Webhooks):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Webhooks]:
|
||||
if response.status_code == 201:
|
||||
response_201 = Webhooks.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[Webhooks]:
|
||||
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: Union[
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
],
|
||||
) -> Response[Webhooks]:
|
||||
"""Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do
|
||||
any treatment of the webhook content asynchronously.
|
||||
|
||||
Args:
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
|
||||
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[Webhooks]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
],
|
||||
) -> Optional[Webhooks]:
|
||||
"""Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do
|
||||
any treatment of the webhook content asynchronously.
|
||||
|
||||
Args:
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
|
||||
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:
|
||||
Webhooks
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
],
|
||||
) -> Response[Webhooks]:
|
||||
"""Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do
|
||||
any treatment of the webhook content asynchronously.
|
||||
|
||||
Args:
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
|
||||
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[Webhooks]
|
||||
"""
|
||||
|
||||
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: Union[
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
Webhooks,
|
||||
],
|
||||
) -> Optional[Webhooks]:
|
||||
"""Called by Payrexx to update status of Gateway. Will return a HTTP 200 as soon as possible, and do
|
||||
any treatment of the webhook content asynchronously.
|
||||
|
||||
Args:
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
body (Webhooks): Webhook data containing a transaction
|
||||
|
||||
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:
|
||||
Webhooks
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_payments/pointofsale/modules/",
|
||||
}
|
||||
|
||||
if isinstance(body, ModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, ModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, ModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
if response.status_code == 201:
|
||||
response_201 = ModulePaymentPointOfSaleActiveModule.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[ModulePaymentPointOfSaleActiveModule]:
|
||||
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: Union[
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
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: Union[
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
ModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
body (ModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked to
|
||||
`ModulePaymentPointOfSale`
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+220
@@ -0,0 +1,220 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_module_payment_point_of_sale_active_module_list import (
|
||||
PaginatedModulePaymentPointOfSaleActiveModuleList,
|
||||
)
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
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": "/api/v2/modules_payments/pointofsale/modules/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedModulePaymentPointOfSaleActiveModuleList.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[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
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,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedModulePaymentPointOfSaleActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedModulePaymentPointOfSaleActiveModuleList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedModulePaymentPointOfSaleActiveModuleList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, int] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedModulePaymentPointOfSaleActiveModuleList]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, int]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedModulePaymentPointOfSaleActiveModuleList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule
|
||||
from ...models.patched_module_payment_point_of_sale_active_module import PatchedModulePaymentPointOfSaleActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_payments/pointofsale/modules/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedModulePaymentPointOfSaleActiveModule):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModulePaymentPointOfSaleActiveModule.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[ModulePaymentPointOfSaleActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
PatchedModulePaymentPointOfSaleActiveModule,
|
||||
],
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
body (PatchedModulePaymentPointOfSaleActiveModule): Serializer for `ActiveModule` linked
|
||||
to `ModulePaymentPointOfSale`
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.module_payment_point_of_sale_active_module import ModulePaymentPointOfSaleActiveModule
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_payments/pointofsale/modules/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
if response.status_code == 200:
|
||||
response_200 = ModulePaymentPointOfSaleActiveModule.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[ModulePaymentPointOfSaleActiveModule]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[ModulePaymentPointOfSaleActiveModule]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[ModulePaymentPointOfSaleActiveModule]:
|
||||
"""ViewSet of model `ActiveModule` linked to `ModulePaymentPointOfSale`.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
ModulePaymentPointOfSaleActiveModule
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
body: Union[
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "post",
|
||||
"url": "/api/v2/modules_payments/pointofsale/places/",
|
||||
}
|
||||
|
||||
if isinstance(body, PointOfSalePlaceReadOnly):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PointOfSalePlaceReadOnly):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PointOfSalePlaceReadOnly):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
if response.status_code == 201:
|
||||
response_201 = PointOfSalePlaceReadOnly.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[PointOfSalePlaceReadOnly]:
|
||||
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: Union[
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
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: Union[
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
PointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PointOfSalePlaceReadOnly): A serializer returning info for a point of sale place.
|
||||
You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "delete",
|
||||
"url": f"/api/v2/modules_payments/pointofsale/places/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Optional[Any]:
|
||||
if response.status_code == 204:
|
||||
return None
|
||||
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[Any]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[Any]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[Any]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.paginated_point_of_sale_place_read_only_list import PaginatedPointOfSalePlaceReadOnlyList
|
||||
from ...types import UNSET, Response, Unset
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
*,
|
||||
event: Union[Unset, float] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> dict[str, Any]:
|
||||
params: dict[str, Any] = {}
|
||||
|
||||
params["event"] = event
|
||||
|
||||
params["o"] = o
|
||||
|
||||
params["offset"] = offset
|
||||
|
||||
params["page_limit"] = page_limit
|
||||
|
||||
params["q"] = q
|
||||
|
||||
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": "/api/v2/modules_payments/pointofsale/places/",
|
||||
"params": params,
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PaginatedPointOfSalePlaceReadOnlyList.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[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
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,
|
||||
event: Union[Unset, float] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, float]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPointOfSalePlaceReadOnlyList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, float] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, float]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPointOfSalePlaceReadOnlyList
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, float] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Response[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, float]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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[PaginatedPointOfSalePlaceReadOnlyList]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
event: Union[Unset, float] = UNSET,
|
||||
o: Union[Unset, str] = UNSET,
|
||||
offset: Union[Unset, int] = UNSET,
|
||||
page_limit: Union[Unset, int] = UNSET,
|
||||
q: Union[Unset, str] = UNSET,
|
||||
) -> Optional[PaginatedPointOfSalePlaceReadOnlyList]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
event (Union[Unset, float]):
|
||||
o (Union[Unset, str]):
|
||||
offset (Union[Unset, int]):
|
||||
page_limit (Union[Unset, int]):
|
||||
q (Union[Unset, 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:
|
||||
PaginatedPointOfSalePlaceReadOnlyList
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
client=client,
|
||||
event=event,
|
||||
o=o,
|
||||
offset=offset,
|
||||
page_limit=page_limit,
|
||||
q=q,
|
||||
)
|
||||
).parsed
|
||||
+229
@@ -0,0 +1,229 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.patched_point_of_sale_place_read_only import PatchedPointOfSalePlaceReadOnly
|
||||
from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
*,
|
||||
body: Union[
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> dict[str, Any]:
|
||||
headers: dict[str, Any] = {}
|
||||
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "patch",
|
||||
"url": f"/api/v2/modules_payments/pointofsale/places/{id}/",
|
||||
}
|
||||
|
||||
if isinstance(body, PatchedPointOfSalePlaceReadOnly):
|
||||
_kwargs["json"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/json"
|
||||
if isinstance(body, PatchedPointOfSalePlaceReadOnly):
|
||||
_kwargs["data"] = body.to_dict()
|
||||
|
||||
headers["Content-Type"] = "application/x-www-form-urlencoded"
|
||||
if isinstance(body, PatchedPointOfSalePlaceReadOnly):
|
||||
_kwargs["files"] = body.to_multipart()
|
||||
|
||||
headers["Content-Type"] = "multipart/form-data"
|
||||
|
||||
_kwargs["headers"] = headers
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PointOfSalePlaceReadOnly.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[PointOfSalePlaceReadOnly]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
body=body,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
body: Union[
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
PatchedPointOfSalePlaceReadOnly,
|
||||
],
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""Partial update (PATCH) definition
|
||||
Returns:
|
||||
response: the serialized data
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
body (PatchedPointOfSalePlaceReadOnly): A serializer returning info for a point of sale
|
||||
place. You can access only read methods as a frontend login and will only see some fields.
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
body=body,
|
||||
)
|
||||
).parsed
|
||||
+150
@@ -0,0 +1,150 @@
|
||||
from http import HTTPStatus
|
||||
from typing import Any, Optional, Union
|
||||
|
||||
import httpx
|
||||
|
||||
from ... import errors
|
||||
from ...client import AuthenticatedClient, Client
|
||||
from ...models.point_of_sale_place_read_only import PointOfSalePlaceReadOnly
|
||||
from ...types import Response
|
||||
|
||||
|
||||
def _get_kwargs(
|
||||
id: int,
|
||||
) -> dict[str, Any]:
|
||||
_kwargs: dict[str, Any] = {
|
||||
"method": "get",
|
||||
"url": f"/api/v2/modules_payments/pointofsale/places/{id}/",
|
||||
}
|
||||
|
||||
return _kwargs
|
||||
|
||||
|
||||
def _parse_response(
|
||||
*, client: Union[AuthenticatedClient, Client], response: httpx.Response
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
if response.status_code == 200:
|
||||
response_200 = PointOfSalePlaceReadOnly.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[PointOfSalePlaceReadOnly]:
|
||||
return Response(
|
||||
status_code=HTTPStatus(response.status_code),
|
||||
content=response.content,
|
||||
headers=response.headers,
|
||||
parsed=_parse_response(client=client, response=response),
|
||||
)
|
||||
|
||||
|
||||
def sync_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = client.get_httpx_client().request(
|
||||
**kwargs,
|
||||
)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
def sync(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return sync_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
).parsed
|
||||
|
||||
|
||||
async def asyncio_detailed(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Response[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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[PointOfSalePlaceReadOnly]
|
||||
"""
|
||||
|
||||
kwargs = _get_kwargs(
|
||||
id=id,
|
||||
)
|
||||
|
||||
response = await client.get_async_httpx_client().request(**kwargs)
|
||||
|
||||
return _build_response(client=client, response=response)
|
||||
|
||||
|
||||
async def asyncio(
|
||||
id: int,
|
||||
*,
|
||||
client: AuthenticatedClient,
|
||||
) -> Optional[PointOfSalePlaceReadOnly]:
|
||||
"""ViewSet for `ModulePaymentPointOfSaleConfigurationPlace` model.
|
||||
|
||||
Args:
|
||||
id (int):
|
||||
|
||||
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:
|
||||
PointOfSalePlaceReadOnly
|
||||
"""
|
||||
|
||||
return (
|
||||
await asyncio_detailed(
|
||||
id=id,
|
||||
client=client,
|
||||
)
|
||||
).parsed
|
||||
Reference in New Issue
Block a user