inttegro.async_resources.payouts

Generated public typing surface. Do not edit by hand.

  1# Generated by scripts/generate_async_resources.py; do not edit by hand.
  2"""Typed payout operations for transfers from an Inttegro balance."""
  3from __future__ import annotations
  4from ..async_http_client import AsyncHttpClient
  5from inttegro.payout.destinations_input import DestinationsInput
  6from inttegro.payout.page import Page
  7from inttegro.payout.page_request import PageRequest
  8from inttegro.payout.payout import Payout
  9from inttegro.payout.set_destinations_request import SetDestinationsRequest
 10from inttegro.payout.settings_lookup import SettingsLookup
 11from inttegro.payout.settings_mutation import SettingsMutation
 12from inttegro.schedule.payout_request import PayoutRequest
 13from inttegro.search import Page as SearchPage, Request as SearchRequest
 14
 15class AsyncPayouts:
 16    """Configure payout routing and inspect payout lifecycle state.
 17
 18    Access this resource through :attr:`inttegro.Client.payouts`. Successful
 19    responses are decoded into the payout models named in each return annotation;
 20    callers do not need to traverse response envelopes or parse timestamps.
 21    """
 22
 23    def __init__(self, http: AsyncHttpClient) -> None:
 24        """Create the resource with the client's authenticated HTTP transport."""
 25        self.http = http
 26
 27    async def set_destinations(self, destinations: SetDestinationsRequest | DestinationsInput) -> SettingsMutation:
 28        """Assign the financial account that receives GHS payouts.
 29
 30        Pass :class:`DestinationsInput` for the concise form, or a complete
 31        :class:`SetDestinationsRequest`. An empty ``ghs`` string removes the
 32        existing assignment. The returned :class:`SettingsMutation` exposes the
 33        updated ``destinations`` directly.
 34
 35        Example::
 36
 37            settings = client.payouts.set_destinations(
 38                DestinationsInput(ghs="fa_123")
 39            )
 40            print(settings.destinations.ghs)
 41        """
 42        if isinstance(destinations, SetDestinationsRequest):
 43            return await self.http.post('/payouts/set_destinations', destinations)
 44        return await self.http.post('/payouts/set_destinations', SetDestinationsRequest(destinations=destinations))
 45
 46    async def settings(self) -> SettingsLookup:
 47        """Return the complete payout settings read model.
 48
 49        ``destinations`` is a typed object with a ``ghs`` attribute. ``schedule``
 50        exposes its interval, execution day, and nested aging specification; it is
 51        ``None`` when no schedule is configured.
 52        """
 53        return await self.http.post('/payouts/settings', {})
 54
 55    async def schedule(self, payload: PayoutRequest) -> Payout:
 56        """Schedule a payout using typed destination, limit, reference, and time fields.
 57
 58        ``execute_after`` accepts a timezone-aware :class:`datetime.datetime` and
 59        is serialized by the request model. The response is a :class:`Payout`
 60        whose timestamp fields are parsed as datetimes.
 61        """
 62        return await self.http.post('/payouts/schedule', payload)
 63
 64    async def lookup(self, payout_id: str) -> Payout:
 65        """Retrieve one payout by its ``po_`` identifier."""
 66        return await self.http.post('/payouts/lookup', {'payout_id': payout_id})
 67
 68    async def disable_automatic(self) -> SettingsMutation:
 69        """Switch to manual payout scheduling and return the changed settings."""
 70        return await self.http.post('/payouts/disable', {})
 71
 72    async def enable_automatic(self) -> SettingsMutation:
 73        """Restore automatic payout scheduling and return the changed settings."""
 74        return await self.http.post('/payouts/enable', {})
 75
 76    async def enable_fx(self) -> SettingsMutation:
 77        """Enable payout currency conversion and return the changed settings."""
 78        return await self.http.post('/payouts/enable_fx', {})
 79
 80    async def disable_fx(self) -> SettingsMutation:
 81        """Disable payout currency conversion and return the changed settings."""
 82        return await self.http.post('/payouts/disable_fx', {})
 83
 84    async def page(self, payload: PageRequest) -> Page:
 85        """Return a typed page of payouts in reverse chronological order.
 86
 87        ``page_number`` is one-based and required. ``page_size`` is optional and
 88        limited to 256. Each item is a :class:`Payout`, not a dictionary.
 89
 90        Example::
 91
 92            page = client.payouts.page(PageRequest(page_number=1, page_size=50))
 93            for payout in page.payouts or []:
 94                print(payout.id, payout.status, payout.initiated_at)
 95        """
 96        return await self.http.post('/payouts/page', payload)
 97
 98    async def search(self, payload: SearchRequest) -> SearchPage:
 99        """Search payout projections owned by the authenticated application."""
