inttegro.resources.customers

Generated public typing surface. Do not edit by hand.

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

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

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

Customers(http: inttegro.http_client.HttpClient)
16    def __init__(self, http: HttpClient):
17        self.http = http
http
def create( self, payload: inttegro.customer.CreateRequest) -> inttegro.customer.Customer:
19    def create(self, payload: dict):
20        """Create a customer record.
21
22        API endpoint: ``/customers/create``.
23
24        Args:
25            payload (dict): Typed request object or equivalent request mapping for this operation.
26
27        Returns:
28            ``Customer`` decoded from the documented response shape.
29
30        Raises:
31            APIError: The API rejected the request or could not complete it.
32            NetworkError: The request could not reach the Inttegro API.
33            TimeoutError: The configured request deadline elapsed.
34        """
35        return 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.
def lookup(self, customer_id: str) -> inttegro.customer.Customer:
37    def lookup(self, customer_id: str):
38        """Lookup a customer by ID.
39
40        API endpoint: ``/customers/lookup``.
41
42        Args:
43            customer_id (str): Unique identifier of the customer.
44
45        Returns:
46            ``Customer`` decoded from the documented response shape.
47
48        Raises:
49            APIError: The API rejected the request or could not complete it.
50            NetworkError: The request could not reach the Inttegro API.
51            TimeoutError: The configured request deadline elapsed.
52        """
53        return 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.
def update( self, payload: inttegro.customer.UpdateRequest, idempotency_key: str | None = None) -> inttegro.customer.Customer:
55    def update(self, payload: dict, idempotency_key: str | None = None):
56        """Update supplied fields on a customer record.
57
58        API endpoint: ``/customers/update``.
59
60        Args:
61            payload (dict): Typed request object or equivalent request mapping for this operation.
62            idempotency_key (str | None): Optional stable key to reuse when retrying the same logical write.
63
64        Returns:
65            ``Customer`` decoded from the documented response shape.
66
67        Raises:
68            APIError: The API rejected the request or could not complete it.
69            NetworkError: The request could not reach the Inttegro API.
70            TimeoutError: The configured request deadline elapsed.
71        """
72        headers = {"Idempotency-Key": idempotency_key} if idempotency_key else {}
73        return 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.
def page( self, payload: inttegro.customer.PageRequest | None = None) -> inttegro.customer.Page:
75    def page(self, payload: dict | None = None):
76        """Page through customers.
77
78        API endpoint: ``/customers/page``.
79
80        Args:
81            payload (dict | None): Typed request object or equivalent request mapping for this operation.
82
83        Returns:
84            ``Page`` decoded from the documented response shape.
85
86        Raises:
87            APIError: The API rejected the request or could not complete it.
88            NetworkError: The request could not reach the Inttegro API.
89            TimeoutError: The configured request deadline elapsed.
90        """
91        return 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.
def search( self, payload: inttegro.search.Request) -> inttegro.search.Page:
93    def search(self, payload: SearchRequest) -> SearchPage:
94        """Search customer projections owned by the authenticated application."""
95        return self.http.post("/customers/search", payload)

Search customer projections owned by the authenticated application.