inttegro.async_resources.purchase_intents

Generated public typing surface. Do not edit by hand.

  1# Generated by scripts/generate_async_resources.py; do not edit by hand.
  2"""Purchase intent resource for Pages Buy links."""
  3from __future__ import annotations
  4from ..async_http_client import AsyncHttpClient
  5
  6class AsyncPurchaseIntents:
  7    """Create, update, cancel, look up, and page Buy link purchase intents.
  8
  9    Access this service as ``AsyncInttegroClient.purchase_intents``. Methods use the client's shared transport and return the typed resource shapes documented below.
 10    """
 11
 12    def __init__(self, http: AsyncHttpClient):
 13        self.http = http
 14
 15    async def create(self, payload: dict):
 16        """Create a Buy link purchase intent.
 17
 18        API endpoint: ``/purchase_intents/create``.
 19
 20        Args:
 21            payload (dict): Typed request object or equivalent request mapping for this operation.
 22
 23        Returns:
 24            ``PurchaseIntent`` decoded from the documented response shape.
 25
 26        Raises:
 27            APIError: The API rejected the request or could not complete it.
 28            NetworkError: The request could not reach the Inttegro API.
 29            TimeoutError: The configured request deadline elapsed.
 30        """
 31        return await self.http.post('/purchase_intents/create', payload)
 32
 33    async def update(self, payload: dict):
 34        """Update mutable Buy link purchase intent fields.
 35
 36        API endpoint: ``/purchase_intents/update``.
 37
 38        Args:
 39            payload (dict): Typed request object or equivalent request mapping for this operation.
 40
 41        Returns:
 42            ``PurchaseIntent`` decoded from the documented response shape.
 43
 44        Raises:
 45            APIError: The API rejected the request or could not complete it.
 46            NetworkError: The request could not reach the Inttegro API.
 47            TimeoutError: The configured request deadline elapsed.
 48        """
 49        return await self.http.post('/purchase_intents/update', payload)
 50
 51    async def cancel(self, id: str):
 52        """Cancel a Buy link purchase intent.
 53
 54        API endpoint: ``/purchase_intents/cancel``.
 55
 56        Args:
 57            id (str): Unique identifier of the id.
 58
 59        Returns:
 60            ``PurchaseIntent`` decoded from the documented response shape.
 61
 62        Raises:
 63            APIError: The API rejected the request or could not complete it.
 64            NetworkError: The request could not reach the Inttegro API.
 65            TimeoutError: The configured request deadline elapsed.
 66        """
 67        return await self.http.post('/purchase_intents/cancel', {'id': id})
 68
 69    async def lookup(self, id: str):
 70        """Retrieve a Buy link purchase intent by ID.
 71
 72        API endpoint: ``/purchase_intents/lookup``.
 73
 74        Args:
 75            id (str): Unique identifier of the id.
 76
 77        Returns:
 78            ``PurchaseIntent`` decoded from the documented response shape.
 79
 80        Raises:
 81            APIError: The API rejected the request or could not complete it.
 82            NetworkError: The request could not reach the Inttegro API.
 83            TimeoutError: The configured request deadline elapsed.
 84        """
 85        return await self.http.post('/purchase_intents/lookup', {'id': id})
 86
 87    async def page(self, payload: dict):
 88        """List Buy link purchase intents.
 89
 90        API endpoint: ``/purchase_intents/page``.
 91
 92        Args:
 93            payload (dict): Typed request object or equivalent request mapping for this operation.
 94
 95        Returns:
 96            ``Page`` decoded from the documented response shape.
 97
 98        Raises:
 99            APIError: The API rejected the request or could not complete it.
100            NetworkError: The request could not reach the Inttegro API.
101            TimeoutError: The configured request deadline elapsed.
102        """
103        return await self.http.post('/purchase_intents/page', payload)
class AsyncPurchaseIntents:
  7class AsyncPurchaseIntents:
  8    """Create, update, cancel, look up, and page Buy link purchase intents.
  9
 10    Access this service as ``AsyncInttegroClient.purchase_intents``. Methods use the client's shared transport and return the typed resource shapes documented below.
 11    """
 12
 13    def __init__(self, http: AsyncHttpClient):
 14        self.http = http
 15
 16    async def create(self, payload: dict):
 17        """Create a Buy link purchase intent.
 18
 19        API endpoint: ``/purchase_intents/create``.
 20
 21        Args:
 22            payload (dict): Typed request object or equivalent request mapping for this operation.
 23
 24        Returns:
 25            ``PurchaseIntent`` decoded from the documented response shape.
 26
 27        Raises:
 28            APIError: The API rejected the request or could not complete it.
 29            NetworkError: The request could not reach the Inttegro API.
 30            TimeoutError: The configured request deadline elapsed.
 31        """
 32        return await self.http.post('/purchase_intents/create', payload)
 33
 34    async def update(self, payload: dict):
 35        """Update mutable Buy link purchase intent fields.
 36
 37        API endpoint: ``/purchase_intents/update``.
 38
 39        Args:
 40            payload (dict): Typed request object or equivalent request mapping for this operation.
 41
 42        Returns:
 43            ``PurchaseIntent`` decoded from the documented response shape.
 44
 45        Raises:
 46            APIError: The API rejected the request or could not complete it.
 47            NetworkError: The request could not reach the Inttegro API.
 48            TimeoutError: The configured request deadline elapsed.
 49        """
 50        return await self.http.post('/purchase_intents/update', payload)
 51
 52    async def cancel(self, id: str):
 53        """Cancel a Buy link purchase intent.
 54
 55        API endpoint: ``/purchase_intents/cancel``.
 56
 57        Args:
 58            id (str): Unique identifier of the id.
 59
 60        Returns:
 61            ``PurchaseIntent`` decoded from the documented response shape.
 62
 63        Raises:
 64            APIError: The API rejected the request or could not complete it.
 65            NetworkError: The request could not reach the Inttegro API.
 66            TimeoutError: The configured request deadline elapsed.
 67        """
 68        return await self.http.post('/purchase_intents/cancel', {'id': id})
 69
 70    async def lookup(self, id: str):
 71        """Retrieve a Buy link purchase intent by ID.
 72
 73        API endpoint: ``/purchase_intents/lookup``.
 74
 75        Args:
 76            id (str): Unique identifier of the id.
 77
 78        Returns:
 79            ``PurchaseIntent`` decoded from the documented response shape.
 80
 81        Raises:
 82            APIError: The API rejected the request or could not complete it.
 83            NetworkError: The request could not reach the Inttegro API.
 84            TimeoutError: The configured request deadline elapsed.
 85        """
 86        return await self.http.post('/purchase_intents/lookup', {'id': id})
 87
 88    async def page(self, payload: dict):
 89        """List Buy link purchase intents.
 90
 91        API endpoint: ``/purchase_intents/page``.
 92
 93        Args:
 94            payload (dict): Typed request object or equivalent request mapping for this operation.
 95
 96        Returns:
 97            ``Page`` decoded from the documented response shape.
 98
 99        Raises:
100            APIError: The API rejected the request or could not complete it.
101            NetworkError: The request could not reach the Inttegro API.
102            TimeoutError: The configured request deadline elapsed.
103        """
104        return await self.http.post('/purchase_intents/page', payload)

