inttegro.async_resources.customers

Generated public typing surface. Do not edit by hand.

 1# Generated by scripts/generate_async_resources.py; do not edit by hand.
 2"""Customers resource for creating and managing customer records."""
 3from __future__ import annotations
 4from ..async_http_client import AsyncHttpClient
 5from inttegro.search import Page as SearchPage, Request as SearchRequest
 6
 7class AsyncCustomers:
 8    """Customers resource for creating, updating, looking up, and paging customers.
 9
10    Access this service as ``AsyncInttegroClient.customers``. 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 customer record.
18
19        API endpoint: ``/customers/create``.
20
21        Args:
22            payload (dict): Typed request object or equivalent request mapping for this operation.
23
24        Returns:
25            ``Customer`` 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('/customers/create', payload)
33
34    async def lookup(self, customer_id: str):
35        """Lookup a customer by ID.
36
37        API endpoint: ``/customers/lookup``.
38
39        Args:
40            customer_id (str): Unique identifier of the customer.
41
42        Returns:
43            ``Customer`` 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('/customers/lookup', {'customer_id': customer_id})
51
52    async def update(self, payload: dict, idempotency_key: str | None=None):
53        """Update supplied fields on a customer record.
54
55        API endpoint: ``/customers/update``.
56
57        Args:
58            payload (dict): Typed request object or equivalent request mapping for this operation.
59            idempotency_key (str | None): Optional stable key to reuse when retrying the same logical write.
60
61        Returns:
62            ``Customer`` decoded from the documented response shape.
63
64        Raises:
65            APIError: The API rejected the request or could not complete it.
66            NetworkError: The request could not reach the Inttegro API.
67            TimeoutError: The configured request deadline elapsed.
68        """
69        headers = {'Idempotency-Key': idempotency_key} if idempotency_key else {}
70        return await self.http.post_with_headers('/customers/update', payload, headers)
71
72    async def page(self, payload: dict | None=None):
73        """Page through customers.
74
75        API endpoint: ``/customers/page``.
76
77        Args:
78            payload (dict | None): Typed request object or equivalent request mapping for this operation.
79
80        Returns:
81            ``Page`` decoded from the documented response shape.
82
83        Raises:
84            APIError: The API rejected the request or could not complete it.
85            NetworkError: The request could not reach the Inttegro API.
86            TimeoutError: The configured request deadline elapsed.
87        """
88        return await self.http.post('/customers/page', payload or {})
89
90    async def search(self, payload: SearchRequest) -> SearchPage:
91        """Search customer projections owned by the authenticated application."""
92        return await self.http.post('/customers/search', payload)
class AsyncCustomers:
 8class AsyncCustomers:
 9    """Customers resource for creating, updating, looking up, and paging customers.
10
11    Access this service as ``AsyncInttegroClient.customers``. Methods use the client's shared transport and return the typed resource shapes documented below.
12    """
13
14    def __init__(self, http: AsyncHttpClient):
15        self.http = http
16
17    async def create(self, payload: dict):
18        """Create a customer record.
19
20        API endpoint: ``/customers/create``.
21
22        Args:
23            payload (dict): Typed request object or equivalent request mapping for this operation.
24
25        Returns:
26            ``Customer`` decoded from the documented response shape.
27
28        Raises:
29            APIError: The API rejected the request or could not complete it.
30            NetworkError: The request could not reach the Inttegro API.
31            TimeoutError: The configured request deadline elapsed.
32        """
33        return await self.http.post('/customers/create', payload)
34
35    async def lookup(self, customer_id: str):
36        """Lookup a customer by ID.
37
38        API endpoint: ``/customers/lookup``.
39
40        Args:
41            customer_id (str): Unique identifier of the customer.
42
43        Returns:
44            ``Customer`` decoded from the documented response shape.
45
46        Raises:
47            APIError: The API rejected the request or could not complete it.
48            NetworkError: The request could not reach the Inttegro API.
49            TimeoutError: The configured request deadline elapsed.
50        """
51        return await self.http.post('/customers/lookup', {'customer_id': customer_id})
52
53    async def update(self, payload: dict, idempotency_key: str | None=None):
54        """Update supplied fields on a customer record.
55
56        API endpoint: ``/customers/update``.
57
58        Args:
59            payload (dict): Typed request object or equivalent request mapping for this operation.
60            idempotency_key (str | None): Optional stable key to reuse when retrying the same logical write.
61
62        Returns:
63            ``Customer`` decoded from the documented response shape.
64
65        Raises:
66            APIError: The API rejected the request or could not complete it.
67            NetworkError: The request could not reach the Inttegro API.
68            TimeoutError: The configured request deadline elapsed.
69        """
70        headers = {'Idempotency-Key': idempotency_key} if idempotency_key else {}
71        return await self.http.post_with_headers('/customers/update', payload, headers)
72
73    async def page(self, payload: dict | None=None):
74        """Page through customers.
75
76        API endpoint: ``/customers/page``.
77
78        Args:
79            payload (dict | None): Typed request object or equivalent request mapping for this operation.
80
81        Returns:
82            ``Page`` decoded from the documented response shape.
83
84        Raises:
85            APIError: The API rejected the request or could not complete it.
86            NetworkError: The request could not reach the Inttegro API.
87            TimeoutError: The configured request deadline elapsed.
88        """
89        return await self.http.post('/customers/page', payload or {})
90
91    async def search(self, payload: SearchRequest) -> SearchPage:
92        """Search customer projections owned by the authenticated application."""
93        return await self.http.post('/customers/search', payload)

