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,216 @@
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.price_list_customer_assignment_response import PriceListCustomerAssignmentResponse
11
+ from ...models.update_list_assignment_request import UpdateListAssignmentRequest
12
+ from ...types import UNSET, Response
13
+
14
+
15
+ def _get_kwargs(
16
+ price_list_id: str,
17
+ assignment_id: str,
18
+ *,
19
+ body: UpdateListAssignmentRequest,
20
+ project_id: str,
21
+ ) -> dict[str, Any]:
22
+ headers: dict[str, Any] = {}
23
+
24
+ params: dict[str, Any] = {}
25
+
26
+ params["projectId"] = project_id
27
+
28
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
29
+
30
+ _kwargs: dict[str, Any] = {
31
+ "method": "patch",
32
+ "url": "/v1/apps/inventory/price-lists/{price_list_id}/customer-assignments/{assignment_id}".format(
33
+ price_list_id=quote(str(price_list_id), safe=""),
34
+ assignment_id=quote(str(assignment_id), safe=""),
35
+ ),
36
+ "params": params,
37
+ }
38
+
39
+ _kwargs["json"] = body.to_dict()
40
+
41
+ headers["Content-Type"] = "application/json"
42
+
43
+ _kwargs["headers"] = headers
44
+ return _kwargs
45
+
46
+
47
+ def _parse_response(
48
+ *, client: AuthenticatedClient | Client, response: httpx.Response
49
+ ) -> HTTPValidationError | PriceListCustomerAssignmentResponse | None:
50
+ if response.status_code == 200:
51
+ response_200 = PriceListCustomerAssignmentResponse.from_dict(response.json())
52
+
53
+ return response_200
54
+
55
+ if response.status_code == 422:
56
+ response_422 = HTTPValidationError.from_dict(response.json())
57
+
58
+ return response_422
59
+
60
+ if client.raise_on_unexpected_status:
61
+ raise errors.UnexpectedStatus(response.status_code, response.content)
62
+ else:
63
+ return None
64
+
65
+
66
+ def _build_response(
67
+ *, client: AuthenticatedClient | Client, response: httpx.Response
68
+ ) -> Response[HTTPValidationError | PriceListCustomerAssignmentResponse]:
69
+ return Response(
70
+ status_code=HTTPStatus(response.status_code),
71
+ content=response.content,
72
+ headers=response.headers,
73
+ parsed=_parse_response(client=client, response=response),
74
+ )
75
+
76
+
77
+ def sync_detailed(
78
+ price_list_id: str,
79
+ assignment_id: str,
80
+ *,
81
+ client: AuthenticatedClient | Client,
82
+ body: UpdateListAssignmentRequest,
83
+ project_id: str,
84
+ ) -> Response[HTTPValidationError | PriceListCustomerAssignmentResponse]:
85
+ """Update Price List Customer Assignment
86
+
87
+ Args:
88
+ price_list_id (str):
89
+ assignment_id (str):
90
+ project_id (str):
91
+ body (UpdateListAssignmentRequest):
92
+
93
+ Raises:
94
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
95
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
96
+
97
+ Returns:
98
+ Response[HTTPValidationError | PriceListCustomerAssignmentResponse]
99
+ """
100
+
101
+ kwargs = _get_kwargs(
102
+ price_list_id=price_list_id,
103
+ assignment_id=assignment_id,
104
+ body=body,
105
+ project_id=project_id,
106
+ )
107
+
108
+ response = client.get_httpx_client().request(
109
+ **kwargs,
110
+ )
111
+
112
+ return _build_response(client=client, response=response)
113
+
114
+
115
+ def sync(
116
+ price_list_id: str,
117
+ assignment_id: str,
118
+ *,
119
+ client: AuthenticatedClient | Client,
120
+ body: UpdateListAssignmentRequest,
121
+ project_id: str,
122
+ ) -> HTTPValidationError | PriceListCustomerAssignmentResponse | None:
123
+ """Update Price List Customer Assignment
124
+
125
+ Args:
126
+ price_list_id (str):
127
+ assignment_id (str):
128
+ project_id (str):
129
+ body (UpdateListAssignmentRequest):
130
+
131
+ Raises:
132
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
133
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
134
+
135
+ Returns:
136
+ HTTPValidationError | PriceListCustomerAssignmentResponse
137
+ """
138
+
139
+ return sync_detailed(
140
+ price_list_id=price_list_id,
141
+ assignment_id=assignment_id,
142
+ client=client,
143
+ body=body,
144
+ project_id=project_id,
145
+ ).parsed
146
+
147
+
148
+ async def asyncio_detailed(
149
+ price_list_id: str,
150
+ assignment_id: str,
151
+ *,
152
+ client: AuthenticatedClient | Client,
153
+ body: UpdateListAssignmentRequest,
154
+ project_id: str,
155
+ ) -> Response[HTTPValidationError | PriceListCustomerAssignmentResponse]:
156
+ """Update Price List Customer Assignment
157
+
158
+ Args:
159
+ price_list_id (str):
160
+ assignment_id (str):
161
+ project_id (str):
162
+ body (UpdateListAssignmentRequest):
163
+
164
+ Raises:
165
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
166
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
167
+
168
+ Returns:
169
+ Response[HTTPValidationError | PriceListCustomerAssignmentResponse]
170
+ """
171
+
172
+ kwargs = _get_kwargs(
173
+ price_list_id=price_list_id,
174
+ assignment_id=assignment_id,
175
+ body=body,
176
+ project_id=project_id,
177
+ )
178
+
179
+ response = await client.get_async_httpx_client().request(**kwargs)
180
+
181
+ return _build_response(client=client, response=response)
182
+
183
+
184
+ async def asyncio(
185
+ price_list_id: str,
186
+ assignment_id: str,
187
+ *,
188
+ client: AuthenticatedClient | Client,
189
+ body: UpdateListAssignmentRequest,
190
+ project_id: str,
191
+ ) -> HTTPValidationError | PriceListCustomerAssignmentResponse | None:
192
+ """Update Price List Customer Assignment
193
+
194
+ Args:
195
+ price_list_id (str):
196
+ assignment_id (str):
197
+ project_id (str):
198
+ body (UpdateListAssignmentRequest):
199
+
200
+ Raises:
201
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
202
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
203
+
204
+ Returns:
205
+ HTTPValidationError | PriceListCustomerAssignmentResponse
206
+ """
207
+
208
+ return (
209
+ await asyncio_detailed(
210
+ price_list_id=price_list_id,
211
+ assignment_id=assignment_id,
212
+ client=client,
213
+ body=body,
214
+ project_id=project_id,
215
+ )
216
+ ).parsed
@@ -0,0 +1,190 @@
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.create_item_sourcing_request import CreateItemSourcingRequest
9
+ from ...models.http_validation_error import HTTPValidationError
10
+ from ...models.item_sourcing_response import ItemSourcingResponse
11
+ from ...types import UNSET, Response
12
+
13
+
14
+ def _get_kwargs(
15
+ *,
16
+ body: CreateItemSourcingRequest,
17
+ project_id: str,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ params: dict[str, Any] = {}
22
+
23
+ params["projectId"] = project_id
24
+
25
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
26
+
27
+ _kwargs: dict[str, Any] = {
28
+ "method": "post",
29
+ "url": "/v1/apps/purchasing/item-sourcing",
30
+ "params": params,
31
+ }
32
+
33
+ _kwargs["json"] = body.to_dict()
34
+
35
+ headers["Content-Type"] = "application/json"
36
+
37
+ _kwargs["headers"] = headers
38
+ return _kwargs
39
+
40
+
41
+ def _parse_response(
42
+ *, client: AuthenticatedClient | Client, response: httpx.Response
43
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
44
+ if response.status_code == 201:
45
+ response_201 = ItemSourcingResponse.from_dict(response.json())
46
+
47
+ return response_201
48
+
49
+ if response.status_code == 422:
50
+ response_422 = HTTPValidationError.from_dict(response.json())
51
+
52
+ return response_422
53
+
54
+ if client.raise_on_unexpected_status:
55
+ raise errors.UnexpectedStatus(response.status_code, response.content)
56
+ else:
57
+ return None
58
+
59
+
60
+ def _build_response(
61
+ *, client: AuthenticatedClient | Client, response: httpx.Response
62
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
63
+ return Response(
64
+ status_code=HTTPStatus(response.status_code),
65
+ content=response.content,
66
+ headers=response.headers,
67
+ parsed=_parse_response(client=client, response=response),
68
+ )
69
+
70
+
71
+ def sync_detailed(
72
+ *,
73
+ client: AuthenticatedClient | Client,
74
+ body: CreateItemSourcingRequest,
75
+ project_id: str,
76
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
77
+ """Create Item Sourcing
78
+
79
+ Args:
80
+ project_id (str):
81
+ body (CreateItemSourcingRequest): Create a vendor-to-item sourcing relationship for the
82
+ current project.
83
+
84
+ Raises:
85
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
86
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
87
+
88
+ Returns:
89
+ Response[HTTPValidationError | ItemSourcingResponse]
90
+ """
91
+
92
+ kwargs = _get_kwargs(
93
+ body=body,
94
+ project_id=project_id,
95
+ )
96
+
97
+ response = client.get_httpx_client().request(
98
+ **kwargs,
99
+ )
100
+
101
+ return _build_response(client=client, response=response)
102
+
103
+
104
+ def sync(
105
+ *,
106
+ client: AuthenticatedClient | Client,
107
+ body: CreateItemSourcingRequest,
108
+ project_id: str,
109
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
110
+ """Create Item Sourcing
111
+
112
+ Args:
113
+ project_id (str):
114
+ body (CreateItemSourcingRequest): Create a vendor-to-item sourcing relationship for the
115
+ current project.
116
+
117
+ Raises:
118
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
119
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
120
+
121
+ Returns:
122
+ HTTPValidationError | ItemSourcingResponse
123
+ """
124
+
125
+ return sync_detailed(
126
+ client=client,
127
+ body=body,
128
+ project_id=project_id,
129
+ ).parsed
130
+
131
+
132
+ async def asyncio_detailed(
133
+ *,
134
+ client: AuthenticatedClient | Client,
135
+ body: CreateItemSourcingRequest,
136
+ project_id: str,
137
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
138
+ """Create Item Sourcing
139
+
140
+ Args:
141
+ project_id (str):
142
+ body (CreateItemSourcingRequest): Create a vendor-to-item sourcing relationship for the
143
+ current project.
144
+
145
+ Raises:
146
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
147
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
148
+
149
+ Returns:
150
+ Response[HTTPValidationError | ItemSourcingResponse]
151
+ """
152
+
153
+ kwargs = _get_kwargs(
154
+ body=body,
155
+ project_id=project_id,
156
+ )
157
+
158
+ response = await client.get_async_httpx_client().request(**kwargs)
159
+
160
+ return _build_response(client=client, response=response)
161
+
162
+
163
+ async def asyncio(
164
+ *,
165
+ client: AuthenticatedClient | Client,
166
+ body: CreateItemSourcingRequest,
167
+ project_id: str,
168
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
169
+ """Create Item Sourcing
170
+
171
+ Args:
172
+ project_id (str):
173
+ body (CreateItemSourcingRequest): Create a vendor-to-item sourcing relationship for the
174
+ current project.
175
+
176
+ Raises:
177
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
178
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
179
+
180
+ Returns:
181
+ HTTPValidationError | ItemSourcingResponse
182
+ """
183
+
184
+ return (
185
+ await asyncio_detailed(
186
+ client=client,
187
+ body=body,
188
+ project_id=project_id,
189
+ )
190
+ ).parsed
@@ -0,0 +1,182 @@
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.item_sourcing_response import ItemSourcingResponse
11
+ from ...types import UNSET, Response
12
+
13
+
14
+ def _get_kwargs(
15
+ sourcing_id: str,
16
+ *,
17
+ project_id: str,
18
+ ) -> dict[str, Any]:
19
+
20
+ params: dict[str, Any] = {}
21
+
22
+ params["projectId"] = project_id
23
+
24
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
25
+
26
+ _kwargs: dict[str, Any] = {
27
+ "method": "delete",
28
+ "url": "/v1/apps/purchasing/item-sourcing/{sourcing_id}".format(
29
+ sourcing_id=quote(str(sourcing_id), safe=""),
30
+ ),
31
+ "params": params,
32
+ }
33
+
34
+ return _kwargs
35
+
36
+
37
+ def _parse_response(
38
+ *, client: AuthenticatedClient | Client, response: httpx.Response
39
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
40
+ if response.status_code == 200:
41
+ response_200 = ItemSourcingResponse.from_dict(response.json())
42
+
43
+ return response_200
44
+
45
+ if response.status_code == 422:
46
+ response_422 = HTTPValidationError.from_dict(response.json())
47
+
48
+ return response_422
49
+
50
+ if client.raise_on_unexpected_status:
51
+ raise errors.UnexpectedStatus(response.status_code, response.content)
52
+ else:
53
+ return None
54
+
55
+
56
+ def _build_response(
57
+ *, client: AuthenticatedClient | Client, response: httpx.Response
58
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
59
+ return Response(
60
+ status_code=HTTPStatus(response.status_code),
61
+ content=response.content,
62
+ headers=response.headers,
63
+ parsed=_parse_response(client=client, response=response),
64
+ )
65
+
66
+
67
+ def sync_detailed(
68
+ sourcing_id: str,
69
+ *,
70
+ client: AuthenticatedClient | Client,
71
+ project_id: str,
72
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
73
+ """Deactivate Item Sourcing
74
+
75
+ Args:
76
+ sourcing_id (str):
77
+ project_id (str):
78
+
79
+ Raises:
80
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
81
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
82
+
83
+ Returns:
84
+ Response[HTTPValidationError | ItemSourcingResponse]
85
+ """
86
+
87
+ kwargs = _get_kwargs(
88
+ sourcing_id=sourcing_id,
89
+ project_id=project_id,
90
+ )
91
+
92
+ response = client.get_httpx_client().request(
93
+ **kwargs,
94
+ )
95
+
96
+ return _build_response(client=client, response=response)
97
+
98
+
99
+ def sync(
100
+ sourcing_id: str,
101
+ *,
102
+ client: AuthenticatedClient | Client,
103
+ project_id: str,
104
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
105
+ """Deactivate Item Sourcing
106
+
107
+ Args:
108
+ sourcing_id (str):
109
+ project_id (str):
110
+
111
+ Raises:
112
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
113
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
114
+
115
+ Returns:
116
+ HTTPValidationError | ItemSourcingResponse
117
+ """
118
+
119
+ return sync_detailed(
120
+ sourcing_id=sourcing_id,
121
+ client=client,
122
+ project_id=project_id,
123
+ ).parsed
124
+
125
+
126
+ async def asyncio_detailed(
127
+ sourcing_id: str,
128
+ *,
129
+ client: AuthenticatedClient | Client,
130
+ project_id: str,
131
+ ) -> Response[HTTPValidationError | ItemSourcingResponse]:
132
+ """Deactivate Item Sourcing
133
+
134
+ Args:
135
+ sourcing_id (str):
136
+ project_id (str):
137
+
138
+ Raises:
139
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
140
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
141
+
142
+ Returns:
143
+ Response[HTTPValidationError | ItemSourcingResponse]
144
+ """
145
+
146
+ kwargs = _get_kwargs(
147
+ sourcing_id=sourcing_id,
148
+ project_id=project_id,
149
+ )
150
+
151
+ response = await client.get_async_httpx_client().request(**kwargs)
152
+
153
+ return _build_response(client=client, response=response)
154
+
155
+
156
+ async def asyncio(
157
+ sourcing_id: str,
158
+ *,
159
+ client: AuthenticatedClient | Client,
160
+ project_id: str,
161
+ ) -> HTTPValidationError | ItemSourcingResponse | None:
162
+ """Deactivate Item Sourcing
163
+
164
+ Args:
165
+ sourcing_id (str):
166
+ project_id (str):
167
+
168
+ Raises:
169
+ errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
170
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
171
+
172
+ Returns:
173
+ HTTPValidationError | ItemSourcingResponse
174
+ """
175
+
176
+ return (
177
+ await asyncio_detailed(
178
+ sourcing_id=sourcing_id,
179
+ client=client,
180
+ project_id=project_id,
181
+ )
182
+ ).parsed