convexity-api-client 0.21.0.dev332__py3-none-any.whl → 0.21.0.dev336__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (140) hide show
  1. convexity_api_client/api/v1/crm_create_sales_rep.py +186 -0
  2. convexity_api_client/api/v1/crm_delete_sales_rep.py +182 -0
  3. convexity_api_client/api/v1/crm_get_sales_rep.py +182 -0
  4. convexity_api_client/api/v1/crm_list_sales_reps.py +236 -0
  5. convexity_api_client/api/v1/crm_update_sales_rep.py +202 -0
  6. convexity_api_client/api/v1/inventory_assign_item_warehouse_location.py +206 -0
  7. convexity_api_client/api/v1/inventory_create_cost_list_vendor_assignment.py +202 -0
  8. convexity_api_client/api/v1/inventory_create_price_list_channel_assignment.py +202 -0
  9. convexity_api_client/api/v1/inventory_create_price_list_customer_assignment.py +202 -0
  10. convexity_api_client/api/v1/inventory_delete_cost_list_vendor_assignment.py +196 -0
  11. convexity_api_client/api/v1/inventory_delete_price_list_channel_assignment.py +196 -0
  12. convexity_api_client/api/v1/inventory_delete_price_list_customer_assignment.py +196 -0
  13. convexity_api_client/api/v1/inventory_list_cost_list_vendor_assignments.py +202 -0
  14. convexity_api_client/api/v1/inventory_list_item_cost_list_entries.py +182 -0
  15. convexity_api_client/api/v1/inventory_list_item_price_list_entries.py +182 -0
  16. convexity_api_client/api/v1/inventory_list_item_warehouse_locations.py +212 -0
  17. convexity_api_client/api/v1/inventory_list_price_list_channel_assignments.py +202 -0
  18. convexity_api_client/api/v1/inventory_list_price_list_customer_assignments.py +202 -0
  19. convexity_api_client/api/v1/inventory_list_warehouse_location_items.py +226 -0
  20. convexity_api_client/api/v1/inventory_update_cost_list_vendor_assignment.py +216 -0
  21. convexity_api_client/api/v1/inventory_update_price_list_channel_assignment.py +216 -0
  22. convexity_api_client/api/v1/inventory_update_price_list_customer_assignment.py +216 -0
  23. convexity_api_client/api/v1/purchasing_create_item_sourcing.py +190 -0
  24. convexity_api_client/api/v1/purchasing_deactivate_item_sourcing.py +182 -0
  25. convexity_api_client/api/v1/purchasing_get_item_sourcing_options.py +166 -0
  26. convexity_api_client/api/v1/purchasing_list_item_sourcing.py +382 -0
  27. convexity_api_client/api/v1/purchasing_update_item_sourcing.py +202 -0
  28. convexity_api_client/api/v1/purchasing_upsert_item_sourcing_cost.py +206 -0
  29. convexity_api_client/api/v1/sales_list_orders.py +20 -0
  30. convexity_api_client/api/v1/warehouse_workflow_cancel_pick_pack_ship.py +182 -0
  31. convexity_api_client/api/v1/warehouse_workflow_complete_pick_pack_ship_pack.py +202 -0
  32. convexity_api_client/api/v1/warehouse_workflow_complete_pick_pack_ship_pick.py +202 -0
  33. convexity_api_client/api/v1/warehouse_workflow_create_pick_pack_ship.py +186 -0
  34. convexity_api_client/api/v1/warehouse_workflow_generate_pick_pack_ship_pdf.py +188 -0
  35. convexity_api_client/api/v1/warehouse_workflow_get_pick_pack_ship.py +182 -0
  36. convexity_api_client/api/v1/warehouse_workflow_mark_pick_pack_ship_shipped.py +202 -0
  37. convexity_api_client/api/v1/warehouse_workflow_save_pick_pack_ship_shipment.py +202 -0
  38. convexity_api_client/models/__init__.py +134 -0
  39. convexity_api_client/models/adjust_stock_request.py +20 -8
  40. convexity_api_client/models/assign_inventory_item_location_request.py +108 -0
  41. convexity_api_client/models/assign_inventory_item_location_request_ext_data_type_0.py +47 -0
  42. convexity_api_client/models/bulk_upsert_customer_payload.py +20 -0
  43. convexity_api_client/models/bulk_upsert_sales_order_payload.py +40 -0
  44. convexity_api_client/models/complete_pick_pack_ship_pack_request.py +75 -0
  45. convexity_api_client/models/complete_pick_pack_ship_request.py +97 -0
  46. convexity_api_client/models/cost_list_entry_response.py +77 -0
  47. convexity_api_client/models/cost_list_vendor_assignment_response.py +149 -0
  48. convexity_api_client/models/cost_list_vendor_assignment_response_ext_data_type_0.py +47 -0
  49. convexity_api_client/models/cost_rule.py +53 -0
  50. convexity_api_client/models/cost_rule_response.py +22 -0
  51. convexity_api_client/models/cost_source_type.py +9 -0
  52. convexity_api_client/models/create_cost_list_request.py +4 -5
  53. convexity_api_client/models/create_cost_list_vendor_assignment_request.py +116 -0
  54. convexity_api_client/models/create_cost_list_vendor_assignment_request_ext_data_type_0.py +47 -0
  55. convexity_api_client/models/create_customer_request.py +20 -0
  56. convexity_api_client/models/create_item_sourcing_request.py +256 -0
  57. convexity_api_client/models/create_item_sourcing_request_ext_data_type_0.py +47 -0
  58. convexity_api_client/models/create_pick_pack_ship_request.py +153 -0
  59. convexity_api_client/models/create_price_list_channel_assignment_request.py +116 -0
  60. convexity_api_client/models/create_price_list_channel_assignment_request_ext_data_type_0.py +47 -0
  61. convexity_api_client/models/create_price_list_customer_assignment_request.py +116 -0
  62. convexity_api_client/models/create_price_list_customer_assignment_request_ext_data_type_0.py +47 -0
  63. convexity_api_client/models/create_price_list_request.py +4 -5
  64. convexity_api_client/models/create_sales_order_line_request.py +40 -8
  65. convexity_api_client/models/create_sales_order_request.py +40 -0
  66. convexity_api_client/models/create_sales_rep_request.py +181 -0
  67. convexity_api_client/models/create_sales_rep_request_ext_data_type_0.py +47 -0
  68. convexity_api_client/models/customer.py +53 -0
  69. convexity_api_client/models/customer_response.py +14 -0
  70. convexity_api_client/models/inventory_config.py +53 -0
  71. convexity_api_client/models/inventory_config_response.py +28 -0
  72. convexity_api_client/models/inventory_item.py +43 -0
  73. convexity_api_client/models/inventory_item_location.py +237 -0
  74. convexity_api_client/models/inventory_item_location_assignment_response.py +150 -0
  75. convexity_api_client/models/inventory_item_location_assignment_response_ext_data_type_0.py +47 -0
  76. convexity_api_client/models/inventory_item_type.py +0 -1
  77. convexity_api_client/models/item_sourcing.py +41 -0
  78. convexity_api_client/models/item_sourcing_item_option.py +107 -0
  79. convexity_api_client/models/item_sourcing_options_response.py +120 -0
  80. convexity_api_client/models/item_sourcing_response.py +360 -0
  81. convexity_api_client/models/item_sourcing_response_ext_data_type_0.py +47 -0
  82. convexity_api_client/models/item_sourcing_uom_option.py +77 -0
  83. convexity_api_client/models/item_sourcing_vendor_option.py +77 -0
  84. convexity_api_client/models/item_warehouse_location_response.py +248 -0
  85. convexity_api_client/models/list_cost_list_entries_response.py +83 -0
  86. convexity_api_client/models/list_cost_list_vendor_assignments_response.py +83 -0
  87. convexity_api_client/models/list_item_sourcing_response.py +83 -0
  88. convexity_api_client/models/list_item_warehouse_locations_response.py +83 -0
  89. convexity_api_client/models/list_price_list_channel_assignments_response.py +83 -0
  90. convexity_api_client/models/list_price_list_customer_assignments_response.py +83 -0
  91. convexity_api_client/models/list_price_list_entries_response.py +83 -0
  92. convexity_api_client/models/list_sales_reps_response.py +83 -0
  93. convexity_api_client/models/list_warehouse_location_items_response.py +83 -0
  94. convexity_api_client/models/mark_pick_pack_ship_shipped_request.py +84 -0
  95. convexity_api_client/models/pick_pack_ship_line_request.py +100 -0
  96. convexity_api_client/models/pick_pack_ship_packed_line_request.py +111 -0
  97. convexity_api_client/models/pick_pack_ship_picked_line_request.py +91 -0
  98. convexity_api_client/models/pick_pack_ship_response.py +111 -0
  99. convexity_api_client/models/price_list.py +41 -0
  100. convexity_api_client/models/price_list_channel_assignment_response.py +149 -0
  101. convexity_api_client/models/price_list_channel_assignment_response_ext_data_type_0.py +47 -0
  102. convexity_api_client/models/price_list_customer_assignment_response.py +149 -0
  103. convexity_api_client/models/price_list_customer_assignment_response_ext_data_type_0.py +47 -0
  104. convexity_api_client/models/price_list_entry_response.py +77 -0
  105. convexity_api_client/models/price_source_type.py +9 -0
  106. convexity_api_client/models/project.py +43 -0
  107. convexity_api_client/models/purchase_order_line.py +101 -0
  108. convexity_api_client/models/purchase_order_line_request.py +20 -8
  109. convexity_api_client/models/purchase_order_line_response.py +103 -0
  110. convexity_api_client/models/purchasing_list_item_sourcing_filter_operator_type_0.py +19 -0
  111. convexity_api_client/models/purchasing_list_item_sourcing_sort_direction_type_0.py +9 -0
  112. convexity_api_client/models/resolve_cost_response.py +22 -0
  113. convexity_api_client/models/resolve_price_response.py +20 -0
  114. convexity_api_client/models/sales_invoice_line.py +121 -0
  115. convexity_api_client/models/sales_invoice_line_request.py +40 -8
  116. convexity_api_client/models/sales_invoice_line_response.py +121 -0
  117. convexity_api_client/models/sales_order.py +73 -0
  118. convexity_api_client/models/sales_order_line.py +121 -0
  119. convexity_api_client/models/sales_order_line_response.py +123 -0
  120. convexity_api_client/models/sales_order_response.py +28 -0
  121. convexity_api_client/models/sales_rep.py +279 -0
  122. convexity_api_client/models/sales_rep_response.py +185 -0
  123. convexity_api_client/models/sales_rep_response_ext_data_type_0.py +47 -0
  124. convexity_api_client/models/save_pick_pack_ship_shipment_request.py +163 -0
  125. convexity_api_client/models/stock_balance.py +20 -8
  126. convexity_api_client/models/update_customer_request.py +20 -0
  127. convexity_api_client/models/update_item_sourcing_request.py +312 -0
  128. convexity_api_client/models/update_item_sourcing_request_ext_data_type_0.py +47 -0
  129. convexity_api_client/models/update_list_assignment_request.py +111 -0
  130. convexity_api_client/models/update_list_assignment_request_ext_data_type_0.py +47 -0
  131. convexity_api_client/models/update_sales_order_request.py +40 -0
  132. convexity_api_client/models/update_sales_rep_request.py +211 -0
  133. convexity_api_client/models/update_sales_rep_request_ext_data_type_0.py +47 -0
  134. convexity_api_client/models/upsert_inventory_config_request.py +40 -0
  135. convexity_api_client/models/upsert_item_sourcing_cost_request.py +62 -0
  136. convexity_api_client/models/warehouse_location.py +43 -0
  137. convexity_api_client/models/warehouse_location_item_response.py +160 -0
  138. {convexity_api_client-0.21.0.dev332.dist-info → convexity_api_client-0.21.0.dev336.dist-info}/METADATA +1 -1
  139. {convexity_api_client-0.21.0.dev332.dist-info → convexity_api_client-0.21.0.dev336.dist-info}/RECORD +140 -41
  140. {convexity_api_client-0.21.0.dev332.dist-info → convexity_api_client-0.21.0.dev336.dist-info}/WHEEL +1 -1
