inttegro.async_resources.products
Generated public typing surface. Do not edit by hand.
1# Generated by scripts/generate_async_resources.py; do not edit by hand. 2"""Products resource for managing catalog products.""" 3from __future__ import annotations 4from ..async_http_client import AsyncHttpClient 5from inttegro.search import Page as SearchPage, Request as SearchRequest 6 7class AsyncProducts: 8 """Products resource for creating, updating, and managing products. 9 10 Access this service as ``AsyncInttegroClient.products``. 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 product. 18 19 API endpoint: ``/products/create``. 20 21 Args: 22 payload (dict): Typed request object or equivalent request mapping for this operation. 23 24 Returns: 25 ``Product`` 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('/products/create', payload) 33 34 async def add_price(self, payload: dict): 35 """Add a price to a product. 36 37 API endpoint: ``/products/add_price``. 38 39 Args: 40 payload (dict): Typed request object or equivalent request mapping for this operation. 41 42 Returns: 43 ``Price`` 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('/products/add_price', payload) 51 52 async def set_default_unit_price(self, payload: dict): 53 """Set a product's default unit price. 54 55 API endpoint: ``/products/set_default_unit_price``. 56 57 Args: 58 payload (dict): Typed request object or equivalent request mapping for this operation. 59 60 Returns: 61 ``Product`` 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('/products/set_default_unit_price', payload) 69 70 async def lookup(self, product_id: str): 71 """Lookup a product by ID. 72 73 API endpoint: ``/products/lookup``. 74 75 Args: 76 product_id (str): Unique identifier of the product. 77 78 Returns: 79 ``Product`` 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('/products/lookup', {'product_id': product_id}) 87 88 async def update(self, payload: dict): 89 """Update a product. 90 91 API endpoint: ``/products/update``. 92 93 Args: 94 payload (dict): Typed request object or equivalent request mapping for this operation. 95 96 Returns: 97 ``Product`` 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('/products/update', payload) 105 106 async def publish(self, product_id: str): 107 """Publish a product. 108 109 API endpoint: ``/products/publish``. 110 111 Args: 112 product_id (str): Unique identifier of the product. 113 114 Returns: 115 ``Product`` decoded from the documented response shape. 116 117 Raises: 118 APIError: The API rejected the request or could not complete it. 119 NetworkError: The request could not reach the Inttegro API. 120 TimeoutError: The configured request deadline elapsed. 121 """ 122 return await self.http.post('/products/publish', {'product_id': product_id}) 123 124 async def unpublish(self, product_id: str): 125 """Unpublish a product. 126 127 API endpoint: ``/products/unpublish``. 128 129 Args: 130 product_id (str): Unique identifier of the product. 131 132 Returns: 133 ``Product`` decoded from the documented response shape. 134 135 Raises: 136 APIError: The API rejected the request or could not complete it. 137 NetworkError: The request could not reach the Inttegro API. 138 TimeoutError: The configured request deadline elapsed. 139 """ 140 return await self.http.post('/products/unpublish', {'product_id': product_id}) 141 142 async def archive(self, product_id: str): 143 """Archive a product. 144 145 API endpoint: ``/products/archive``. 146 147 Args: 148 product_id (str): Unique identifier of the product. 149 150 Returns: 151 ``Product`` decoded from the documented response shape. 152 153 Raises: 154 APIError: The API rejected the request or could not complete it. 155 NetworkError: The request could not reach the Inttegro API. 156 TimeoutError: The configured request deadline elapsed. 157 """ 158 return await self.http.post('/products/archive', {'product_id': product_id}) 159 160 async def page(self, payload: dict | None=None): 161 """Page through products. 162 163 API endpoint: ``/products/page``. 164 165 Args: 166 payload (dict | None): Typed request object or equivalent request mapping for this operation. 167 168 Returns: 169 ``Page`` decoded from the documented response shape. 170 171 Raises: 172 APIError: The API rejected the request or could not complete it. 173 NetworkError: The request could not reach the Inttegro API. 174 TimeoutError: The configured request deadline elapsed. 175 """ 176 return await self.http.post('/products/page', payload or {}) 177 178 async def search(self, payload: SearchRequest) -> SearchPage: 179 """Search product projections owned by the authenticated application.""" 180 return await self.http.post('/products/search', payload)
8class AsyncProducts: 9 """Products resource for creating, updating, and managing products. 10 11 Access this service as ``AsyncInttegroClient.products``. 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 product. 19 20 API endpoint: ``/products/create``. 21 22 Args: 23 payload (dict): Typed request object or equivalent request mapping for this operation. 24 25 Returns: 26 ``Product`` 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('/products/create', payload) 34 35 async def add_price(self, payload: dict): 36 """Add a price to a product. 37 38 API endpoint: ``/products/add_price``. 39 40 Args: 41 payload (dict): Typed request object or equivalent request mapping for this operation. 42 43 Returns: 44 ``Price`` 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('/products/add_price', payload) 52 53 async def set_default_unit_price(self, payload: dict): 54 """Set a product's default unit price. 55 56 API endpoint: ``/products/set_default_unit_price``. 57 58 Args: 59 payload (dict): Typed request object or equivalent request mapping for this operation. 60 61 Returns: 62 ``Product`` 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 return await self.http.post('/products/set_default_unit_price', payload) 70 71 async def lookup(self, product_id: str): 72 """Lookup a product by ID. 73 74 API endpoint: ``/products/lookup``. 75 76 Args: 77 product_id (str): Unique identifier of the product. 78 79 Returns: 80 ``Product`` decoded from the documented response shape. 81 82 Raises: 83 APIError: The API rejected the request or could not complete it. 84 NetworkError: The request could not reach the Inttegro API. 85 TimeoutError: The configured request deadline elapsed. 86 """ 87 return await self.http.post('/products/lookup', {'product_id': product_id}) 88 89 async def update(self, payload: dict): 90 """Update a product. 91 92 API endpoint: ``/products/update``. 93 94 Args: 95 payload (dict): Typed request object or equivalent request mapping for this operation. 96 97 Returns: 98 ``Product`` decoded from the documented response shape. 99 100 Raises: 101 APIError: The API rejected the request or could not complete it. 102 NetworkError: The request could not reach the Inttegro API. 103 TimeoutError: The configured request deadline elapsed. 104 """ 105 return await self.http.post('/products/update', payload) 106 107 async def publish(self, product_id: str): 108 """Publish a product. 109 110 API endpoint: ``/products/publish``. 111 112 Args: 113 product_id (str): Unique identifier of the product. 114 115 Returns: 116 ``Product`` decoded from the documented response shape. 117 118 Raises: 119 APIError: The API rejected the request or could not complete it. 120 NetworkError: The request could not reach the Inttegro API. 121 TimeoutError: The configured request deadline elapsed. 122 """ 123 return await self.http.post('/products/publish', {'product_id': product_id}) 124 125 async def unpublish(self, product_id: str): 126 """Unpublish a product. 127 128 API endpoint: ``/products/unpublish``. 129 130 Args: 131 product_id (str): Unique identifier of the product. 132 133 Returns: 134 ``Product`` decoded from the documented response shape. 135 136 Raises: 137 APIError: The API rejected the request or could not complete it. 138 NetworkError: The request could not reach the Inttegro API. 139 TimeoutError: The configured request deadline elapsed. 140 """ 141 return await self.http.post('/products/unpublish', {'product_id': product_id}) 142 143 async def archive(self, product_id: str): 144 """Archive a product. 145 146 API endpoint: ``/products/archive``. 147 148 Args: 149 product_id (str): Unique identifier of the product. 150 151 Returns: 152 ``Product`` decoded from the documented response shape. 153 154 Raises: 155 APIError: The API rejected the request or could not complete it. 156 NetworkError: The request could not reach the Inttegro API. 157 TimeoutError: The configured request deadline elapsed. 158 """ 159 return await self.http.post('/products/archive', {'product_id': product_id}) 160 161 async def page(self, payload: dict | None=None): 162 """Page through products. 163 164 API endpoint: ``/products/page``. 165 166 Args: 167 payload (dict | None): Typed request object or equivalent request mapping for this operation. 168 169 Returns: 170 ``Page`` decoded from the documented response shape. 171 172 Raises: 173 APIError: The API rejected the request or could not complete it. 174 NetworkError: The request could not reach the Inttegro API. 175 TimeoutError: The configured request deadline elapsed. 176 """ 177 return await self.http.post('/products/page', payload or {}) 178 179 async def search(self, payload: SearchRequest) -> SearchPage: 180 """Search product projections owned by the authenticated application.""" 181 return await self.http.post('/products/search', payload)
Products resource for creating, updating, and managing products.
Access this service as AsyncInttegroClient.products. Methods use the client's shared transport and return the typed resource shapes documented below.
17 async def create(self, payload: dict): 18 """Create a product. 19 20 API endpoint: ``/products/create``. 21 22 Args: 23 payload (dict): Typed request object or equivalent request mapping for this operation. 24 25 Returns: 26 ``Product`` 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('/products/create', payload)
Create a product.
API endpoint: /products/create.
Arguments:
- payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:
Productdecoded 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.
35 async def add_price(self, payload: dict): 36 """Add a price to a product. 37 38 API endpoint: ``/products/add_price``. 39 40 Args: 41 payload (dict): Typed request object or equivalent request mapping for this operation. 42 43 Returns: 44 ``Price`` 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('/products/add_price', payload)
Add a price to a product.
API endpoint: /products/add_price.
Arguments:
- payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:
Pricedecoded 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.
53 async def set_default_unit_price(self, payload: dict): 54 """Set a product's default unit price. 55 56 API endpoint: ``/products/set_default_unit_price``. 57 58 Args: 59 payload (dict): Typed request object or equivalent request mapping for this operation. 60 61 Returns: 62 ``Product`` 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 return await self.http.post('/products/set_default_unit_price', payload)
Set a product's default unit price.
API endpoint: /products/set_default_unit_price.
Arguments:
- payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:
Productdecoded 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.
71 async def lookup(self, product_id: str): 72 """Lookup a product by ID. 73 74 API endpoint: ``/products/lookup``. 75 76 Args: 77 product_id (str): Unique identifier of the product. 78 79 Returns: 80 ``Product`` decoded from the documented response shape. 81 82 Raises: 83 APIError: The API rejected the request or could not complete it. 84 NetworkError: The request could not reach the Inttegro API. 85 TimeoutError: The configured request deadline elapsed. 86 """ 87 return await self.http.post('/products/lookup', {'product_id': product_id})
Lookup a product by ID.
API endpoint: /products/lookup.
Arguments:
- product_id (str): Unique identifier of the product.
Returns:
Productdecoded 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.
89 async def update(self, payload: dict): 90 """Update a product. 91 92 API endpoint: ``/products/update``. 93 94 Args: 95 payload (dict): Typed request object or equivalent request mapping for this operation. 96 97 Returns: 98 ``Product`` decoded from the documented response shape. 99 100 Raises: 101 APIError: The API rejected the request or could not complete it. 102 NetworkError: The request could not reach the Inttegro API. 103 TimeoutError: The configured request deadline elapsed. 104 """ 105 return await self.http.post('/products/update', payload)
Update a product.
API endpoint: /products/update.
Arguments:
- payload (dict): Typed request object or equivalent request mapping for this operation.
Returns:
Productdecoded 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.
107 async def publish(self, product_id: str): 108 """Publish a product. 109 110 API endpoint: ``/products/publish``. 111 112 Args: 113 product_id (str): Unique identifier of the product. 114 115 Returns: 116 ``Product`` decoded from the documented response shape. 117 118 Raises: 119 APIError: The API rejected the request or could not complete it. 120 NetworkError: The request could not reach the Inttegro API. 121 TimeoutError: The configured request deadline elapsed. 122 """ 123 return await self.http.post('/products/publish', {'product_id': product_id})
Publish a product.
API endpoint: /products/publish.
Arguments:
- product_id (str): Unique identifier of the product.
Returns:
Productdecoded 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.
125 async def unpublish(self, product_id: str): 126 """Unpublish a product. 127 128 API endpoint: ``/products/unpublish``. 129 130 Args: 131 product_id (str): Unique identifier of the product. 132 133 Returns: 134 ``Product`` decoded from the documented response shape. 135 136 Raises: 137 APIError: The API rejected the request or could not complete it. 138 NetworkError: The request could not reach the Inttegro API. 139 TimeoutError: The configured request deadline elapsed. 140 """ 141 return await self.http.post('/products/unpublish', {'product_id': product_id})
Unpublish a product.
API endpoint: /products/unpublish.
Arguments:
- product_id (str): Unique identifier of the product.
Returns:
Productdecoded 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.
143 async def archive(self, product_id: str): 144 """Archive a product. 145 146 API endpoint: ``/products/archive``. 147 148 Args: 149 product_id (str): Unique identifier of the product. 150 151 Returns: 152 ``Product`` decoded from the documented response shape. 153 154 Raises: 155 APIError: The API rejected the request or could not complete it. 156 NetworkError: The request could not reach the Inttegro API. 157 TimeoutError: The configured request deadline elapsed. 158 """ 159 return await self.http.post('/products/archive', {'product_id': product_id})
Archive a product.
API endpoint: /products/archive.
Arguments:
- product_id (str): Unique identifier of the product.
Returns:
Productdecoded 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.
161 async def page(self, payload: dict | None=None): 162 """Page through products. 163 164 API endpoint: ``/products/page``. 165 166 Args: 167 payload (dict | None): Typed request object or equivalent request mapping for this operation. 168 169 Returns: 170 ``Page`` decoded from the documented response shape. 171 172 Raises: 173 APIError: The API rejected the request or could not complete it. 174 NetworkError: The request could not reach the Inttegro API. 175 TimeoutError: The configured request deadline elapsed. 176 """ 177 return await self.http.post('/products/page', payload or {})
Page through products.
API endpoint: /products/page.
Arguments:
- payload (dict | None): Typed request object or equivalent request mapping for this operation.
Returns:
Pagedecoded 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.