100        return await self.http.post('/payouts/search', payload)
101
102    async def cancel(self, payout_id: str) -> Payout:
103        """Cancel a scheduled payout and return its updated typed representation."""
104        return await self.http.post('/payouts/cancel', {'payout_id': payout_id})
class AsyncPayouts:
 16class AsyncPayouts:
 17    """Configure payout routing and inspect payout lifecycle state.
 18
 19    Access this resource through :attr:`inttegro.Client.payouts`. Successful
 20    responses are decoded into the payout models named in each return annotation;
 21    callers do not need to traverse response envelopes or parse timestamps.
 22    """
 23
 24    def __init__(self, http: AsyncHttpClient) -> None:
 25        """Create the resource with the client's authenticated HTTP transport."""
 26        self.http = http
 27
 28    async def set_destinations(self, destinations: SetDestinationsRequest | DestinationsInput) -> SettingsMutation:
 29        """Assign the financial account that receives GHS payouts.
 30
 31        Pass :class:`DestinationsInput` for the concise form, or a complete
 32        :class:`SetDestinationsRequest`. An empty ``ghs`` string removes the
 33        existing assignment. The returned :class:`SettingsMutation` exposes the
 34        updated ``destinations`` directly.
 35
 36        Example::
 37
 38            settings = client.payouts.set_destinations(
 39                DestinationsInput(ghs="fa_123")
 40            )
 41            print(settings.destinations.ghs)
 42        """
 43        if isinstance(destinations, SetDestinationsRequest):
 44            return await self.http.post('/payouts/set_destinations', destinations)
 45        return await self.http.post('/payouts/set_destinations', SetDestinationsRequest(destinations=destinations))
 46
 47    async def settings(self) -> SettingsLookup:
 48        """Return the complete payout settings read model.
 49
 50        ``destinations`` is a typed object with a ``ghs`` attribute. ``schedule``
 51        exposes its interval, execution day, and nested aging specification; it is
 52        ``None`` when no schedule is configured.
 53        """
 54        return await self.http.post('/payouts/settings', {})
 55
 56    async def schedule(self, payload: PayoutRequest) -> Payout:
 57        """Schedule a payout using typed destination, limit, reference, and time fields.
 58
 59        ``execute_after`` accepts a timezone-aware :class:`datetime.datetime` and
 60        is serialized by the request model. The response is a :class:`Payout`
 61        whose timestamp fields are parsed as datetimes.
 62        """
 63        return await self.http.post('/payouts/schedule', payload)
 64
 65    async def lookup(self, payout_id: str) -> Payout:
 66        """Retrieve one payout by its ``po_`` identifier."""
 67        return await self.http.post('/payouts/lookup', {'payout_id': payout_id})
 68
 69    async def disable_automatic(self) -> SettingsMutation:
 70        """Switch to manual payout scheduling and return the changed settings."""
 71        return await self.http.post('/payouts/disable', {})
 72
 73    async def enable_automatic(self) -> SettingsMutation:
 74        """Restore automatic payout scheduling and return the changed settings."""
 75        return await self.http.post('/payouts/enable', {})
 76
 77    async def enable_fx(self) -> SettingsMutation:
 78        """Enable payout currency conversion and return the changed settings."""
 79        return await self.http.post('/payouts/enable_fx', {})
 80
 81    async def disable_fx(self) -> SettingsMutation:
 82        """Disable payout currency conversion and return the changed settings."""
 83        return await self.http.post('/payouts/disable_fx', {})
 84
 85    async def page(self, payload: PageRequest) -> Page:
 86        """Return a typed page of payouts in reverse chronological order.
 87
 88        ``page_number`` is one-based and required. ``page_size`` is optional and
 89        limited to 256. Each item is a :class:`Payout`, not a dictionary.
 90
 91        Example::
 92
 93            page = client.payouts.page(PageRequest(page_number=1, page_size=50))
 94            for payout in page.payouts or []:
 95                print(payout.id, payout.status, payout.initiated_at)
 96        """
 97        return await self.http.post('/payouts/page', payload)
 98
 99    async def search(self, payload: SearchRequest) -> SearchPage:
