ordercloud-python 2026.4.1__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.
- ordercloud/__init__.py +37 -0
- ordercloud/auth.py +136 -0
- ordercloud/client.py +211 -0
- ordercloud/config.py +42 -0
- ordercloud/errors.py +47 -0
- ordercloud/http.py +218 -0
- ordercloud/middleware.py +66 -0
- ordercloud/models/__init__.py +271 -0
- ordercloud/models/address.py +47 -0
- ordercloud/models/api_client.py +116 -0
- ordercloud/models/approval.py +73 -0
- ordercloud/models/assignments.py +402 -0
- ordercloud/models/auth_models.py +114 -0
- ordercloud/models/bundle.py +31 -0
- ordercloud/models/buyer.py +271 -0
- ordercloud/models/catalog.py +33 -0
- ordercloud/models/category.py +35 -0
- ordercloud/models/cost_center.py +27 -0
- ordercloud/models/credit_card.py +35 -0
- ordercloud/models/delivery.py +277 -0
- ordercloud/models/discount.py +63 -0
- ordercloud/models/integration.py +76 -0
- ordercloud/models/inventory_record.py +53 -0
- ordercloud/models/line_item.py +95 -0
- ordercloud/models/line_item_types.py +89 -0
- ordercloud/models/message_sender.py +80 -0
- ordercloud/models/misc.py +280 -0
- ordercloud/models/open_id_connect.py +47 -0
- ordercloud/models/order.py +477 -0
- ordercloud/models/order_return.py +92 -0
- ordercloud/models/payment.py +77 -0
- ordercloud/models/price_schedule.py +76 -0
- ordercloud/models/product.py +227 -0
- ordercloud/models/product_collection.py +186 -0
- ordercloud/models/promotion.py +297 -0
- ordercloud/models/security.py +89 -0
- ordercloud/models/shared.py +131 -0
- ordercloud/models/shipment.py +150 -0
- ordercloud/models/spec.py +67 -0
- ordercloud/models/spending_account.py +33 -0
- ordercloud/models/subscription.py +125 -0
- ordercloud/models/supplier.py +43 -0
- ordercloud/models/sync.py +172 -0
- ordercloud/models/user.py +207 -0
- ordercloud/models/user_group.py +27 -0
- ordercloud/models/webhook.py +58 -0
- ordercloud/py.typed +0 -0
- ordercloud/resources/__init__.py +65 -0
- ordercloud/resources/addresses.py +228 -0
- ordercloud/resources/admin_addresses.py +128 -0
- ordercloud/resources/admin_user_groups.py +185 -0
- ordercloud/resources/admin_users.py +150 -0
- ordercloud/resources/api_clients.py +308 -0
- ordercloud/resources/approval_rules.py +144 -0
- ordercloud/resources/base.py +145 -0
- ordercloud/resources/bundle_line_items.py +59 -0
- ordercloud/resources/bundle_subscription_items.py +54 -0
- ordercloud/resources/bundles.py +278 -0
- ordercloud/resources/buyer_groups.py +128 -0
- ordercloud/resources/buyers.py +164 -0
- ordercloud/resources/cart.py +613 -0
- ordercloud/resources/catalogs.py +311 -0
- ordercloud/resources/categories.py +392 -0
- ordercloud/resources/cost_centers.py +222 -0
- ordercloud/resources/credit_cards.py +227 -0
- ordercloud/resources/delivery_configurations.py +132 -0
- ordercloud/resources/discounts.py +201 -0
- ordercloud/resources/entity_syncs.py +534 -0
- ordercloud/resources/error_configs.py +71 -0
- ordercloud/resources/forgotten_credentials.py +74 -0
- ordercloud/resources/group_orders.py +28 -0
- ordercloud/resources/impersonation_configs.py +132 -0
- ordercloud/resources/incrementors.py +128 -0
- ordercloud/resources/integration_events.py +203 -0
- ordercloud/resources/inventory_integrations.py +65 -0
- ordercloud/resources/inventory_records.py +484 -0
- ordercloud/resources/line_items.py +262 -0
- ordercloud/resources/locales.py +203 -0
- ordercloud/resources/me.py +1882 -0
- ordercloud/resources/message_senders.py +261 -0
- ordercloud/resources/open_id_connects.py +128 -0
- ordercloud/resources/order_returns.py +306 -0
- ordercloud/resources/order_syncs.py +65 -0
- ordercloud/resources/orders.py +689 -0
- ordercloud/resources/payments.py +176 -0
- ordercloud/resources/price_schedules.py +164 -0
- ordercloud/resources/product_collections.py +116 -0
- ordercloud/resources/product_facets.py +128 -0
- ordercloud/resources/product_syncs.py +76 -0
- ordercloud/resources/products.py +454 -0
- ordercloud/resources/promotion_integrations.py +65 -0
- ordercloud/resources/promotions.py +203 -0
- ordercloud/resources/security_profiles.py +222 -0
- ordercloud/resources/seller_approval_rules.py +128 -0
- ordercloud/resources/shipments.py +256 -0
- ordercloud/resources/specs.py +313 -0
- ordercloud/resources/spending_accounts.py +227 -0
- ordercloud/resources/subscription_integrations.py +65 -0
- ordercloud/resources/subscription_items.py +146 -0
- ordercloud/resources/subscriptions.py +128 -0
- ordercloud/resources/supplier_addresses.py +144 -0
- ordercloud/resources/supplier_user_groups.py +210 -0
- ordercloud/resources/supplier_users.py +170 -0
- ordercloud/resources/suppliers.py +190 -0
- ordercloud/resources/tracking_events.py +130 -0
- ordercloud/resources/user_groups.py +210 -0
- ordercloud/resources/users.py +254 -0
- ordercloud/resources/webhooks.py +128 -0
- ordercloud/resources/xp_indices.py +77 -0
- ordercloud/sync_client.py +170 -0
- ordercloud_python-2026.4.1.dist-info/METADATA +552 -0
- ordercloud_python-2026.4.1.dist-info/RECORD +114 -0
- ordercloud_python-2026.4.1.dist-info/WHEEL +4 -0
- ordercloud_python-2026.4.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud ImpersonationConfigs API resource."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Any, Optional, Union
|
|
7
|
+
|
|
8
|
+
from ..models.security import ImpersonationConfig
|
|
9
|
+
from ..models.shared import ListPage
|
|
10
|
+
from .base import BaseResource
|
|
11
|
+
|
|
12
|
+
__all__ = ["ImpersonationConfigsResource"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ImpersonationConfigsResource(BaseResource):
|
|
16
|
+
"""Operations on OrderCloud ImpersonationConfigs."""
|
|
17
|
+
|
|
18
|
+
async def list(
|
|
19
|
+
self,
|
|
20
|
+
*,
|
|
21
|
+
search: Optional[str] = None,
|
|
22
|
+
search_on: Optional[str] = None,
|
|
23
|
+
sort_by: Optional[str] = None,
|
|
24
|
+
page: Optional[int] = None,
|
|
25
|
+
page_size: Optional[int] = None,
|
|
26
|
+
filters: Optional[dict[str, Any]] = None,
|
|
27
|
+
) -> ListPage[ImpersonationConfig]:
|
|
28
|
+
"""List impersonation configs
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
search: Word or phrase to search for.
|
|
32
|
+
search_on: Comma-delimited list of fields to search on.
|
|
33
|
+
sort_by: Comma-delimited list of fields to sort by.
|
|
34
|
+
page: Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.
|
|
35
|
+
page_size: Number of results to return per page.
|
|
36
|
+
filters: An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
A paginated list of ImpersonationConfig objects.
|
|
40
|
+
"""
|
|
41
|
+
params = self._build_list_params(
|
|
42
|
+
search=search,
|
|
43
|
+
search_on=search_on,
|
|
44
|
+
sort_by=sort_by,
|
|
45
|
+
page=page,
|
|
46
|
+
page_size=page_size,
|
|
47
|
+
filters=filters,
|
|
48
|
+
)
|
|
49
|
+
resp = await self._http.get("/impersonationconfig", **params)
|
|
50
|
+
return self._parse_list(resp.json(), ImpersonationConfig)
|
|
51
|
+
|
|
52
|
+
async def create(
|
|
53
|
+
self,
|
|
54
|
+
impersonation_config: Union[ImpersonationConfig, dict[str, Any]],
|
|
55
|
+
) -> ImpersonationConfig:
|
|
56
|
+
"""Create an impersonation config
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
impersonation_config: A ``ImpersonationConfig`` model or dict. Required fields: SecurityProfileID, ClientID.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
The ImpersonationConfig object.
|
|
63
|
+
"""
|
|
64
|
+
resp = await self._http.post(
|
|
65
|
+
"/impersonationconfig", json=self._serialize(impersonation_config)
|
|
66
|
+
)
|
|
67
|
+
return ImpersonationConfig(**resp.json())
|
|
68
|
+
|
|
69
|
+
async def get(
|
|
70
|
+
self,
|
|
71
|
+
impersonation_config_id: str,
|
|
72
|
+
) -> ImpersonationConfig:
|
|
73
|
+
"""Retrieve an impersonation config
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
impersonation_config_id: ID of the impersonation config.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
The ImpersonationConfig object.
|
|
80
|
+
"""
|
|
81
|
+
resp = await self._http.get(f"/impersonationconfig/{impersonation_config_id}")
|
|
82
|
+
return ImpersonationConfig(**resp.json())
|
|
83
|
+
|
|
84
|
+
async def save(
|
|
85
|
+
self,
|
|
86
|
+
impersonation_config_id: str,
|
|
87
|
+
impersonation_config: Union[ImpersonationConfig, dict[str, Any]],
|
|
88
|
+
) -> ImpersonationConfig:
|
|
89
|
+
"""Create or update an impersonation config
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
impersonation_config_id: ID of the impersonation config.
|
|
93
|
+
impersonation_config: A ``ImpersonationConfig`` model or dict. Required fields: SecurityProfileID, ClientID.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
The ImpersonationConfig object.
|
|
97
|
+
"""
|
|
98
|
+
resp = await self._http.put(
|
|
99
|
+
f"/impersonationconfig/{impersonation_config_id}",
|
|
100
|
+
json=self._serialize(impersonation_config),
|
|
101
|
+
)
|
|
102
|
+
return ImpersonationConfig(**resp.json())
|
|
103
|
+
|
|
104
|
+
async def delete(
|
|
105
|
+
self,
|
|
106
|
+
impersonation_config_id: str,
|
|
107
|
+
) -> None:
|
|
108
|
+
"""Delete an impersonation config
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
impersonation_config_id: ID of the impersonation config.
|
|
112
|
+
"""
|
|
113
|
+
await self._http.delete(f"/impersonationconfig/{impersonation_config_id}")
|
|
114
|
+
|
|
115
|
+
async def patch(
|
|
116
|
+
self,
|
|
117
|
+
impersonation_config_id: str,
|
|
118
|
+
partial: dict[str, Any],
|
|
119
|
+
) -> ImpersonationConfig:
|
|
120
|
+
"""Partially update an impersonation config
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
impersonation_config_id: ID of the impersonation config.
|
|
124
|
+
partial: A dict of fields to update.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
The ImpersonationConfig object.
|
|
128
|
+
"""
|
|
129
|
+
resp = await self._http.patch(
|
|
130
|
+
f"/impersonationconfig/{impersonation_config_id}", json=partial
|
|
131
|
+
)
|
|
132
|
+
return ImpersonationConfig(**resp.json())
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud Incrementors API resource."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Any, Optional, Union
|
|
7
|
+
|
|
8
|
+
from ..models.misc import Incrementor
|
|
9
|
+
from ..models.shared import ListPage
|
|
10
|
+
from .base import BaseResource
|
|
11
|
+
|
|
12
|
+
__all__ = ["IncrementorsResource"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class IncrementorsResource(BaseResource):
|
|
16
|
+
"""Operations on OrderCloud Incrementors."""
|
|
17
|
+
|
|
18
|
+
async def list(
|
|
19
|
+
self,
|
|
20
|
+
*,
|
|
21
|
+
search: Optional[str] = None,
|
|
22
|
+
search_on: Optional[str] = None,
|
|
23
|
+
sort_by: Optional[str] = None,
|
|
24
|
+
page: Optional[int] = None,
|
|
25
|
+
page_size: Optional[int] = None,
|
|
26
|
+
filters: Optional[dict[str, Any]] = None,
|
|
27
|
+
) -> ListPage[Incrementor]:
|
|
28
|
+
"""List incrementors
|
|
29
|
+
|
|
30
|
+
Args:
|
|
31
|
+
search: Word or phrase to search for.
|
|
32
|
+
search_on: Comma-delimited list of fields to search on.
|
|
33
|
+
sort_by: Comma-delimited list of fields to sort by.
|
|
34
|
+
page: Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.
|
|
35
|
+
page_size: Number of results to return per page.
|
|
36
|
+
filters: An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'
|
|
37
|
+
|
|
38
|
+
Returns:
|
|
39
|
+
A paginated list of Incrementor objects.
|
|
40
|
+
"""
|
|
41
|
+
params = self._build_list_params(
|
|
42
|
+
search=search,
|
|
43
|
+
search_on=search_on,
|
|
44
|
+
sort_by=sort_by,
|
|
45
|
+
page=page,
|
|
46
|
+
page_size=page_size,
|
|
47
|
+
filters=filters,
|
|
48
|
+
)
|
|
49
|
+
resp = await self._http.get("/incrementors", **params)
|
|
50
|
+
return self._parse_list(resp.json(), Incrementor)
|
|
51
|
+
|
|
52
|
+
async def create(
|
|
53
|
+
self,
|
|
54
|
+
incrementor: Union[Incrementor, dict[str, Any]],
|
|
55
|
+
) -> Incrementor:
|
|
56
|
+
"""Create an incrementor
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
incrementor: A ``Incrementor`` model or dict. Required fields: LastNumber, LeftPaddingCount.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
The Incrementor object.
|
|
63
|
+
"""
|
|
64
|
+
resp = await self._http.post("/incrementors", json=self._serialize(incrementor))
|
|
65
|
+
return Incrementor(**resp.json())
|
|
66
|
+
|
|
67
|
+
async def get(
|
|
68
|
+
self,
|
|
69
|
+
incrementor_id: str,
|
|
70
|
+
) -> Incrementor:
|
|
71
|
+
"""Retrieve an incrementor
|
|
72
|
+
|
|
73
|
+
Args:
|
|
74
|
+
incrementor_id: ID of the incrementor.
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
The Incrementor object.
|
|
78
|
+
"""
|
|
79
|
+
resp = await self._http.get(f"/incrementors/{incrementor_id}")
|
|
80
|
+
return Incrementor(**resp.json())
|
|
81
|
+
|
|
82
|
+
async def save(
|
|
83
|
+
self,
|
|
84
|
+
incrementor_id: str,
|
|
85
|
+
incrementor: Union[Incrementor, dict[str, Any]],
|
|
86
|
+
) -> Incrementor:
|
|
87
|
+
"""Create or update an incrementor
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
incrementor_id: ID of the incrementor.
|
|
91
|
+
incrementor: A ``Incrementor`` model or dict. Required fields: LastNumber, LeftPaddingCount.
|
|
92
|
+
|
|
93
|
+
Returns:
|
|
94
|
+
The Incrementor object.
|
|
95
|
+
"""
|
|
96
|
+
resp = await self._http.put(
|
|
97
|
+
f"/incrementors/{incrementor_id}",
|
|
98
|
+
json=self._serialize(incrementor),
|
|
99
|
+
)
|
|
100
|
+
return Incrementor(**resp.json())
|
|
101
|
+
|
|
102
|
+
async def delete(
|
|
103
|
+
self,
|
|
104
|
+
incrementor_id: str,
|
|
105
|
+
) -> None:
|
|
106
|
+
"""Delete an incrementor
|
|
107
|
+
|
|
108
|
+
Args:
|
|
109
|
+
incrementor_id: ID of the incrementor.
|
|
110
|
+
"""
|
|
111
|
+
await self._http.delete(f"/incrementors/{incrementor_id}")
|
|
112
|
+
|
|
113
|
+
async def patch(
|
|
114
|
+
self,
|
|
115
|
+
incrementor_id: str,
|
|
116
|
+
partial: dict[str, Any],
|
|
117
|
+
) -> Incrementor:
|
|
118
|
+
"""Partially update an incrementor
|
|
119
|
+
|
|
120
|
+
Args:
|
|
121
|
+
incrementor_id: ID of the incrementor.
|
|
122
|
+
partial: A dict of fields to update.
|
|
123
|
+
|
|
124
|
+
Returns:
|
|
125
|
+
The Incrementor object.
|
|
126
|
+
"""
|
|
127
|
+
resp = await self._http.patch(f"/incrementors/{incrementor_id}", json=partial)
|
|
128
|
+
return Incrementor(**resp.json())
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud IntegrationEvents API resource."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Any, Optional, Union
|
|
7
|
+
|
|
8
|
+
from ..models.integration import IntegrationEvent
|
|
9
|
+
from ..models.misc import OrderDirection
|
|
10
|
+
from ..models.order import OrderShipMethodSelection, OrderWorksheet
|
|
11
|
+
from ..models.shared import ListPage
|
|
12
|
+
from .base import BaseResource
|
|
13
|
+
|
|
14
|
+
__all__ = ["IntegrationEventsResource"]
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class IntegrationEventsResource(BaseResource):
|
|
18
|
+
"""Operations on OrderCloud IntegrationEvents."""
|
|
19
|
+
|
|
20
|
+
async def list(
|
|
21
|
+
self,
|
|
22
|
+
*,
|
|
23
|
+
search: Optional[str] = None,
|
|
24
|
+
search_on: Optional[str] = None,
|
|
25
|
+
sort_by: Optional[str] = None,
|
|
26
|
+
page: Optional[int] = None,
|
|
27
|
+
page_size: Optional[int] = None,
|
|
28
|
+
filters: Optional[dict[str, Any]] = None,
|
|
29
|
+
) -> ListPage[IntegrationEvent]:
|
|
30
|
+
"""List integration events
|
|
31
|
+
|
|
32
|
+
Args:
|
|
33
|
+
search: Word or phrase to search for.
|
|
34
|
+
search_on: Comma-delimited list of fields to search on.
|
|
35
|
+
sort_by: Comma-delimited list of fields to sort by.
|
|
36
|
+
page: Page of results to return. When paginating through many items (> page 30), we recommend the "Last ID" method, as outlined in the Advanced Querying documentation.
|
|
37
|
+
page_size: Number of results to return per page.
|
|
38
|
+
filters: An object or dictionary representing key/value pairs to apply as filters. Valid keys are top-level properties of the returned model or 'xp.???'
|
|
39
|
+
|
|
40
|
+
Returns:
|
|
41
|
+
A paginated list of IntegrationEvent objects.
|
|
42
|
+
"""
|
|
43
|
+
params = self._build_list_params(
|
|
44
|
+
search=search,
|
|
45
|
+
search_on=search_on,
|
|
46
|
+
sort_by=sort_by,
|
|
47
|
+
page=page,
|
|
48
|
+
page_size=page_size,
|
|
49
|
+
filters=filters,
|
|
50
|
+
)
|
|
51
|
+
resp = await self._http.get("/integrationEvents", **params)
|
|
52
|
+
return self._parse_list(resp.json(), IntegrationEvent)
|
|
53
|
+
|
|
54
|
+
async def create(
|
|
55
|
+
self,
|
|
56
|
+
integration_event: Union[IntegrationEvent, dict[str, Any]],
|
|
57
|
+
) -> IntegrationEvent:
|
|
58
|
+
"""Create an integration event
|
|
59
|
+
|
|
60
|
+
Args:
|
|
61
|
+
integration_event: A ``IntegrationEvent`` model or dict. Required fields: CustomImplementationUrl, Name, HashKey.
|
|
62
|
+
|
|
63
|
+
Returns:
|
|
64
|
+
The IntegrationEvent object.
|
|
65
|
+
"""
|
|
66
|
+
resp = await self._http.post("/integrationEvents", json=self._serialize(integration_event))
|
|
67
|
+
return IntegrationEvent(**resp.json())
|
|
68
|
+
|
|
69
|
+
async def get(
|
|
70
|
+
self,
|
|
71
|
+
integration_event_id: str,
|
|
72
|
+
) -> IntegrationEvent:
|
|
73
|
+
"""Retrieve an integration event
|
|
74
|
+
|
|
75
|
+
Args:
|
|
76
|
+
integration_event_id: ID of the integration event.
|
|
77
|
+
|
|
78
|
+
Returns:
|
|
79
|
+
The IntegrationEvent object.
|
|
80
|
+
"""
|
|
81
|
+
resp = await self._http.get(f"/integrationEvents/{integration_event_id}")
|
|
82
|
+
return IntegrationEvent(**resp.json())
|
|
83
|
+
|
|
84
|
+
async def save(
|
|
85
|
+
self,
|
|
86
|
+
integration_event_id: str,
|
|
87
|
+
integration_event: Union[IntegrationEvent, dict[str, Any]],
|
|
88
|
+
) -> IntegrationEvent:
|
|
89
|
+
"""Create or update an integration event
|
|
90
|
+
|
|
91
|
+
Args:
|
|
92
|
+
integration_event_id: ID of the integration event.
|
|
93
|
+
integration_event: A ``IntegrationEvent`` model or dict. Required fields: CustomImplementationUrl, Name, HashKey.
|
|
94
|
+
|
|
95
|
+
Returns:
|
|
96
|
+
The IntegrationEvent object.
|
|
97
|
+
"""
|
|
98
|
+
resp = await self._http.put(
|
|
99
|
+
f"/integrationEvents/{integration_event_id}",
|
|
100
|
+
json=self._serialize(integration_event),
|
|
101
|
+
)
|
|
102
|
+
return IntegrationEvent(**resp.json())
|
|
103
|
+
|
|
104
|
+
async def delete(
|
|
105
|
+
self,
|
|
106
|
+
integration_event_id: str,
|
|
107
|
+
) -> None:
|
|
108
|
+
"""Delete an integration event
|
|
109
|
+
|
|
110
|
+
Args:
|
|
111
|
+
integration_event_id: ID of the integration event.
|
|
112
|
+
"""
|
|
113
|
+
await self._http.delete(f"/integrationEvents/{integration_event_id}")
|
|
114
|
+
|
|
115
|
+
async def patch(
|
|
116
|
+
self,
|
|
117
|
+
integration_event_id: str,
|
|
118
|
+
partial: dict[str, Any],
|
|
119
|
+
) -> IntegrationEvent:
|
|
120
|
+
"""Partially update an integration event
|
|
121
|
+
|
|
122
|
+
Args:
|
|
123
|
+
integration_event_id: ID of the integration event.
|
|
124
|
+
partial: A dict of fields to update.
|
|
125
|
+
|
|
126
|
+
Returns:
|
|
127
|
+
The IntegrationEvent object.
|
|
128
|
+
"""
|
|
129
|
+
resp = await self._http.patch(f"/integrationEvents/{integration_event_id}", json=partial)
|
|
130
|
+
return IntegrationEvent(**resp.json())
|
|
131
|
+
|
|
132
|
+
async def calculate(
|
|
133
|
+
self,
|
|
134
|
+
direction: OrderDirection,
|
|
135
|
+
order_id: str,
|
|
136
|
+
) -> OrderWorksheet:
|
|
137
|
+
"""Calculate an order
|
|
138
|
+
|
|
139
|
+
Args:
|
|
140
|
+
direction: Direction of the order, from the current user's perspective.
|
|
141
|
+
order_id: ID of the order.
|
|
142
|
+
|
|
143
|
+
Returns:
|
|
144
|
+
The OrderWorksheet object.
|
|
145
|
+
"""
|
|
146
|
+
resp = await self._http.post(f"/orders/{direction}/{order_id}/calculate")
|
|
147
|
+
return OrderWorksheet(**resp.json())
|
|
148
|
+
|
|
149
|
+
async def estimate_shipping(
|
|
150
|
+
self,
|
|
151
|
+
direction: OrderDirection,
|
|
152
|
+
order_id: str,
|
|
153
|
+
) -> OrderWorksheet:
|
|
154
|
+
"""Estimate shipping cost
|
|
155
|
+
|
|
156
|
+
Args:
|
|
157
|
+
direction: Direction of the order, from the current user's perspective.
|
|
158
|
+
order_id: ID of the order.
|
|
159
|
+
|
|
160
|
+
Returns:
|
|
161
|
+
The OrderWorksheet object.
|
|
162
|
+
"""
|
|
163
|
+
resp = await self._http.post(f"/orders/{direction}/{order_id}/estimateshipping")
|
|
164
|
+
return OrderWorksheet(**resp.json())
|
|
165
|
+
|
|
166
|
+
async def select_shipmethods(
|
|
167
|
+
self,
|
|
168
|
+
direction: OrderDirection,
|
|
169
|
+
order_id: str,
|
|
170
|
+
order_ship_method_selection: Union[OrderShipMethodSelection, dict[str, Any]],
|
|
171
|
+
) -> OrderWorksheet:
|
|
172
|
+
"""Select a ship method
|
|
173
|
+
|
|
174
|
+
Args:
|
|
175
|
+
direction: Direction of the order, from the current user's perspective.
|
|
176
|
+
order_id: ID of the order.
|
|
177
|
+
order_ship_method_selection: A ``OrderShipMethodSelection`` model or dict.
|
|
178
|
+
|
|
179
|
+
Returns:
|
|
180
|
+
The OrderWorksheet object.
|
|
181
|
+
"""
|
|
182
|
+
resp = await self._http.post(
|
|
183
|
+
f"/orders/{direction}/{order_id}/shipmethods",
|
|
184
|
+
json=self._serialize(order_ship_method_selection),
|
|
185
|
+
)
|
|
186
|
+
return OrderWorksheet(**resp.json())
|
|
187
|
+
|
|
188
|
+
async def get_worksheet(
|
|
189
|
+
self,
|
|
190
|
+
direction: OrderDirection,
|
|
191
|
+
order_id: str,
|
|
192
|
+
) -> OrderWorksheet:
|
|
193
|
+
"""Get a single order worksheet
|
|
194
|
+
|
|
195
|
+
Args:
|
|
196
|
+
direction: Direction of the order, from the current user's perspective.
|
|
197
|
+
order_id: ID of the order.
|
|
198
|
+
|
|
199
|
+
Returns:
|
|
200
|
+
The OrderWorksheet object.
|
|
201
|
+
"""
|
|
202
|
+
resp = await self._http.get(f"/orders/{direction}/{order_id}/worksheet")
|
|
203
|
+
return OrderWorksheet(**resp.json())
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud InventoryIntegrations API resource."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Any, Union
|
|
7
|
+
|
|
8
|
+
from ..models.inventory_record import InventoryIntegration
|
|
9
|
+
from .base import BaseResource
|
|
10
|
+
|
|
11
|
+
__all__ = ["InventoryIntegrationsResource"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class InventoryIntegrationsResource(BaseResource):
|
|
15
|
+
"""Operations on OrderCloud InventoryIntegrations."""
|
|
16
|
+
|
|
17
|
+
async def get(
|
|
18
|
+
self,
|
|
19
|
+
) -> InventoryIntegration:
|
|
20
|
+
"""Retrieve an inventory integration
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
The InventoryIntegration object.
|
|
24
|
+
"""
|
|
25
|
+
resp = await self._http.get("/integrations/inventory")
|
|
26
|
+
return InventoryIntegration(**resp.json())
|
|
27
|
+
|
|
28
|
+
async def save(
|
|
29
|
+
self,
|
|
30
|
+
inventory_integration: Union[InventoryIntegration, dict[str, Any]],
|
|
31
|
+
) -> InventoryIntegration:
|
|
32
|
+
"""Create or update an inventory integration
|
|
33
|
+
|
|
34
|
+
Args:
|
|
35
|
+
inventory_integration: A ``InventoryIntegration`` model or dict. Required fields: DeliveryConfigID.
|
|
36
|
+
|
|
37
|
+
Returns:
|
|
38
|
+
The InventoryIntegration object.
|
|
39
|
+
"""
|
|
40
|
+
resp = await self._http.put(
|
|
41
|
+
"/integrations/inventory",
|
|
42
|
+
json=self._serialize(inventory_integration),
|
|
43
|
+
)
|
|
44
|
+
return InventoryIntegration(**resp.json())
|
|
45
|
+
|
|
46
|
+
async def delete(
|
|
47
|
+
self,
|
|
48
|
+
) -> None:
|
|
49
|
+
"""Delete an inventory integration"""
|
|
50
|
+
await self._http.delete("/integrations/inventory")
|
|
51
|
+
|
|
52
|
+
async def patch(
|
|
53
|
+
self,
|
|
54
|
+
partial: dict[str, Any],
|
|
55
|
+
) -> InventoryIntegration:
|
|
56
|
+
"""Partially update an inventory integration
|
|
57
|
+
|
|
58
|
+
Args:
|
|
59
|
+
partial: A dict of fields to update.
|
|
60
|
+
|
|
61
|
+
Returns:
|
|
62
|
+
The InventoryIntegration object.
|
|
63
|
+
"""
|
|
64
|
+
resp = await self._http.patch("/integrations/inventory", json=partial)
|
|
65
|
+
return InventoryIntegration(**resp.json())
|