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