100        """Search payout projections owned by the authenticated application."""
101        return await self.http.post('/payouts/search', payload)
102
103    async def cancel(self, payout_id: str) -> Payout:
104        """Cancel a scheduled payout and return its updated typed representation."""
105        return await self.http.post('/payouts/cancel', {'payout_id': payout_id})

Configure payout routing and inspect payout lifecycle state.

Access this resource through inttegro.Client.payouts. Successful responses are decoded into the payout models named in each return annotation; callers do not need to traverse response envelopes or parse timestamps.

AsyncPayouts(http: inttegro.async_http_client.AsyncHttpClient)
24    def __init__(self, http: AsyncHttpClient) -> None:
25        """Create the resource with the client's authenticated HTTP transport."""
26        self.http = http

Create the resource with the client's authenticated HTTP transport.

http
async def set_destinations( self, destinations: inttegro.payout.SetDestinationsRequest | inttegro.payout.DestinationsInput) -> inttegro.payout.SettingsMutation:
28    async def set_destinations(self, destinations: SetDestinationsRequest | DestinationsInput) -> SettingsMutation:
29        """Assign the financial account that receives GHS payouts.
30
31        Pass :class:`DestinationsInput` for the concise form, or a complete
32        :class:`SetDestinationsRequest`. An empty ``ghs`` string removes the
33        existing assignment. The returned :class:`SettingsMutation` exposes the
34        updated ``destinations`` directly.
35
36        Example::
37
38            settings = client.payouts.set_destinations(
39                DestinationsInput(ghs="fa_123")
40            )
41            print(settings.destinations.ghs)
42        """
43        if isinstance(destinations, SetDestinationsRequest):
44            return await self.http.post('/payouts/set_destinations', destinations)
45        return await self.http.post('/payouts/set_destinations', SetDestinationsRequest(destinations=destinations))

Assign the financial account that receives GHS payouts.

Pass DestinationsInput for the concise form, or a complete SetDestinationsRequest. An empty ghs string removes the existing assignment. The returned SettingsMutation exposes the updated destinations directly.

Example::

settings = client.payouts.set_destinations(
    DestinationsInput(ghs="fa_123")
)
print(settings.destinations.ghs)
async def settings(self) -> inttegro.payout.SettingsLookup:
47    async def settings(self) -> SettingsLookup:
48        """Return the complete payout settings read model.
49
50        ``destinations`` is a typed object with a ``ghs`` attribute. ``schedule``
51        exposes its interval, execution day, and nested aging specification; it is
52        ``None`` when no schedule is configured.
53        """
54        return await self.http.post('/payouts/settings', {})

Return the complete payout settings read model.

destinations is a typed object with a ghs attribute. schedule exposes its interval, execution day, and nested aging specification; it is None when no schedule is configured.