Create, update, cancel, look up, and page Buy link purchase intents.

Access this service as AsyncInttegroClient.purchase_intents. Methods use the client's shared transport and return the typed resource shapes documented below.

AsyncPurchaseIntents(http: inttegro.async_http_client.AsyncHttpClient)
13    def __init__(self, http: AsyncHttpClient):
14        self.http = http
http
async def create( self, payload: inttegro.purchase_intent.CreateRequest) -> inttegro.purchase_intent.PurchaseIntent:
16    async def create(self, payload: dict):
17        """Create a Buy link purchase intent.
18
19        API endpoint: ``/purchase_intents/create``.
20
21        Args:
22            payload (dict): Typed request object or equivalent request mapping for this operation.
23
24        Returns:
25            ``PurchaseIntent`` decoded from the documented response shape.
26
27        Raises:
28            APIError: The API rejected the request or could not complete it.
29            NetworkError: The request could not reach the Inttegro API.
30            TimeoutError: The configured request deadline elapsed.
31        """
32        return await self.http.post('/purchase_intents/create', payload)

Create a Buy link purchase intent.

API endpoint: /purchase_intents/create.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

PurchaseIntent decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
async def update( self, payload: inttegro.purchase_intent.UpdateRequest) -> inttegro.purchase_intent.PurchaseIntent:
34    async def update(self, payload: dict):
35        """Update mutable Buy link purchase intent fields.
36
37        API endpoint: ``/purchase_intents/update``.
38
39        Args:
40            payload (dict): Typed request object or equivalent request mapping for this operation.
41
42        Returns:
43            ``PurchaseIntent`` decoded from the documented response shape.
44
45        Raises:
46            APIError: The API rejected the request or could not complete it.
47            NetworkError: The request could not reach the Inttegro API.
48            TimeoutError: The configured request deadline elapsed.
49        """
50        return await self.http.post('/purchase_intents/update', payload)