Customers resource for creating, updating, looking up, and paging customers.

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

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

Create a customer record.

API endpoint: /customers/create.

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

Customer 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, customer_id: str) -> inttegro.customer.Customer:
35    async def lookup(self, customer_id: str):
36        """Lookup a customer by ID.
37
38        API endpoint: ``/customers/lookup``.
39
40        Args:
41            customer_id (str): Unique identifier of the customer.
42
43        Returns:
44            ``Customer`` decoded from the documented response shape.
45
46        Raises:
47            APIError: The API rejected the request or could not complete it.
48            NetworkError: The request could not reach the Inttegro API.
49            TimeoutError: The configured request deadline elapsed.
50        """
51        return await self.http.post('/customers/lookup', {'customer_id': customer_id})

Lookup a customer by ID.

API endpoint: /customers/lookup.

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

Customer 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.customer.UpdateRequest, idempotency_key: str | None = None) -> inttegro.customer.Customer:
53    async def update(self, payload: dict, idempotency_key: str | None=None):
54        """Update supplied fields on a customer record.
55
56        API endpoint: ``/customers/update``.
57
58        Args:
59            payload (dict): Typed request object or equivalent request mapping for this operation.
60            idempotency_key (str | None): Optional stable key to reuse when retrying the same logical write.
61
62        Returns:
63            ``Customer`` decoded from the documented response shape.
64
65        Raises:
66            APIError: The API rejected the request or could not complete it.
67            NetworkError: The request could not reach the Inttegro API.
68            TimeoutError: The configured request deadline elapsed.
69        """
70        headers = {'Idempotency-Key': idempotency_key} if idempotency_key else {}
71        return await self.http.post_with_headers('/customers/update', payload, headers)

Update supplied fields on a customer record.

API endpoint: /customers/update.

Arguments:
  • payload (dict): Typed request object or equivalent request mapping for this operation.
  • idempotency_key (str | None): Optional stable key to reuse when retrying the same logical write.
Returns:

Customer 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.customer.PageRequest | None = None) -> inttegro.customer.Page:
73    async def page(self, payload: dict | None=None):
74        """Page through customers.
75
76        API endpoint: ``/customers/page``.
77
78        Args:
79            payload (dict | None): Typed request object or equivalent request mapping for this operation.
80
81        Returns:
82            ``Page`` decoded from the documented response shape.
83
84        Raises:
85            APIError: The API rejected the request or could not complete it.
86            NetworkError: The request could not reach the Inttegro API.
87            TimeoutError: The configured request deadline elapsed.
88        """
89        return await self.http.post('/customers/page', payload or {})

Page through customers.

API endpoint: /customers/page.

Arguments:
  • payload (dict | None): 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.
async def search( self, payload: inttegro.search.Request) -> inttegro.search.Page:
91    async def search(self, payload: SearchRequest) -> SearchPage:
92        """Search customer projections owned by the authenticated application."""
93        return await self.http.post('/customers/search', payload)

Search customer projections owned by the authenticated application.