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
ordercloud/middleware.py
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"""Middleware hook types for intercepting HTTP requests and responses."""
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass, field
|
|
4
|
+
from typing import Any, Awaitable, Callable, Optional
|
|
5
|
+
|
|
6
|
+
import httpx
|
|
7
|
+
|
|
8
|
+
__all__ = [
|
|
9
|
+
"RequestContext",
|
|
10
|
+
"ResponseContext",
|
|
11
|
+
"BeforeRequest",
|
|
12
|
+
"AfterResponse",
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
@dataclass
|
|
17
|
+
class RequestContext:
|
|
18
|
+
"""Mutable context passed to before-request hooks.
|
|
19
|
+
|
|
20
|
+
Hooks can modify ``headers``, ``params``, or ``json`` in place
|
|
21
|
+
before the request is sent.
|
|
22
|
+
|
|
23
|
+
Attributes:
|
|
24
|
+
method: HTTP method (e.g. ``"GET"``).
|
|
25
|
+
path: API path relative to the base URL.
|
|
26
|
+
url: Fully resolved request URL.
|
|
27
|
+
headers: Request headers (mutable).
|
|
28
|
+
params: Query parameters (mutable, may be ``None``).
|
|
29
|
+
json: JSON request body (mutable, may be ``None``).
|
|
30
|
+
"""
|
|
31
|
+
|
|
32
|
+
method: str
|
|
33
|
+
path: str
|
|
34
|
+
url: str
|
|
35
|
+
headers: dict[str, str] = field(default_factory=dict)
|
|
36
|
+
params: Optional[dict[str, Any]] = None
|
|
37
|
+
json: Optional[dict[str, Any]] = None
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@dataclass
|
|
41
|
+
class ResponseContext:
|
|
42
|
+
"""Context passed to after-response hooks.
|
|
43
|
+
|
|
44
|
+
Attributes:
|
|
45
|
+
request: The request context that produced this response.
|
|
46
|
+
response: The HTTP response.
|
|
47
|
+
attempt: Zero-based attempt number (0 on first try, >0 on retries).
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
request: RequestContext
|
|
51
|
+
response: httpx.Response
|
|
52
|
+
attempt: int
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
BeforeRequest = Callable[[RequestContext], Awaitable[None]]
|
|
56
|
+
"""Async callable invoked before each HTTP request.
|
|
57
|
+
|
|
58
|
+
Receives a mutable ``RequestContext`` — modify it to alter headers,
|
|
59
|
+
params, or the JSON body before the request is sent.
|
|
60
|
+
"""
|
|
61
|
+
|
|
62
|
+
AfterResponse = Callable[[ResponseContext], Awaitable[None]]
|
|
63
|
+
"""Async callable invoked after each HTTP response (including retries).
|
|
64
|
+
|
|
65
|
+
Receives a ``ResponseContext`` with the request details and the response.
|
|
66
|
+
"""
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud API models."""
|
|
4
|
+
|
|
5
|
+
from .product import ( # noqa: F401
|
|
6
|
+
Inventory,
|
|
7
|
+
VariantInventory,
|
|
8
|
+
VariantSpec,
|
|
9
|
+
VariantOverrides,
|
|
10
|
+
Variant,
|
|
11
|
+
AdHocProduct,
|
|
12
|
+
ProductSupplier,
|
|
13
|
+
Product,
|
|
14
|
+
)
|
|
15
|
+
from .bundle import ( # noqa: F401
|
|
16
|
+
Bundle,
|
|
17
|
+
)
|
|
18
|
+
from .order import ( # noqa: F401
|
|
19
|
+
OrderApprovalInfo,
|
|
20
|
+
ApprovalInfo,
|
|
21
|
+
OrderApproval,
|
|
22
|
+
OrderPromotion,
|
|
23
|
+
ShipMethodSelection,
|
|
24
|
+
OrderShipMethodSelection,
|
|
25
|
+
OrderSplitResult,
|
|
26
|
+
OrderSubmitResponse,
|
|
27
|
+
OrderSubmitForApprovalResponse,
|
|
28
|
+
OrderApprovedResponse,
|
|
29
|
+
OrderCalculateResponse,
|
|
30
|
+
LineItemOverride,
|
|
31
|
+
ExtendedLineItem,
|
|
32
|
+
OrderWorksheet,
|
|
33
|
+
Order,
|
|
34
|
+
OrderDirection,
|
|
35
|
+
OrderStatus,
|
|
36
|
+
)
|
|
37
|
+
from .line_item import ( # noqa: F401
|
|
38
|
+
BundleItems,
|
|
39
|
+
LineItem,
|
|
40
|
+
)
|
|
41
|
+
from .line_item_types import ( # noqa: F401
|
|
42
|
+
LineItemProduct,
|
|
43
|
+
LineItemVariant,
|
|
44
|
+
LineItemSpec,
|
|
45
|
+
)
|
|
46
|
+
from .order_return import ( # noqa: F401
|
|
47
|
+
OrderReturnItem,
|
|
48
|
+
OrderReturnApproval,
|
|
49
|
+
OrderReturn,
|
|
50
|
+
)
|
|
51
|
+
from .buyer import ( # noqa: F401
|
|
52
|
+
BuyerPriceBreak,
|
|
53
|
+
BuyerPriceSchedule,
|
|
54
|
+
ProductSeller,
|
|
55
|
+
BuyerAddress,
|
|
56
|
+
BuyerCreditCard,
|
|
57
|
+
BuyerProduct,
|
|
58
|
+
BuyerSupplier,
|
|
59
|
+
BuyerGroup,
|
|
60
|
+
Buyer,
|
|
61
|
+
)
|
|
62
|
+
from .user import ( # noqa: F401
|
|
63
|
+
UserOrderMoveOption,
|
|
64
|
+
Locale,
|
|
65
|
+
MeBuyer,
|
|
66
|
+
MeSeller,
|
|
67
|
+
MeSupplier,
|
|
68
|
+
OrderUser,
|
|
69
|
+
MeUser,
|
|
70
|
+
User,
|
|
71
|
+
)
|
|
72
|
+
from .catalog import ( # noqa: F401
|
|
73
|
+
Catalog,
|
|
74
|
+
)
|
|
75
|
+
from .category import ( # noqa: F401
|
|
76
|
+
Category,
|
|
77
|
+
)
|
|
78
|
+
from .address import ( # noqa: F401
|
|
79
|
+
Address,
|
|
80
|
+
)
|
|
81
|
+
from .supplier import ( # noqa: F401
|
|
82
|
+
SupplierBuyer,
|
|
83
|
+
Supplier,
|
|
84
|
+
)
|
|
85
|
+
from .price_schedule import ( # noqa: F401
|
|
86
|
+
PriceMarkupType,
|
|
87
|
+
PriceBreak,
|
|
88
|
+
PriceSchedule,
|
|
89
|
+
)
|
|
90
|
+
from .spec import ( # noqa: F401
|
|
91
|
+
SpecOption,
|
|
92
|
+
Spec,
|
|
93
|
+
)
|
|
94
|
+
from .promotion import ( # noqa: F401
|
|
95
|
+
PromotionOverride,
|
|
96
|
+
PromotionIntegration,
|
|
97
|
+
AddedPromo,
|
|
98
|
+
RemovedPromo,
|
|
99
|
+
EligiblePromotion,
|
|
100
|
+
RefreshPromosResponse,
|
|
101
|
+
Promotion,
|
|
102
|
+
)
|
|
103
|
+
from .payment import ( # noqa: F401
|
|
104
|
+
PaymentType,
|
|
105
|
+
PaymentTransaction,
|
|
106
|
+
Payment,
|
|
107
|
+
)
|
|
108
|
+
from .discount import ( # noqa: F401
|
|
109
|
+
DiscountBreak,
|
|
110
|
+
DiscountedPrices,
|
|
111
|
+
Discount,
|
|
112
|
+
)
|
|
113
|
+
from .shipment import ( # noqa: F401
|
|
114
|
+
ShipMethod,
|
|
115
|
+
ShipEstimateItem,
|
|
116
|
+
ShipEstimate,
|
|
117
|
+
ShipEstimateResponse,
|
|
118
|
+
ShipmentItem,
|
|
119
|
+
Shipment,
|
|
120
|
+
)
|
|
121
|
+
from .cost_center import ( # noqa: F401
|
|
122
|
+
CostCenter,
|
|
123
|
+
)
|
|
124
|
+
from .credit_card import ( # noqa: F401
|
|
125
|
+
CreditCard,
|
|
126
|
+
)
|
|
127
|
+
from .spending_account import ( # noqa: F401
|
|
128
|
+
SpendingAccount,
|
|
129
|
+
)
|
|
130
|
+
from .inventory_record import ( # noqa: F401
|
|
131
|
+
InventoryIntegration,
|
|
132
|
+
InventoryRecord,
|
|
133
|
+
)
|
|
134
|
+
from .user_group import ( # noqa: F401
|
|
135
|
+
UserGroup,
|
|
136
|
+
)
|
|
137
|
+
from .security import ( # noqa: F401
|
|
138
|
+
PasswordConfig,
|
|
139
|
+
ImpersonationConfig,
|
|
140
|
+
SecurityProfile,
|
|
141
|
+
)
|
|
142
|
+
from .api_client import ( # noqa: F401
|
|
143
|
+
ApiClientSecret,
|
|
144
|
+
ApiClientSecretCreateResponse,
|
|
145
|
+
ApiClient,
|
|
146
|
+
)
|
|
147
|
+
from .approval import ( # noqa: F401
|
|
148
|
+
ApprovalStatus,
|
|
149
|
+
ApprovalType,
|
|
150
|
+
ApprovalRule,
|
|
151
|
+
SellerApprovalRule,
|
|
152
|
+
)
|
|
153
|
+
from .subscription import ( # noqa: F401
|
|
154
|
+
SubscriptionInterval,
|
|
155
|
+
SubscriptionPayment,
|
|
156
|
+
SubscriptionIntegration,
|
|
157
|
+
SubscriptionIntegrationResponse,
|
|
158
|
+
Subscription,
|
|
159
|
+
)
|
|
160
|
+
from .message_sender import ( # noqa: F401
|
|
161
|
+
MessageType,
|
|
162
|
+
MessageSenderConfig,
|
|
163
|
+
MessageSender,
|
|
164
|
+
)
|
|
165
|
+
from .webhook import ( # noqa: F401
|
|
166
|
+
WebhookRoute,
|
|
167
|
+
Webhook,
|
|
168
|
+
)
|
|
169
|
+
from .integration import ( # noqa: F401
|
|
170
|
+
IntegrationEventType,
|
|
171
|
+
TrackingEventType,
|
|
172
|
+
IntegrationEvent,
|
|
173
|
+
TrackingEvent,
|
|
174
|
+
)
|
|
175
|
+
from .open_id_connect import ( # noqa: F401
|
|
176
|
+
OpenIdConnect,
|
|
177
|
+
)
|
|
178
|
+
from .delivery import ( # noqa: F401
|
|
179
|
+
KafkaConfig,
|
|
180
|
+
HttpConfig,
|
|
181
|
+
EventHubConfig,
|
|
182
|
+
AzureBlobConfig,
|
|
183
|
+
AzureTableConfig,
|
|
184
|
+
CosmosDbConfig,
|
|
185
|
+
MailchimpConfig,
|
|
186
|
+
ContentHubConfig,
|
|
187
|
+
SearchIngestionContent,
|
|
188
|
+
SearchIngestionHttpContent,
|
|
189
|
+
SearchIngestion,
|
|
190
|
+
DeliveryTargets,
|
|
191
|
+
DeliveryConfig,
|
|
192
|
+
SendEvent,
|
|
193
|
+
DiscoverEvent,
|
|
194
|
+
ErrorConfig,
|
|
195
|
+
)
|
|
196
|
+
from .sync import ( # noqa: F401
|
|
197
|
+
EntitySyncConfig,
|
|
198
|
+
OrderSyncConfig,
|
|
199
|
+
ProductSyncConfig,
|
|
200
|
+
SyncAdminUser,
|
|
201
|
+
SyncBuyer,
|
|
202
|
+
SyncBuyerUser,
|
|
203
|
+
SyncBuyerUserGroup,
|
|
204
|
+
SyncCategory,
|
|
205
|
+
SyncInventoryRecord,
|
|
206
|
+
SyncProduct,
|
|
207
|
+
SyncSupplier,
|
|
208
|
+
SyncSupplierUser,
|
|
209
|
+
)
|
|
210
|
+
from .product_collection import ( # noqa: F401
|
|
211
|
+
ProductCollectionEntry,
|
|
212
|
+
ProductCollectionProduct,
|
|
213
|
+
ProductCollectionBuyerProduct,
|
|
214
|
+
ProductCollectionInvitation,
|
|
215
|
+
ProductCollection,
|
|
216
|
+
)
|
|
217
|
+
from .assignments import ( # noqa: F401
|
|
218
|
+
AddressAssignment,
|
|
219
|
+
ApiClientAssignment,
|
|
220
|
+
BundleAssignment,
|
|
221
|
+
BundleCatalogAssignment,
|
|
222
|
+
BundleProductAssignment,
|
|
223
|
+
CatalogAssignment,
|
|
224
|
+
CategoryAssignment,
|
|
225
|
+
CategoryBundleAssignment,
|
|
226
|
+
CategoryProductAssignment,
|
|
227
|
+
CostCenterAssignment,
|
|
228
|
+
CreditCardAssignment,
|
|
229
|
+
DiscountAssignment,
|
|
230
|
+
InventoryRecordAssignment,
|
|
231
|
+
LocaleAssignment,
|
|
232
|
+
MessageCCListenerAssignment,
|
|
233
|
+
MessageSenderAssignment,
|
|
234
|
+
ProductAssignment,
|
|
235
|
+
ProductCatalogAssignment,
|
|
236
|
+
PromotionAssignment,
|
|
237
|
+
SecurityProfileAssignment,
|
|
238
|
+
SpecProductAssignment,
|
|
239
|
+
SpendingAccountAssignment,
|
|
240
|
+
UserGroupAssignment,
|
|
241
|
+
)
|
|
242
|
+
from .auth_models import ( # noqa: F401
|
|
243
|
+
AccessToken,
|
|
244
|
+
AccessTokenBasic,
|
|
245
|
+
ImpersonateTokenRequest,
|
|
246
|
+
OneTimePasswordRequest,
|
|
247
|
+
PasswordReset,
|
|
248
|
+
PasswordResetRequest,
|
|
249
|
+
TokenPasswordReset,
|
|
250
|
+
)
|
|
251
|
+
from .misc import ( # noqa: F401
|
|
252
|
+
AccessLevel,
|
|
253
|
+
ApiRole,
|
|
254
|
+
CommerceRole,
|
|
255
|
+
PartyType,
|
|
256
|
+
SearchType,
|
|
257
|
+
XpThingType,
|
|
258
|
+
Incrementor,
|
|
259
|
+
XpIndex,
|
|
260
|
+
ProductFacet,
|
|
261
|
+
GroupOrderInvitation,
|
|
262
|
+
)
|
|
263
|
+
from .shared import ( # noqa: F401
|
|
264
|
+
ListFacet,
|
|
265
|
+
ListFacetValue,
|
|
266
|
+
ListPage,
|
|
267
|
+
Meta,
|
|
268
|
+
MetaWithFacets,
|
|
269
|
+
OrderCloudEnum,
|
|
270
|
+
OrderCloudModel,
|
|
271
|
+
)
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud Address models."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Generic, Optional
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from .shared import OrderCloudModel, XP
|
|
10
|
+
|
|
11
|
+
__all__ = ["Address"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class Address(OrderCloudModel, Generic[XP]):
|
|
15
|
+
"""An OrderCloud Address.
|
|
16
|
+
|
|
17
|
+
Attributes:
|
|
18
|
+
id:
|
|
19
|
+
date_created: (read-only)
|
|
20
|
+
company_name:
|
|
21
|
+
first_name:
|
|
22
|
+
last_name:
|
|
23
|
+
street1:
|
|
24
|
+
street2:
|
|
25
|
+
city:
|
|
26
|
+
state:
|
|
27
|
+
zip:
|
|
28
|
+
country:
|
|
29
|
+
phone:
|
|
30
|
+
address_name:
|
|
31
|
+
xp:
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
35
|
+
date_created: Optional[str] = Field(None, alias="DateCreated")
|
|
36
|
+
company_name: Optional[str] = Field(None, alias="CompanyName")
|
|
37
|
+
first_name: Optional[str] = Field(None, alias="FirstName")
|
|
38
|
+
last_name: Optional[str] = Field(None, alias="LastName")
|
|
39
|
+
street1: Optional[str] = Field(None, alias="Street1")
|
|
40
|
+
street2: Optional[str] = Field(None, alias="Street2")
|
|
41
|
+
city: Optional[str] = Field(None, alias="City")
|
|
42
|
+
state: Optional[str] = Field(None, alias="State")
|
|
43
|
+
zip: Optional[str] = Field(None, alias="Zip")
|
|
44
|
+
country: Optional[str] = Field(None, alias="Country")
|
|
45
|
+
phone: Optional[str] = Field(None, alias="Phone")
|
|
46
|
+
address_name: Optional[str] = Field(None, alias="AddressName")
|
|
47
|
+
xp: Optional[XP] = Field(None, alias="xp")
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud ApiClientSecret, ApiClientSecretCreateResponse, ApiClient models."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Generic, Optional
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from .shared import OrderCloudModel, XP
|
|
10
|
+
from .misc import ApiRole
|
|
11
|
+
|
|
12
|
+
__all__ = ["ApiClientSecret", "ApiClientSecretCreateResponse", "ApiClient"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class ApiClientSecret(OrderCloudModel):
|
|
16
|
+
"""An OrderCloud ApiClientSecret.
|
|
17
|
+
|
|
18
|
+
Attributes:
|
|
19
|
+
id:
|
|
20
|
+
name:
|
|
21
|
+
expiration:
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
25
|
+
name: Optional[str] = Field(None, alias="Name")
|
|
26
|
+
expiration: Optional[str] = Field(None, alias="Expiration")
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ApiClientSecretCreateResponse(OrderCloudModel):
|
|
30
|
+
"""An OrderCloud ApiClientSecretCreateResponse.
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
client_secret: (read-only)
|
|
34
|
+
id:
|
|
35
|
+
name:
|
|
36
|
+
expiration:
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
client_secret: Optional[str] = Field(None, alias="ClientSecret")
|
|
40
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
41
|
+
name: Optional[str] = Field(None, alias="Name")
|
|
42
|
+
expiration: Optional[str] = Field(None, alias="Expiration")
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
class ApiClient(OrderCloudModel, Generic[XP]):
|
|
46
|
+
"""An OrderCloud ApiClient.
|
|
47
|
+
|
|
48
|
+
Attributes:
|
|
49
|
+
id: Used for OAuth 2.0 workflows and impersonation. (read-only)
|
|
50
|
+
client_secret: Enables the OAuth 2.0 client credentials grant type. Required on all OAuth workflows when present.
|
|
51
|
+
access_token_duration:
|
|
52
|
+
active: All user authentication is prohibited if false.
|
|
53
|
+
app_name:
|
|
54
|
+
refresh_token_duration:
|
|
55
|
+
anonymous_token_duration: Specifies the duration of anonymous tokens, expressed in minutes. This value is only used if the API Client is configured for anonymous shopping.
|
|
56
|
+
default_context_user_name: Optionally define a user that will be used when authenticating with a client credentials grant type flow. This grant type is often used for anonymous browsing on buyer applications and authentication on server integration layers.
|
|
57
|
+
xp:
|
|
58
|
+
allow_any_buyer: Allow all buyer users in your organization access to authenticate using this API Client.
|
|
59
|
+
allow_any_supplier: Allow all supplier users in your organization access to authenticate using this API Client.
|
|
60
|
+
allow_seller: Allow all marketplace owner users in your organization access to authenticate using this API Client.
|
|
61
|
+
is_anon_buyer: Enables anonymous shopping when a buyer user is the DefaultContextUser.
|
|
62
|
+
assigned_buyer_count: (read-only)
|
|
63
|
+
assigned_supplier_count: (read-only)
|
|
64
|
+
order_checkout_integration_event_id: If populated, an error will be thrown when attempting to submit an order that has not been processed through the OrderCheckout integration.
|
|
65
|
+
order_checkout_integration_event_name: (read-only)
|
|
66
|
+
order_return_integration_event_id: If populated, and not overriden by an OrderAdmin, the integration event will be used to calculate ReturnAmount on the order return or each individual return item.
|
|
67
|
+
order_return_integration_event_name: (read-only)
|
|
68
|
+
add_to_cart_integration_event_id: If populated, the integration event will be used to fetch product information from an external system when a line item is added to an unsubmitted order and the product does not exist in OrderCloud.
|
|
69
|
+
add_to_cart_integration_event_name: (read-only)
|
|
70
|
+
minimum_required_roles:
|
|
71
|
+
minimum_required_custom_roles:
|
|
72
|
+
maximum_granted_roles:
|
|
73
|
+
maximum_granted_custom_roles:
|
|
74
|
+
"""
|
|
75
|
+
|
|
76
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
77
|
+
client_secret: Optional[str] = Field(None, alias="ClientSecret")
|
|
78
|
+
access_token_duration: Optional[int] = Field(None, alias="AccessTokenDuration")
|
|
79
|
+
active: Optional[bool] = Field(None, alias="Active")
|
|
80
|
+
app_name: Optional[str] = Field(None, alias="AppName")
|
|
81
|
+
refresh_token_duration: Optional[int] = Field(None, alias="RefreshTokenDuration")
|
|
82
|
+
anonymous_token_duration: int = Field(10080, alias="AnonymousTokenDuration")
|
|
83
|
+
default_context_user_name: Optional[str] = Field(None, alias="DefaultContextUserName")
|
|
84
|
+
xp: Optional[XP] = Field(None, alias="xp")
|
|
85
|
+
allow_any_buyer: Optional[bool] = Field(None, alias="AllowAnyBuyer")
|
|
86
|
+
allow_any_supplier: Optional[bool] = Field(None, alias="AllowAnySupplier")
|
|
87
|
+
allow_seller: Optional[bool] = Field(None, alias="AllowSeller")
|
|
88
|
+
is_anon_buyer: Optional[bool] = Field(None, alias="IsAnonBuyer")
|
|
89
|
+
assigned_buyer_count: int = Field(0, alias="AssignedBuyerCount")
|
|
90
|
+
assigned_supplier_count: int = Field(0, alias="AssignedSupplierCount")
|
|
91
|
+
order_checkout_integration_event_id: Optional[str] = Field(
|
|
92
|
+
None, alias="OrderCheckoutIntegrationEventID"
|
|
93
|
+
)
|
|
94
|
+
order_checkout_integration_event_name: Optional[str] = Field(
|
|
95
|
+
None, alias="OrderCheckoutIntegrationEventName"
|
|
96
|
+
)
|
|
97
|
+
order_return_integration_event_id: Optional[str] = Field(
|
|
98
|
+
None, alias="OrderReturnIntegrationEventID"
|
|
99
|
+
)
|
|
100
|
+
order_return_integration_event_name: Optional[str] = Field(
|
|
101
|
+
None, alias="OrderReturnIntegrationEventName"
|
|
102
|
+
)
|
|
103
|
+
add_to_cart_integration_event_id: Optional[str] = Field(
|
|
104
|
+
None, alias="AddToCartIntegrationEventID"
|
|
105
|
+
)
|
|
106
|
+
add_to_cart_integration_event_name: Optional[str] = Field(
|
|
107
|
+
None, alias="AddToCartIntegrationEventName"
|
|
108
|
+
)
|
|
109
|
+
minimum_required_roles: Optional[list[ApiRole]] = Field(None, alias="MinimumRequiredRoles")
|
|
110
|
+
minimum_required_custom_roles: Optional[list[str]] = Field(
|
|
111
|
+
None, alias="MinimumRequiredCustomRoles"
|
|
112
|
+
)
|
|
113
|
+
maximum_granted_roles: Optional[list[ApiRole]] = Field(None, alias="MaximumGrantedRoles")
|
|
114
|
+
maximum_granted_custom_roles: Optional[list[str]] = Field(
|
|
115
|
+
None, alias="MaximumGrantedCustomRoles"
|
|
116
|
+
)
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# GENERATED by tools/codegen — DO NOT EDIT
|
|
2
|
+
# Source: ordercloud-openapi-v3.json
|
|
3
|
+
"""OrderCloud ApprovalStatus and related models."""
|
|
4
|
+
|
|
5
|
+
from __future__ import annotations
|
|
6
|
+
from typing import Generic, Optional
|
|
7
|
+
from pydantic import Field
|
|
8
|
+
|
|
9
|
+
from .shared import OrderCloudEnum, OrderCloudModel, XP
|
|
10
|
+
|
|
11
|
+
__all__ = ["ApprovalStatus", "ApprovalType", "ApprovalRule", "SellerApprovalRule"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class ApprovalStatus(OrderCloudEnum):
|
|
15
|
+
""""""
|
|
16
|
+
|
|
17
|
+
Pending = "Pending"
|
|
18
|
+
Approved = "Approved"
|
|
19
|
+
Declined = "Declined"
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
class ApprovalType(OrderCloudEnum):
|
|
23
|
+
""""""
|
|
24
|
+
|
|
25
|
+
Order = "Order"
|
|
26
|
+
OrderReturn = "OrderReturn"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class ApprovalRule(OrderCloudModel, Generic[XP]):
|
|
30
|
+
"""An OrderCloud ApprovalRule.
|
|
31
|
+
|
|
32
|
+
Attributes:
|
|
33
|
+
id:
|
|
34
|
+
name:
|
|
35
|
+
description:
|
|
36
|
+
approving_group_id:
|
|
37
|
+
rule_expression: The expression evaluated to determine an order requires approval. See rules engine documentation for formatting details.
|
|
38
|
+
xp:
|
|
39
|
+
"""
|
|
40
|
+
|
|
41
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
42
|
+
name: Optional[str] = Field(None, alias="Name")
|
|
43
|
+
description: Optional[str] = Field(None, alias="Description")
|
|
44
|
+
approving_group_id: Optional[str] = Field(None, alias="ApprovingGroupID")
|
|
45
|
+
rule_expression: Optional[str] = Field(None, alias="RuleExpression")
|
|
46
|
+
xp: Optional[XP] = Field(None, alias="xp")
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
class SellerApprovalRule(OrderCloudModel, Generic[XP]):
|
|
50
|
+
"""An OrderCloud SellerApprovalRule.
|
|
51
|
+
|
|
52
|
+
Attributes:
|
|
53
|
+
owner_id: ID of the organization who owns the rule. Only the marketplace owner can write a value other than their own organization ID. The value is used to look up the ApprovingGroupID.
|
|
54
|
+
approval_type: OrderReturn is the only ApprovalType supported currently.
|
|
55
|
+
id:
|
|
56
|
+
name:
|
|
57
|
+
description:
|
|
58
|
+
approving_group_id:
|
|
59
|
+
rule_expression: The expression evaluated to determine an order requires approval. See rules engine documentation for formatting details.
|
|
60
|
+
xp:
|
|
61
|
+
"""
|
|
62
|
+
|
|
63
|
+
owner_id: Optional[str] = Field(None, alias="OwnerID")
|
|
64
|
+
approval_type: Optional[_ApprovalType] = Field(None, alias="ApprovalType")
|
|
65
|
+
id: Optional[str] = Field(None, alias="ID")
|
|
66
|
+
name: Optional[str] = Field(None, alias="Name")
|
|
67
|
+
description: Optional[str] = Field(None, alias="Description")
|
|
68
|
+
approving_group_id: Optional[str] = Field(None, alias="ApprovingGroupID")
|
|
69
|
+
rule_expression: Optional[str] = Field(None, alias="RuleExpression")
|
|
70
|
+
xp: Optional[XP] = Field(None, alias="xp")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
_ApprovalType = ApprovalType
|