async def schedule( self, payload: inttegro.schedule.PayoutRequest) -> inttegro.payout.Payout:
56    async def schedule(self, payload: PayoutRequest) -> Payout:
57        """Schedule a payout using typed destination, limit, reference, and time fields.
58
59        ``execute_after`` accepts a timezone-aware :class:`datetime.datetime` and
60        is serialized by the request model. The response is a :class:`Payout`
61        whose timestamp fields are parsed as datetimes.
62        """
63        return await self.http.post('/payouts/schedule', payload)

Schedule a payout using typed destination, limit, reference, and time fields.

execute_after accepts a timezone-aware datetime.datetime and is serialized by the request model. The response is a Payout whose timestamp fields are parsed as datetimes.

async def lookup(self, payout_id: str) -> inttegro.payout.Payout:
65    async def lookup(self, payout_id: str) -> Payout:
66        """Retrieve one payout by its ``po_`` identifier."""
67        return await self.http.post('/payouts/lookup', {'payout_id': payout_id})

Retrieve one payout by its po_ identifier.

async def disable_automatic(self) -> inttegro.payout.SettingsMutation:
69    async def disable_automatic(self) -> SettingsMutation:
70        """Switch to manual payout scheduling and return the changed settings."""
71        return await self.http.post('/payouts/disable', {})

Switch to manual payout scheduling and return the changed settings.

async def enable_automatic(self) -> inttegro.payout.SettingsMutation:
73    async def enable_automatic(self) -> SettingsMutation:
74        """Restore automatic payout scheduling and return the changed settings."""
75        return await self.http.post('/payouts/enable', {})

Restore automatic payout scheduling and return the changed settings.

async def enable_fx(self) -> inttegro.payout.SettingsMutation:
77    async def enable_fx(self) -> SettingsMutation:
78        """Enable payout currency conversion and return the changed settings."""
79        return await self.http.post('/payouts/enable_fx', {})

Enable payout currency conversion and return the changed settings.

async def disable_fx(self) -> inttegro.payout.SettingsMutation:
81    async def disable_fx(self) -> SettingsMutation:
82        """Disable payout currency conversion and return the changed settings."""
83        return await self.http.post('/payouts/disable_fx', {})

Disable payout currency conversion and return the changed settings.

async def page( self, payload: inttegro.payout.PageRequest) -> inttegro.payout.Page:
85    async def page(self, payload: PageRequest) -> Page:
86        """Return a typed page of payouts in reverse chronological order.
87
88        ``page_number`` is one-based and required. ``page_size`` is optional and
89        limited to 256. Each item is a :class:`Payout`, not a dictionary.
90
91        Example::
92
93            page = client.payouts.page(PageRequest(page_number=1, page_size=50))
94            for payout in page.payouts or []:
95                print(payout.id, payout.status, payout.initiated_at)
96        """
97        return await self.http.post('/payouts/page', payload)

Return a typed page of payouts in reverse chronological order.

page_number is one-based and required. page_size is optional and limited to 256. Each item is a Payout, not a dictionary.

Example::

page = client.payouts.page(PageRequest(page_number=1, page_size=50))
for payout in page.payouts or []:
    print(payout.id, payout.status, payout.initiated_at)
async def search( self, payload: inttegro.search.Request) -> inttegro.search.Page:
 99    async def search(self, payload: SearchRequest) -> SearchPage:
100        """Search payout projections owned by the authenticated application."""
101        return await self.http.post('/payouts/search', payload)

Search payout projections owned by the authenticated application.

async def cancel(self, payout_id: str) -> inttegro.payout.Payout:
103    async def cancel(self, payout_id: str) -> Payout:
104        """Cancel a scheduled payout and return its updated typed representation."""
105        return await self.http.post('/payouts/cancel', {'payout_id': payout_id})

Cancel a scheduled payout and return its updated typed representation.