@@ -0,0 +1,236 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.http_validation_error import HTTPValidationError
9
+ from ...models.list_sales_reps_response import ListSalesRepsResponse
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ search: None | str | Unset = UNSET,
16
+ is_active: bool | None | Unset = UNSET,
17
+ limit: int | Unset = 50,
18
+ offset: int | Unset = 0,
19
+ project_id: str,
20
+ ) -> dict[str, Any]:
21
+
22
+ params: dict[str, Any] = {}
23
+
24
+ json_search: None | str | Unset
25
+ if isinstance(search, Unset):
26
+ json_search = UNSET
27
+ else:
28
+ json_search = search
29
+ params["search"] = json_search
30
+
31
+ json_is_active: bool | None | Unset
32
+ if isinstance(is_active, Unset):
33
+ json_is_active = UNSET
34
+ else:
35
+ json_is_active = is_active
36
+ params["is_active"] = json_is_active
37
+
38
+ params["limit"] = limit
39
+
40
+ params["offset"] = offset
41
+
42
+ params["projectId"] = project_id
43
+
44
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
45
+
46
+ _kwargs: dict[str, Any] = {
47
+ "method": "get",
48
+ "url": "/v1/apps/crm/sales-reps",
49
+ "params": params,
50
+ }
51
+
52
+ return _kwargs
53
+
54
+
55
+ def _parse_response(
56
+ *, client: AuthenticatedClient | Client, response: httpx.Response
57
+ ) -> HTTPValidationError | ListSalesRepsResponse | None:
58
+ if response.status_code == 200:
59
+ response_200 = ListSalesRepsResponse.from_dict(response.json())
60
+
61
+ return response_200
62
+
63
+ if response.status_code == 422:
64
+ response_422 = HTTPValidationError.from_dict(response.json())
65
+
66
+ return response_422
67
+
68
+ if client.raise_on_unexpected_status:
69
+ raise errors.UnexpectedStatus(response.status_code, response.content)
70
+ else:
71
+ return None
72
+
73
+
74
+ def _build_response(
75
+ *, client: AuthenticatedClient | Client, response: httpx.Response
76
+ ) -> Response[HTTPValidationError | ListSalesRepsResponse]:
77
+ return Response(
78
+ status_code=HTTPStatus(response.status_code),
79
+ content=response.content,
80
+ headers=response.headers,
81
+ parsed=_parse_response(client=client, response=response),
82
+ )
83
+
84
+
85
+ def sync_detailed(
86
+ *,
87
+ client: AuthenticatedClient | Client,
88
+ search: None | str | Unset = UNSET,
89
+ is_active: bool | None | Unset = UNSET,
90
+ limit: int | Unset = 50,
91
+ offset: int | Unset = 0,
92
+ project_id: str,
93
+ ) -> Response[HTTPValidationError | ListSalesRepsResponse]:
94
+ """List Sales Reps
95
+
96
+ Args:
97
+ search (None | str | Unset):
98
+ is_active (bool | None | Unset):
99
+ limit (int | Unset): Default: 50.
100
+ offset (int | Unset): Default: 0.
101
+ project_id (str):
102
+
103
+ Raises:
104
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
105
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
106
+
107
+ Returns:
108
+ Response[HTTPValidationError | ListSalesRepsResponse]
109
+ """
110
+
111
+ kwargs = _get_kwargs(
112
+ search=search,
113
+ is_active=is_active,
114
+ limit=limit,
115
+ offset=offset,
116
+ project_id=project_id,
117
+ )
118
+
119
+ response = client.get_httpx_client().request(
120
+ **kwargs,
121
+ )
122
+
123
+ return _build_response(client=client, response=response)
124
+
125
+
126
+ def sync(
127
+ *,
128
+ client: AuthenticatedClient | Client,
129
+ search: None | str | Unset = UNSET,
130
+ is_active: bool | None | Unset = UNSET,
131
+ limit: int | Unset = 50,
132
+ offset: int | Unset = 0,
133
+ project_id: str,
134
+ ) -> HTTPValidationError | ListSalesRepsResponse | None:
135
+ """List Sales Reps
136
+
137
+ Args:
138
+ search (None | str | Unset):
139
+ is_active (bool | None | Unset):
140
+ limit (int | Unset): Default: 50.
141
+ offset (int | Unset): Default: 0.
142
+ project_id (str):
143
+
144
+ Raises:
145
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
146
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
147
+
148
+ Returns:
149
+ HTTPValidationError | ListSalesRepsResponse
150
+ """
151
+
152
+ return sync_detailed(
153
+ client=client,
154
+ search=search,
155
+ is_active=is_active,
156
+ limit=limit,
157
+ offset=offset,
158
+ project_id=project_id,
159
+ ).parsed
160
+
161
+
162
+ async def asyncio_detailed(
163
+ *,
164
+ client: AuthenticatedClient | Client,
165
+ search: None | str | Unset = UNSET,
166
+ is_active: bool | None | Unset = UNSET,
167
+ limit: int | Unset = 50,
168
+ offset: int | Unset = 0,
169
+ project_id: str,
170
+ ) -> Response[HTTPValidationError | ListSalesRepsResponse]:
171
+ """List Sales Reps
172
+
173
+ Args:
174
+ search (None | str | Unset):
175
+ is_active (bool | None | Unset):
176
+ limit (int | Unset): Default: 50.
177
+ offset (int | Unset): Default: 0.
178
+ project_id (str):
179
+
180
+ Raises:
181
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
182
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
183
+
184
+ Returns:
185
+ Response[HTTPValidationError | ListSalesRepsResponse]
186
+ """
187
+
188
+ kwargs = _get_kwargs(
189
+ search=search,
190
+ is_active=is_active,
191
+ limit=limit,
192
+ offset=offset,
193
+ project_id=project_id,
194
+ )
195
+
196
+ response = await client.get_async_httpx_client().request(**kwargs)
197
+
198
+ return _build_response(client=client, response=response)
199
+
200
+
201
+ async def asyncio(
202
+ *,
203
+ client: AuthenticatedClient | Client,
204
+ search: None | str | Unset = UNSET,
205
+ is_active: bool | None | Unset = UNSET,
206
+ limit: int | Unset = 50,
207
+ offset: int | Unset = 0,
208
+ project_id: str,
209
+ ) -> HTTPValidationError | ListSalesRepsResponse | None:
210
+ """List Sales Reps
211
+
212
+ Args:
213
+ search (None | str | Unset):
214
+ is_active (bool | None | Unset):
215
+ limit (int | Unset): Default: 50.
216
+ offset (int | Unset): Default: 0.
217
+ project_id (str):
218
+
219
+ Raises:
220
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
221
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
222
+
223
+ Returns:
224
+ HTTPValidationError | ListSalesRepsResponse
225
+ """
226
+
227
+ return (
228
+ await asyncio_detailed(
229
+ client=client,
230
+ search=search,
231
+ is_active=is_active,
232
+ limit=limit,
233
+ offset=offset,
234
+ project_id=project_id,
235
+ )
236
+ ).parsed
@@ -0,0 +1,202 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.sales_rep_response import SalesRepResponse
11
+ from ...models.update_sales_rep_request import UpdateSalesRepRequest
12
+ from ...types import UNSET, Response
13
+
14
+
15
+ def _get_kwargs(
16
+ sales_rep_id: str,
17
+ *,
18
+ body: UpdateSalesRepRequest,
19
+ project_id: str,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+
23
+ params: dict[str, Any] = {}
24
+
25
+ params["projectId"] = project_id
26
+
27
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
28
+
29
+ _kwargs: dict[str, Any] = {
30
+ "method": "patch",
31
+ "url": "/v1/apps/crm/sales-reps/{sales_rep_id}".format(
32
+ sales_rep_id=quote(str(sales_rep_id), safe=""),
33
+ ),
34
+ "params": params,
35
+ }
36
+
37
+ _kwargs["json"] = body.to_dict()
38
+
39
+ headers["Content-Type"] = "application/json"
40
+
41
+ _kwargs["headers"] = headers
42
+ return _kwargs
43
+
44
+
45
+ def _parse_response(
46
+ *, client: AuthenticatedClient | Client, response: httpx.Response
47
+ ) -> HTTPValidationError | SalesRepResponse | None:
48
+ if response.status_code == 200:
49
+ response_200 = SalesRepResponse.from_dict(response.json())
50
+
51
+ return response_200
52
+
53
+ if response.status_code == 422:
54
+ response_422 = HTTPValidationError.from_dict(response.json())
55
+
56
+ return response_422
57
+
58
+ if client.raise_on_unexpected_status:
59
+ raise errors.UnexpectedStatus(response.status_code, response.content)
60
+ else:
61
+ return None
62
+
63
+
64
+ def _build_response(
65
+ *, client: AuthenticatedClient | Client, response: httpx.Response
66
+ ) -> Response[HTTPValidationError | SalesRepResponse]:
67
+ return Response(
68
+ status_code=HTTPStatus(response.status_code),
69
+ content=response.content,
70
+ headers=response.headers,
71
+ parsed=_parse_response(client=client, response=response),
72
+ )
73
+
74
+
75
+ def sync_detailed(
76
+ sales_rep_id: str,
77
+ *,
78
+ client: AuthenticatedClient | Client,
79
+ body: UpdateSalesRepRequest,
80
+ project_id: str,
81
+ ) -> Response[HTTPValidationError | SalesRepResponse]:
82
+ """Update Sales Rep
83
+
84
+ Args:
85
+ sales_rep_id (str):
86
+ project_id (str):
87
+ body (UpdateSalesRepRequest):
88
+
89
+ Raises:
90
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
91
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
92
+
93
+ Returns:
94
+ Response[HTTPValidationError | SalesRepResponse]
95
+ """
96
+
97
+ kwargs = _get_kwargs(
98
+ sales_rep_id=sales_rep_id,
99
+ body=body,
100
+ project_id=project_id,
101
+ )
102
+
103
+ response = client.get_httpx_client().request(
104
+ **kwargs,
105
+ )
106
+
107
+ return _build_response(client=client, response=response)
108
+
109
+
110
+ def sync(
111
+ sales_rep_id: str,
112
+ *,
113
+ client: AuthenticatedClient | Client,
114
+ body: UpdateSalesRepRequest,
115
+ project_id: str,
116
+ ) -> HTTPValidationError | SalesRepResponse | None:
117
+ """Update Sales Rep
118
+
119
+ Args:
120
+ sales_rep_id (str):
121
+ project_id (str):
122
+ body (UpdateSalesRepRequest):
123
+
124
+ Raises:
125
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
126
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
127
+
128
+ Returns:
129
+ HTTPValidationError | SalesRepResponse
130
+ """
131
+
132
+ return sync_detailed(
133
+ sales_rep_id=sales_rep_id,
134
+ client=client,
135
+ body=body,
136
+ project_id=project_id,
137
+ ).parsed
138
+
139
+
140
+ async def asyncio_detailed(
141
+ sales_rep_id: str,
142
+ *,
143
+ client: AuthenticatedClient | Client,
144
+ body: UpdateSalesRepRequest,
145
+ project_id: str,
146
+ ) -> Response[HTTPValidationError | SalesRepResponse]:
147
+ """Update Sales Rep
148
+
149
+ Args:
150
+ sales_rep_id (str):
151
+ project_id (str):
152
+ body (UpdateSalesRepRequest):
153
+
154
+ Raises:
155
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
156
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
157
+
158
+ Returns:
159
+ Response[HTTPValidationError | SalesRepResponse]
160
+ """
161
+
162
+ kwargs = _get_kwargs(
163
+ sales_rep_id=sales_rep_id,
164
+ body=body,
165
+ project_id=project_id,
166
+ )
167
+
168
+ response = await client.get_async_httpx_client().request(**kwargs)
169
+
170
+ return _build_response(client=client, response=response)
171
+
172
+
173
+ async def asyncio(
174
+ sales_rep_id: str,
175
+ *,
176
+ client: AuthenticatedClient | Client,
177
+ body: UpdateSalesRepRequest,
178
+ project_id: str,
179
+ ) -> HTTPValidationError | SalesRepResponse | None:
180
+ """Update Sales Rep
181
+
182
+ Args:
183
+ sales_rep_id (str):
184
+ project_id (str):
185
+ body (UpdateSalesRepRequest):
186
+
187
+ Raises:
188
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
189
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
190
+
191
+ Returns:
192
+ HTTPValidationError | SalesRepResponse
193
+ """
194
+
195
+ return (
196
+ await asyncio_detailed(
197
+ sales_rep_id=sales_rep_id,
198
+ client=client,
199
+ body=body,
200
+ project_id=project_id,
201
+ )
202
+ ).parsed
@@ -0,0 +1,206 @@
1
+ from http import HTTPStatus
2
+ from typing import Any
3
+ from urllib.parse import quote
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.assign_inventory_item_location_request import AssignInventoryItemLocationRequest
10
+ from ...models.http_validation_error import HTTPValidationError
11
+ from ...models.inventory_item_location_assignment_response import InventoryItemLocationAssignmentResponse
12
+ from ...types import UNSET, Response
13
+
14
+
15
+ def _get_kwargs(
16
+ item_id: str,
17
+ *,
18
+ body: AssignInventoryItemLocationRequest,
19
+ project_id: str,
20
+ ) -> dict[str, Any]:
21
+ headers: dict[str, Any] = {}
22
+
23
+ params: dict[str, Any] = {}
24
+
25
+ params["projectId"] = project_id
26
+
27
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
28
+
29
+ _kwargs: dict[str, Any] = {
30
+ "method": "post",
31
+ "url": "/v1/apps/inventory/items/{item_id}/warehouse-locations".format(
32
+ item_id=quote(str(item_id), safe=""),
33
+ ),
34
+ "params": params,
35
+ }
36
+
37
+ _kwargs["json"] = body.to_dict()
38
+
39
+ headers["Content-Type"] = "application/json"
40
+
41
+ _kwargs["headers"] = headers
42
+ return _kwargs
43
+
44
+
45
+ def _parse_response(
46
+ *, client: AuthenticatedClient | Client, response: httpx.Response
47
+ ) -> HTTPValidationError | InventoryItemLocationAssignmentResponse | None:
48
+ if response.status_code == 201:
49
+ response_201 = InventoryItemLocationAssignmentResponse.from_dict(response.json())
50
+
51
+ return response_201
52
+
53
+ if response.status_code == 422:
54
+ response_422 = HTTPValidationError.from_dict(response.json())
55
+
56
+ return response_422
57
+
58
+ if client.raise_on_unexpected_status:
59
+ raise errors.UnexpectedStatus(response.status_code, response.content)
60
+ else:
61
+ return None
62
+
63
+
64
+ def _build_response(
65
+ *, client: AuthenticatedClient | Client, response: httpx.Response
66
+ ) -> Response[HTTPValidationError | InventoryItemLocationAssignmentResponse]:
67
+ return Response(
68
+ status_code=HTTPStatus(response.status_code),
69
+ content=response.content,
70
+ headers=response.headers,
71
+ parsed=_parse_response(client=client, response=response),
72
+ )
73
+
74
+
75
+ def sync_detailed(
76
+ item_id: str,
77
+ *,
78
+ client: AuthenticatedClient | Client,
79
+ body: AssignInventoryItemLocationRequest,
80
+ project_id: str,
81
+ ) -> Response[HTTPValidationError | InventoryItemLocationAssignmentResponse]:
82
+ """Assign an item to a warehouse location
83
+
84
+ Args:
85
+ item_id (str):
86
+ project_id (str):
87
+ body (AssignInventoryItemLocationRequest): Assign an inventory item to a warehouse
88
+ location.
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ Response[HTTPValidationError | InventoryItemLocationAssignmentResponse]
96
+ """
97
+
98
+ kwargs = _get_kwargs(
99
+ item_id=item_id,
100
+ body=body,
101
+ project_id=project_id,
102
+ )
103
+
104
+ response = client.get_httpx_client().request(
105
+ **kwargs,
106
+ )
107
+
108
+ return _build_response(client=client, response=response)
109
+
110
+
111
+ def sync(
112
+ item_id: str,
113
+ *,
114
+ client: AuthenticatedClient | Client,
115
+ body: AssignInventoryItemLocationRequest,
116
+ project_id: str,
117
+ ) -> HTTPValidationError | InventoryItemLocationAssignmentResponse | None:
118
+ """Assign an item to a warehouse location
119
+
120
+ Args:
121
+ item_id (str):
122
+ project_id (str):
123
+ body (AssignInventoryItemLocationRequest): Assign an inventory item to a warehouse
124
+ location.
125
+
126
+ Raises:
127
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
128
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
129
+
130
+ Returns:
131
+ HTTPValidationError | InventoryItemLocationAssignmentResponse
132
+ """
133
+
134
+ return sync_detailed(
135
+ item_id=item_id,
136
+ client=client,
137
+ body=body,
138
+ project_id=project_id,
139
+ ).parsed
140
+
141
+
142
+ async def asyncio_detailed(
143
+ item_id: str,
144
+ *,
145
+ client: AuthenticatedClient | Client,
146
+ body: AssignInventoryItemLocationRequest,
147
+ project_id: str,
148
+ ) -> Response[HTTPValidationError | InventoryItemLocationAssignmentResponse]:
149
+ """Assign an item to a warehouse location
150
+
151
+ Args:
152
+ item_id (str):
153
+ project_id (str):
154
+ body (AssignInventoryItemLocationRequest): Assign an inventory item to a warehouse
155
+ location.
156
+
157
+ Raises:
158
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
159
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
160
+
161
+ Returns:
162
+ Response[HTTPValidationError | InventoryItemLocationAssignmentResponse]
163
+ """
164
+
165
+ kwargs = _get_kwargs(
166
+ item_id=item_id,
167
+ body=body,
168
+ project_id=project_id,
169
+ )
170
+
171
+ response = await client.get_async_httpx_client().request(**kwargs)
172
+
173
+ return _build_response(client=client, response=response)
174
+
175
+
176
+ async def asyncio(
177
+ item_id: str,
178
+ *,
179
+ client: AuthenticatedClient | Client,
180
+ body: AssignInventoryItemLocationRequest,
181
+ project_id: str,
182
+ ) -> HTTPValidationError | InventoryItemLocationAssignmentResponse | None:
183
+ """Assign an item to a warehouse location
184
+
185
+ Args:
186
+ item_id (str):
187
+ project_id (str):
188
+ body (AssignInventoryItemLocationRequest): Assign an inventory item to a warehouse
189
+ location.
190
+
191
+ Raises:
192
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
193
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
194
+
195
+ Returns:
196
+ HTTPValidationError | InventoryItemLocationAssignmentResponse
197
+ """
198
+
199
+ return (
200
+ await asyncio_detailed(
201
+ item_id=item_id,
202
+ client=client,
203
+ body=body,
204
+ project_id=project_id,
205
+ )
206
+ ).parsed