Update mutable Buy link purchase intent fields.

API endpoint: /purchase_intents/update.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

PurchaseIntent decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
async def cancel(self, id: str) -> inttegro.purchase_intent.PurchaseIntent:
52    async def cancel(self, id: str):
53        """Cancel a Buy link purchase intent.
54
55        API endpoint: ``/purchase_intents/cancel``.
56
57        Args:
58            id (str): Unique identifier of the id.
59
60        Returns:
61            ``PurchaseIntent`` decoded from the documented response shape.
62
63        Raises:
64            APIError: The API rejected the request or could not complete it.
65            NetworkError: The request could not reach the Inttegro API.
66            TimeoutError: The configured request deadline elapsed.
67        """
68        return await self.http.post('/purchase_intents/cancel', {'id': id})

Cancel a Buy link purchase intent.

API endpoint: /purchase_intents/cancel.

Arguments:
  • id (str): Unique identifier of the id.
Returns:

PurchaseIntent decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
async def lookup(self, id: str) -> inttegro.purchase_intent.PurchaseIntent:
70    async def lookup(self, id: str):
71        """Retrieve a Buy link purchase intent by ID.
72
73        API endpoint: ``/purchase_intents/lookup``.
74
75        Args:
76            id (str): Unique identifier of the id.
77
78        Returns:
79            ``PurchaseIntent`` decoded from the documented response shape.
80
81        Raises:
82            APIError: The API rejected the request or could not complete it.
83            NetworkError: The request could not reach the Inttegro API.
84            TimeoutError: The configured request deadline elapsed.
85        """
86        return await self.http.post('/purchase_intents/lookup', {'id': id})

Retrieve a Buy link purchase intent by ID.

API endpoint: /purchase_intents/lookup.

Arguments:
  • id (str): Unique identifier of the id.
Returns:

PurchaseIntent decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.
async def page( self, payload: inttegro.purchase_intent.PageRequest) -> inttegro.purchase_intent.Page:
 88    async def page(self, payload: dict):
 89        """List Buy link purchase intents.
 90
 91        API endpoint: ``/purchase_intents/page``.
 92
 93        Args:
 94            payload (dict): Typed request object or equivalent request mapping for this operation.
 95
 96        Returns:
 97            ``Page`` decoded from the documented response shape.
 98
 99        Raises:
100            APIError: The API rejected the request or could not complete it.
101            NetworkError: The request could not reach the Inttegro API.
102            TimeoutError: The configured request deadline elapsed.
103        """
104        return await self.http.post('/purchase_intents/page', payload)

List Buy link purchase intents.

API endpoint: /purchase_intents/page.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:

Page decoded from the documented response shape.

Raises:
  • APIError: The API rejected the request or could not complete it.
  • NetworkError: The request could not reach the Inttegro API.
  • TimeoutError: The configured request deadline elapsed.