stepxmlclient 1.0.0__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.
- stepxmlclient/__init__.py +22 -0
- stepxmlclient/client.py +373 -0
- stepxmlclient/creator.py +317 -0
- stepxmlclient/model/__init__.py +418 -0
- stepxmlclient/model/asset.py +250 -0
- stepxmlclient/model/attribute.py +288 -0
- stepxmlclient/model/business.py +233 -0
- stepxmlclient/model/classification.py +409 -0
- stepxmlclient/model/complex_elements.py +260 -0
- stepxmlclient/model/deletion.py +87 -0
- stepxmlclient/model/entity.py +368 -0
- stepxmlclient/model/metadata.py +199 -0
- stepxmlclient/model/organization.py +167 -0
- stepxmlclient/model/product.py +519 -0
- stepxmlclient/model/relations.py +105 -0
- stepxmlclient/model/replacement.py +417 -0
- stepxmlclient/parser.py +2805 -0
- stepxmlclient/rest_client/__init__.py +16 -0
- stepxmlclient/rest_client/base.py +388 -0
- stepxmlclient/rest_client/client.py +127 -0
- stepxmlclient/rest_client/exceptions.py +97 -0
- stepxmlclient/rest_client/models/__init__.py +175 -0
- stepxmlclient/rest_client/models/asset.py +253 -0
- stepxmlclient/rest_client/models/attribute.py +112 -0
- stepxmlclient/rest_client/models/background_process.py +23 -0
- stepxmlclient/rest_client/models/batch.py +41 -0
- stepxmlclient/rest_client/models/classification.py +57 -0
- stepxmlclient/rest_client/models/collection.py +26 -0
- stepxmlclient/rest_client/models/common.py +192 -0
- stepxmlclient/rest_client/models/context.py +16 -0
- stepxmlclient/rest_client/models/data_type_group.py +15 -0
- stepxmlclient/rest_client/models/entity.py +63 -0
- stepxmlclient/rest_client/models/event_processor.py +15 -0
- stepxmlclient/rest_client/models/import_export.py +43 -0
- stepxmlclient/rest_client/models/integration_endpoint.py +16 -0
- stepxmlclient/rest_client/models/product.py +200 -0
- stepxmlclient/rest_client/models/relations.py +280 -0
- stepxmlclient/rest_client/models/system_information.py +11 -0
- stepxmlclient/rest_client/models/user.py +28 -0
- stepxmlclient/rest_client/models/workflow.py +30 -0
- stepxmlclient/rest_client/operations/__init__.py +54 -0
- stepxmlclient/rest_client/operations/assets.py +652 -0
- stepxmlclient/rest_client/operations/attributes.py +252 -0
- stepxmlclient/rest_client/operations/background_processes.py +84 -0
- stepxmlclient/rest_client/operations/batch.py +28 -0
- stepxmlclient/rest_client/operations/classifications.py +248 -0
- stepxmlclient/rest_client/operations/collection_groups.py +46 -0
- stepxmlclient/rest_client/operations/collections.py +67 -0
- stepxmlclient/rest_client/operations/contexts.py +88 -0
- stepxmlclient/rest_client/operations/data_type_groups.py +68 -0
- stepxmlclient/rest_client/operations/entities.py +295 -0
- stepxmlclient/rest_client/operations/event_processors.py +109 -0
- stepxmlclient/rest_client/operations/exports.py +153 -0
- stepxmlclient/rest_client/operations/gateway.py +53 -0
- stepxmlclient/rest_client/operations/inbound.py +472 -0
- stepxmlclient/rest_client/operations/outbound.py +64 -0
- stepxmlclient/rest_client/operations/products.py +489 -0
- stepxmlclient/rest_client/operations/relations.py +349 -0
- stepxmlclient/rest_client/operations/reports.py +27 -0
- stepxmlclient/rest_client/operations/system_information.py +28 -0
- stepxmlclient/rest_client/operations/user_groups.py +79 -0
- stepxmlclient/rest_client/operations/users.py +119 -0
- stepxmlclient/rest_client/operations/workflow_tasks.py +61 -0
- stepxmlclient/rest_client/operations/workflows.py +50 -0
- stepxmlclient/upload.py +293 -0
- stepxmlclient-1.0.0.dist-info/METADATA +666 -0
- stepxmlclient-1.0.0.dist-info/RECORD +70 -0
- stepxmlclient-1.0.0.dist-info/WHEEL +5 -0
- stepxmlclient-1.0.0.dist-info/licenses/LICENSE +21 -0
- stepxmlclient-1.0.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
"""REST API models for STEP REST API v2.
|
|
2
|
+
|
|
3
|
+
Provides Pydantic models for request/response handling and validation.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from .common import (
|
|
7
|
+
PageInfo,
|
|
8
|
+
PagedResponse,
|
|
9
|
+
ErrorDetail,
|
|
10
|
+
ErrorResponse,
|
|
11
|
+
ApiResponse,
|
|
12
|
+
SearchFilter,
|
|
13
|
+
SearchRequest,
|
|
14
|
+
SuccessResponse,
|
|
15
|
+
ListResponse,
|
|
16
|
+
)
|
|
17
|
+
from .product import (
|
|
18
|
+
ProductResponse,
|
|
19
|
+
ProductListResponse,
|
|
20
|
+
ProductSearchRequest,
|
|
21
|
+
ProductCreateRequest,
|
|
22
|
+
ProductUpdateRequest,
|
|
23
|
+
)
|
|
24
|
+
from .asset import (
|
|
25
|
+
AssetResponse,
|
|
26
|
+
AssetListResponse,
|
|
27
|
+
AssetSearchRequest,
|
|
28
|
+
AssetCreateRequest,
|
|
29
|
+
AssetUpdateRequest,
|
|
30
|
+
AssetUploadRequest,
|
|
31
|
+
AssetDownloadResponse,
|
|
32
|
+
AssetMetadata,
|
|
33
|
+
)
|
|
34
|
+
from .classification import (
|
|
35
|
+
ClassificationResponse,
|
|
36
|
+
ClassificationListResponse,
|
|
37
|
+
ClassificationCreateRequest,
|
|
38
|
+
ClassificationUpdateRequest,
|
|
39
|
+
)
|
|
40
|
+
from .entity import (
|
|
41
|
+
EntityResponse,
|
|
42
|
+
EntityListResponse,
|
|
43
|
+
EntityCreateRequest,
|
|
44
|
+
EntityUpdateRequest,
|
|
45
|
+
EntityRelationshipResponse,
|
|
46
|
+
)
|
|
47
|
+
from .attribute import (
|
|
48
|
+
AttributeResponse,
|
|
49
|
+
AttributeMetadata,
|
|
50
|
+
AttributeValue,
|
|
51
|
+
ListOfValueResponse,
|
|
52
|
+
ListOfValueItem,
|
|
53
|
+
)
|
|
54
|
+
from .import_export import (
|
|
55
|
+
BackgroundProcessResponse,
|
|
56
|
+
ExportJobCreateRequest,
|
|
57
|
+
)
|
|
58
|
+
from .relations import (
|
|
59
|
+
RelationshipTypeResponse,
|
|
60
|
+
RelationshipResponse,
|
|
61
|
+
RelationshipListResponse,
|
|
62
|
+
RelationshipCreateRequest,
|
|
63
|
+
RelationshipUpdateRequest,
|
|
64
|
+
CrossReferenceResponse,
|
|
65
|
+
CrossReferenceListResponse,
|
|
66
|
+
CrossReferenceCreateRequest,
|
|
67
|
+
LinkResponse,
|
|
68
|
+
LinkListResponse,
|
|
69
|
+
LinkCreateRequest,
|
|
70
|
+
RelationshipGraphResponse,
|
|
71
|
+
)
|
|
72
|
+
from .context import (
|
|
73
|
+
ContextResponse,
|
|
74
|
+
)
|
|
75
|
+
from .system_information import (
|
|
76
|
+
SystemInformationResponse,
|
|
77
|
+
)
|
|
78
|
+
from .user import (
|
|
79
|
+
UserResponse,
|
|
80
|
+
UserGroupResponse,
|
|
81
|
+
)
|
|
82
|
+
from .collection import (
|
|
83
|
+
CollectionResponse,
|
|
84
|
+
CollectionGroupResponse,
|
|
85
|
+
)
|
|
86
|
+
from .background_process import (
|
|
87
|
+
BackgroundProcessResponse,
|
|
88
|
+
)
|
|
89
|
+
from .event_processor import (
|
|
90
|
+
EventProcessorResponse,
|
|
91
|
+
)
|
|
92
|
+
from .integration_endpoint import (
|
|
93
|
+
IntegrationEndpointResponse,
|
|
94
|
+
)
|
|
95
|
+
from .workflow import (
|
|
96
|
+
WorkflowResponse,
|
|
97
|
+
WorkflowTaskResponse,
|
|
98
|
+
)
|
|
99
|
+
from .batch import (
|
|
100
|
+
BatchRequest,
|
|
101
|
+
BatchResponse,
|
|
102
|
+
OperationRequest,
|
|
103
|
+
OperationResponse,
|
|
104
|
+
)
|
|
105
|
+
from .data_type_group import (
|
|
106
|
+
DataTypeGroupResponse,
|
|
107
|
+
)
|
|
108
|
+
|
|
109
|
+
__all__ = [
|
|
110
|
+
'PageInfo',
|
|
111
|
+
'PagedResponse',
|
|
112
|
+
'ErrorDetail',
|
|
113
|
+
'ErrorResponse',
|
|
114
|
+
'ApiResponse',
|
|
115
|
+
'SearchFilter',
|
|
116
|
+
'SearchRequest',
|
|
117
|
+
'SuccessResponse',
|
|
118
|
+
'ListResponse',
|
|
119
|
+
'ProductResponse',
|
|
120
|
+
'ProductListResponse',
|
|
121
|
+
'ProductSearchRequest',
|
|
122
|
+
'ProductCreateRequest',
|
|
123
|
+
'ProductUpdateRequest',
|
|
124
|
+
'AssetResponse',
|
|
125
|
+
'AssetListResponse',
|
|
126
|
+
'AssetSearchRequest',
|
|
127
|
+
'AssetCreateRequest',
|
|
128
|
+
'AssetUpdateRequest',
|
|
129
|
+
'AssetUploadRequest',
|
|
130
|
+
'AssetDownloadResponse',
|
|
131
|
+
'AssetMetadata',
|
|
132
|
+
'ClassificationResponse',
|
|
133
|
+
'ClassificationListResponse',
|
|
134
|
+
'ClassificationCreateRequest',
|
|
135
|
+
'ClassificationUpdateRequest',
|
|
136
|
+
'EntityResponse',
|
|
137
|
+
'EntityListResponse',
|
|
138
|
+
'EntityCreateRequest',
|
|
139
|
+
'EntityUpdateRequest',
|
|
140
|
+
'EntityRelationshipResponse',
|
|
141
|
+
'AttributeResponse',
|
|
142
|
+
'AttributeMetadata',
|
|
143
|
+
'AttributeValue',
|
|
144
|
+
'ListOfValueResponse',
|
|
145
|
+
'ListOfValueItem',
|
|
146
|
+
'BackgroundProcessResponse',
|
|
147
|
+
'ExportJobCreateRequest',
|
|
148
|
+
'RelationshipTypeResponse',
|
|
149
|
+
'RelationshipResponse',
|
|
150
|
+
'RelationshipListResponse',
|
|
151
|
+
'RelationshipCreateRequest',
|
|
152
|
+
'RelationshipUpdateRequest',
|
|
153
|
+
'CrossReferenceResponse',
|
|
154
|
+
'CrossReferenceListResponse',
|
|
155
|
+
'CrossReferenceCreateRequest',
|
|
156
|
+
'LinkResponse',
|
|
157
|
+
'LinkListResponse',
|
|
158
|
+
'LinkCreateRequest',
|
|
159
|
+
'RelationshipGraphResponse',
|
|
160
|
+
'WorkflowResponse',
|
|
161
|
+
'WorkflowTaskResponse',
|
|
162
|
+
'ContextResponse',
|
|
163
|
+
'SystemInformationResponse',
|
|
164
|
+
'UserResponse',
|
|
165
|
+
'UserGroupResponse',
|
|
166
|
+
'CollectionResponse',
|
|
167
|
+
'CollectionGroupResponse',
|
|
168
|
+
'EventProcessorResponse',
|
|
169
|
+
'IntegrationEndpointResponse',
|
|
170
|
+
'BatchRequest',
|
|
171
|
+
'BatchResponse',
|
|
172
|
+
'OperationRequest',
|
|
173
|
+
'OperationResponse',
|
|
174
|
+
'DataTypeGroupResponse',
|
|
175
|
+
]
|
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
"""Asset-related REST API models.
|
|
2
|
+
|
|
3
|
+
Provides Pydantic models aligned with STEP REST API v2 asset schemas.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from typing import Any, Dict, List, Optional
|
|
7
|
+
|
|
8
|
+
from pydantic import BaseModel, ConfigDict, Field
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
class AssetMetadata(BaseModel):
|
|
12
|
+
"""Asset file metadata.
|
|
13
|
+
|
|
14
|
+
Attributes:
|
|
15
|
+
filename: Original filename
|
|
16
|
+
mime_type: MIME type (e.g., "image/jpeg")
|
|
17
|
+
size: File size in bytes
|
|
18
|
+
creation_date: Upload/creation timestamp
|
|
19
|
+
modification_date: Last modification timestamp
|
|
20
|
+
checksum: File checksum for integrity verification
|
|
21
|
+
"""
|
|
22
|
+
|
|
23
|
+
filename: str | None = Field(None, description="Original filename")
|
|
24
|
+
mime_type: str | None = Field(None, description="MIME type")
|
|
25
|
+
size: Optional[int] = Field(None, ge=0, description="File size in bytes")
|
|
26
|
+
creation_date: str | None = Field(None, description="Creation timestamp")
|
|
27
|
+
modification_date: str | None = Field(None, description="Modification timestamp")
|
|
28
|
+
checksum: str | None = Field(None, description="File checksum")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class AssetResponse(BaseModel):
|
|
32
|
+
"""Single asset response data.
|
|
33
|
+
|
|
34
|
+
Mirrors the REST API Asset schema:
|
|
35
|
+
- objectType/classifications describe placement and type
|
|
36
|
+
- values/references are dynamic maps keyed by ID
|
|
37
|
+
- contentMetadata is read-only metadata returned by STEP
|
|
38
|
+
"""
|
|
39
|
+
|
|
40
|
+
model_config = ConfigDict(
|
|
41
|
+
json_schema_extra={
|
|
42
|
+
"example": {
|
|
43
|
+
"id": "ASSET123",
|
|
44
|
+
"objectType": "ProductImage",
|
|
45
|
+
"name": "Product Image",
|
|
46
|
+
"classifications": ["ProductImageRoot"],
|
|
47
|
+
"values": {
|
|
48
|
+
"AssetKeywords": {
|
|
49
|
+
"values": [
|
|
50
|
+
{"value": "TV"},
|
|
51
|
+
{"value": "Television"}
|
|
52
|
+
]
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
"references": {},
|
|
56
|
+
"contentMetadata": {
|
|
57
|
+
"originalFilename": "product.jpg",
|
|
58
|
+
"mimeType": "image/jpeg"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
id: str = Field(..., description="Asset ID")
|
|
65
|
+
objectType: str | None = Field(None, description="Object type ID")
|
|
66
|
+
name: str | None = Field(None, description="Asset name/description")
|
|
67
|
+
classifications: Optional[List[str]] = Field(default_factory=list, description="Linked classification IDs")
|
|
68
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Asset values keyed by attribute ID")
|
|
69
|
+
references: Optional[Dict[str, Any]] = Field(None, description="Asset references keyed by reference type ID")
|
|
70
|
+
contentMetadata: Optional[Dict[str, str]] = Field(None, description="Read-only asset content metadata")
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class AssetListResponse(BaseModel):
|
|
74
|
+
"""Paginated asset list response.
|
|
75
|
+
|
|
76
|
+
Attributes:
|
|
77
|
+
items: List of AssetResponse objects
|
|
78
|
+
total: Total number of assets
|
|
79
|
+
limit: Items per page
|
|
80
|
+
offset: Current offset
|
|
81
|
+
has_more: Whether more results are available
|
|
82
|
+
"""
|
|
83
|
+
|
|
84
|
+
model_config = ConfigDict(
|
|
85
|
+
json_schema_extra={
|
|
86
|
+
"example": {
|
|
87
|
+
"items": [],
|
|
88
|
+
"total": 50,
|
|
89
|
+
"limit": 20,
|
|
90
|
+
"offset": 0,
|
|
91
|
+
"has_more": True
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
items: List[AssetResponse] = Field(default_factory=list, description="Assets in this page")
|
|
97
|
+
total: Optional[int] = Field(None, ge=0, description="Total number of assets")
|
|
98
|
+
limit: int = Field(20, ge=1, le=1000, description="Items per page")
|
|
99
|
+
offset: int = Field(0, ge=0, description="Current offset")
|
|
100
|
+
has_more: bool = Field(False, description="Whether more results are available")
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
class AssetSearchRequest(BaseModel):
|
|
104
|
+
"""Search request for assets.
|
|
105
|
+
|
|
106
|
+
Attributes:
|
|
107
|
+
query: Free-text search query
|
|
108
|
+
object_type: Filter by object type
|
|
109
|
+
modified_since: Only assets modified after this date (ISO 8601)
|
|
110
|
+
limit: Max results to return
|
|
111
|
+
offset: Result offset for pagination
|
|
112
|
+
include_metadata: Whether to include metadata
|
|
113
|
+
include_content: Whether to include binary content reference
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
model_config = ConfigDict(
|
|
117
|
+
json_schema_extra={
|
|
118
|
+
"example": {
|
|
119
|
+
"query": "*",
|
|
120
|
+
"object_type": "ProductImage",
|
|
121
|
+
"limit": 20,
|
|
122
|
+
"offset": 0,
|
|
123
|
+
"include_metadata": True
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
)
|
|
127
|
+
|
|
128
|
+
query: str = Field("*", description="Free-text search query")
|
|
129
|
+
object_type: str | None = Field(None, description="Filter by object type")
|
|
130
|
+
modified_since: str | None = Field(None, description="ISO 8601 timestamp filter")
|
|
131
|
+
limit: int = Field(20, ge=1, le=1000, description="Max results")
|
|
132
|
+
offset: int = Field(0, ge=0, description="Result offset")
|
|
133
|
+
include_metadata: bool = Field(True, description="Include metadata")
|
|
134
|
+
include_content: bool = Field(False, description="Include content reference")
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
class AssetCreateRequest(BaseModel):
|
|
138
|
+
"""Request to create a new asset.
|
|
139
|
+
|
|
140
|
+
Attributes:
|
|
141
|
+
objectType: Asset object type (required)
|
|
142
|
+
classifications: Classification IDs to link asset into (required, min 1)
|
|
143
|
+
name: Asset name/description
|
|
144
|
+
values: Asset values map keyed by attribute ID
|
|
145
|
+
references: Asset references map keyed by reference/link type ID
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
model_config = ConfigDict(
|
|
149
|
+
json_schema_extra={
|
|
150
|
+
"example": {
|
|
151
|
+
"objectType": "ProductImage",
|
|
152
|
+
"classifications": ["ProductImageRoot"],
|
|
153
|
+
"name": "New Asset",
|
|
154
|
+
"values": {
|
|
155
|
+
"AssetKeywords": {
|
|
156
|
+
"values": [{"value": "TV"}]
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
objectType: str = Field(..., description="Object type ID")
|
|
164
|
+
classifications: List[str] = Field(..., min_length=1, description="Parent classification IDs")
|
|
165
|
+
name: str | None = Field(None, description="Asset name/description")
|
|
166
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Asset values")
|
|
167
|
+
references: Optional[Dict[str, Any]] = Field(None, description="Asset references")
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
class AssetUpdateRequest(BaseModel):
|
|
171
|
+
"""Request to update an existing asset.
|
|
172
|
+
|
|
173
|
+
Attributes:
|
|
174
|
+
name: Updated asset name/description
|
|
175
|
+
classifications: Classifications to add
|
|
176
|
+
values: Updated asset values
|
|
177
|
+
references: Updated references
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
model_config = ConfigDict(
|
|
181
|
+
json_schema_extra={
|
|
182
|
+
"example": {
|
|
183
|
+
"name": "Updated Asset Name",
|
|
184
|
+
"classifications": ["ProductImageRoot"],
|
|
185
|
+
"values": {
|
|
186
|
+
"AssetKeywords": {
|
|
187
|
+
"values": [{"value": "TV"}]
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
)
|
|
193
|
+
|
|
194
|
+
name: str | None = Field(None, description="Updated asset name")
|
|
195
|
+
classifications: Optional[List[str]] = Field(None, description="Classifications to add")
|
|
196
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Values to update")
|
|
197
|
+
references: Optional[Dict[str, Any]] = Field(None, description="References to update")
|
|
198
|
+
|
|
199
|
+
|
|
200
|
+
class AssetUploadRequest(BaseModel):
|
|
201
|
+
"""Request to upload asset binary content.
|
|
202
|
+
|
|
203
|
+
Attributes:
|
|
204
|
+
filename: Filename for the uploaded content
|
|
205
|
+
mime_type: MIME type of the content (e.g., "image/jpeg")
|
|
206
|
+
file_path: Local file path (used in API calls, not in model)
|
|
207
|
+
description: Optional description of the upload
|
|
208
|
+
"""
|
|
209
|
+
|
|
210
|
+
model_config = ConfigDict(
|
|
211
|
+
json_schema_extra={
|
|
212
|
+
"example": {
|
|
213
|
+
"filename": "product.jpg",
|
|
214
|
+
"mime_type": "image/jpeg",
|
|
215
|
+
"description": "Product catalog image"
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
filename: str = Field(..., description="Filename for uploaded content")
|
|
221
|
+
mime_type: str = Field(..., description="MIME type")
|
|
222
|
+
description: str | None = Field(None, description="Upload description")
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
class AssetDownloadResponse(BaseModel):
|
|
226
|
+
"""Response for asset binary download.
|
|
227
|
+
|
|
228
|
+
Attributes:
|
|
229
|
+
asset_id: Asset ID being downloaded
|
|
230
|
+
filename: Downloaded filename
|
|
231
|
+
size: File size in bytes
|
|
232
|
+
mime_type: MIME type of content
|
|
233
|
+
content_url: URL to download content (if applicable)
|
|
234
|
+
expires_at: Expiration time of download URL (if applicable)
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
model_config = ConfigDict(
|
|
238
|
+
json_schema_extra={
|
|
239
|
+
"example": {
|
|
240
|
+
"asset_id": "ASSET123",
|
|
241
|
+
"filename": "product.jpg",
|
|
242
|
+
"size": 102400,
|
|
243
|
+
"mime_type": "image/jpeg"
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
)
|
|
247
|
+
|
|
248
|
+
asset_id: str = Field(..., description="Asset ID")
|
|
249
|
+
filename: str | None = Field(None, description="Downloaded filename")
|
|
250
|
+
size: Optional[int] = Field(None, ge=0, description="File size in bytes")
|
|
251
|
+
mime_type: str | None = Field(None, description="MIME type")
|
|
252
|
+
content_url: str | None = Field(None, description="Download URL")
|
|
253
|
+
expires_at: str | None = Field(None, description="URL expiration time")
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"""Attribute model classes for STEP REST API v2."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional, List, Dict, Any
|
|
4
|
+
from pydantic import BaseModel, Field, ConfigDict
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class AttributeValue(BaseModel):
|
|
8
|
+
"""Individual attribute value."""
|
|
9
|
+
|
|
10
|
+
model_config = ConfigDict(json_schema_extra={
|
|
11
|
+
"example": {
|
|
12
|
+
"value": "Blue",
|
|
13
|
+
"context": "Context1",
|
|
14
|
+
"language": "en"
|
|
15
|
+
}
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
value: Any = Field(..., description="The attribute value")
|
|
19
|
+
context: str | None = Field(None, description="Context for this value")
|
|
20
|
+
language: str | None = Field(None, description="Language code")
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ListOfValueItem(BaseModel):
|
|
24
|
+
"""Individual item in a List of Values."""
|
|
25
|
+
|
|
26
|
+
model_config = ConfigDict(json_schema_extra={
|
|
27
|
+
"example": {
|
|
28
|
+
"id": "LOV_ITEM_001",
|
|
29
|
+
"name": "Option 1",
|
|
30
|
+
"description": "First option",
|
|
31
|
+
"sequence": 1
|
|
32
|
+
}
|
|
33
|
+
})
|
|
34
|
+
|
|
35
|
+
id: str = Field(..., description="LOV item ID")
|
|
36
|
+
name: str = Field(..., description="LOV item name")
|
|
37
|
+
description: str | None = Field(None, description="LOV item description")
|
|
38
|
+
sequence: Optional[int] = Field(None, description="Display sequence")
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
class ListOfValueResponse(BaseModel):
|
|
42
|
+
"""Response containing List of Values (maps to STEP ``ListOfValues`` schema).
|
|
43
|
+
|
|
44
|
+
The STEP REST API spec defines ``ListOfValues`` with properties:
|
|
45
|
+
``id``, ``name``, ``extendable``, ``usesValueIds``, ``values``.
|
|
46
|
+
All fields are optional (``required: []`` in spec).
|
|
47
|
+
The collection field in the spec is ``values``, not ``items``.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
model_config = ConfigDict(populate_by_name=True, json_schema_extra={
|
|
51
|
+
"example": {
|
|
52
|
+
"id": "LOV_001",
|
|
53
|
+
"name": "Color LOV",
|
|
54
|
+
"extendable": False,
|
|
55
|
+
"usesValueIds": True,
|
|
56
|
+
"values": [{"id": "LOV_ITEM_001", "name": "Red"}]
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
|
|
60
|
+
id: str | None = Field(None, description="LOV ID")
|
|
61
|
+
name: str | None = Field(None, description="LOV name")
|
|
62
|
+
extendable: Optional[bool] = Field(None, description="Whether users can extend the LOV")
|
|
63
|
+
usesValueIds: Optional[bool] = Field(None, description="Whether values have explicit IDs")
|
|
64
|
+
values: Optional[List[ListOfValueItem]] = Field(None, description="List of values (spec field name)")
|
|
65
|
+
# Backward-compatible alias — some callers may have used 'items'
|
|
66
|
+
items: Optional[List[ListOfValueItem]] = Field(None, description="Alias for values (legacy field name)")
|
|
67
|
+
total: Optional[int] = Field(None, description="Total number of items")
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
class AttributeMetadata(BaseModel):
|
|
71
|
+
"""Metadata about an attribute."""
|
|
72
|
+
|
|
73
|
+
model_config = ConfigDict(json_schema_extra={
|
|
74
|
+
"example": {
|
|
75
|
+
"type": "Text",
|
|
76
|
+
"required": True,
|
|
77
|
+
"multiValued": False,
|
|
78
|
+
"createdAt": "2025-01-01T00:00:00Z",
|
|
79
|
+
"modifiedAt": "2025-01-02T00:00:00Z"
|
|
80
|
+
}
|
|
81
|
+
})
|
|
82
|
+
|
|
83
|
+
type: str = Field(..., description="Attribute data type (Text, Number, Boolean, etc.)")
|
|
84
|
+
required: Optional[bool] = Field(None, description="Whether attribute is required")
|
|
85
|
+
multiValued: Optional[bool] = Field(None, description="Whether attribute supports multiple values")
|
|
86
|
+
createdAt: str | None = Field(None, description="Creation timestamp")
|
|
87
|
+
modifiedAt: str | None = Field(None, description="Last modification timestamp")
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class AttributeResponse(BaseModel):
|
|
91
|
+
"""Response from attribute GET operation."""
|
|
92
|
+
|
|
93
|
+
model_config = ConfigDict(json_schema_extra={
|
|
94
|
+
"example": {
|
|
95
|
+
"id": "ATTR_001",
|
|
96
|
+
"name": "Color",
|
|
97
|
+
"type": "Text",
|
|
98
|
+
"required": True,
|
|
99
|
+
"lovId": "LOV_001",
|
|
100
|
+
"metadata": {"type": "Text"}
|
|
101
|
+
}
|
|
102
|
+
})
|
|
103
|
+
|
|
104
|
+
id: str = Field(..., description="Attribute ID")
|
|
105
|
+
name: str = Field(..., description="Attribute name")
|
|
106
|
+
description: str | None = Field(None, description="Attribute description")
|
|
107
|
+
type: str = Field(..., description="Attribute data type")
|
|
108
|
+
lovId: str | None = Field(None, description="Associated List of Values ID")
|
|
109
|
+
required: Optional[bool] = Field(None, description="Is required")
|
|
110
|
+
multiValued: Optional[bool] = Field(None, description="Supports multiple values")
|
|
111
|
+
metadata: Optional[AttributeMetadata] = Field(None, description="Attribute metadata")
|
|
112
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"""Background process models for STEP REST API v2."""
|
|
2
|
+
|
|
3
|
+
from typing import Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class BackgroundProcessResponse(BaseModel):
|
|
9
|
+
"""STEP background process status representation."""
|
|
10
|
+
model_config = ConfigDict(extra="allow")
|
|
11
|
+
|
|
12
|
+
id: str | None = None
|
|
13
|
+
background_process_type: str | None = None
|
|
14
|
+
description: str | None = None
|
|
15
|
+
user: str | None = None
|
|
16
|
+
status: str | None = None
|
|
17
|
+
created: str | None = None
|
|
18
|
+
started: str | None = None
|
|
19
|
+
ended: str | None = None
|
|
20
|
+
execution_time_millis: Optional[float] = None
|
|
21
|
+
number_of_warnings: Optional[int] = None
|
|
22
|
+
number_of_errors: Optional[int] = None
|
|
23
|
+
progress: Optional[int] = None
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"""Batch operation models for STEP REST API v2."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class OperationRequest(BaseModel):
|
|
9
|
+
"""Single operation within a batch."""
|
|
10
|
+
model_config = ConfigDict(extra="allow")
|
|
11
|
+
|
|
12
|
+
resource: str
|
|
13
|
+
method: str
|
|
14
|
+
query_parameters: Optional[dict[str, Any]] = None
|
|
15
|
+
body: Optional[dict[str, Any]] = None
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
class BatchRequest(BaseModel):
|
|
19
|
+
"""Batch execution request."""
|
|
20
|
+
model_config = ConfigDict(extra="allow")
|
|
21
|
+
|
|
22
|
+
mode: str | None = "LENIENT"
|
|
23
|
+
operations: list[OperationRequest]
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class OperationResponse(BaseModel):
|
|
27
|
+
"""Single operation result within a batch response."""
|
|
28
|
+
model_config = ConfigDict(extra="allow")
|
|
29
|
+
|
|
30
|
+
resource: str | None = None
|
|
31
|
+
method: str | None = None
|
|
32
|
+
status: Optional[int] = None
|
|
33
|
+
body: Optional[dict[str, Any]] = None
|
|
34
|
+
duration: Optional[int] = None
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
class BatchResponse(BaseModel):
|
|
38
|
+
"""Batch execution response."""
|
|
39
|
+
model_config = ConfigDict(extra="allow")
|
|
40
|
+
|
|
41
|
+
results: Optional[list[OperationResponse]] = None
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"""Classification-related data models for STEP REST API v2."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Dict, List, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, Field
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ClassificationResponse(BaseModel):
|
|
9
|
+
"""Response from classification GET/POST operation."""
|
|
10
|
+
|
|
11
|
+
id: str = Field(..., description="Classification ID")
|
|
12
|
+
objectType: str | None = Field(None, description="Classification object type ID")
|
|
13
|
+
name: str | None = Field(None, description="Classification name")
|
|
14
|
+
parent: str | None = Field(None, description="Parent classification ID")
|
|
15
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Attribute values")
|
|
16
|
+
references: Optional[Dict[str, Any]] = Field(None, description="References")
|
|
17
|
+
attributeLinks: Optional[Dict[str, Any]] = Field(None, description="Attribute links")
|
|
18
|
+
dataContainers: Optional[Dict[str, Any]] = Field(None, description="Data containers")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class ClassificationListResponse(BaseModel):
|
|
22
|
+
"""Response from classification list/search operations."""
|
|
23
|
+
|
|
24
|
+
items: List[ClassificationResponse] = Field(default_factory=list, description="List of classifications")
|
|
25
|
+
total: Optional[int] = Field(None, description="Total number of classifications")
|
|
26
|
+
limit: Optional[int] = Field(None, description="Result limit")
|
|
27
|
+
offset: Optional[int] = Field(None, description="Result offset")
|
|
28
|
+
hasMore: Optional[bool] = Field(None, description="Whether more results available")
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class ClassificationCreateRequest(BaseModel):
|
|
32
|
+
"""Request model for classification creation (POST /classifications).
|
|
33
|
+
|
|
34
|
+
Object type and a parent classification must be specified. An 'id' must not be supplied.
|
|
35
|
+
An auto ID pattern must be configured for the object type.
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
objectType: str = Field(..., description="Classification object type ID (required)")
|
|
39
|
+
parent: str = Field(..., description="Parent classification ID (required)")
|
|
40
|
+
name: str | None = Field(None, description="Classification name")
|
|
41
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Attribute values")
|
|
42
|
+
references: Optional[Dict[str, Any]] = Field(None, description="References")
|
|
43
|
+
attributeLinks: Optional[Dict[str, Any]] = Field(None, description="Attribute links")
|
|
44
|
+
dataContainers: Optional[Dict[str, Any]] = Field(None, description="Data containers")
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class ClassificationUpdateRequest(BaseModel):
|
|
48
|
+
"""Request model for classification updates (PATCH /classifications/{id})."""
|
|
49
|
+
|
|
50
|
+
name: str | None = Field(None, description="Updated classification name")
|
|
51
|
+
parent: str | None = Field(None, description="Updated parent classification ID")
|
|
52
|
+
values: Optional[Dict[str, Any]] = Field(None, description="Updated attribute values")
|
|
53
|
+
references: Optional[Dict[str, Any]] = Field(None, description="Updated references")
|
|
54
|
+
attributeLinks: Optional[Dict[str, Any]] = Field(None, description="Updated attribute links")
|
|
55
|
+
dataContainers: Optional[Dict[str, Any]] = Field(None, description="Updated data containers")
|
|
56
|
+
|
|
57
|
+
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"""Collection and collection group models for STEP REST API v2."""
|
|
2
|
+
|
|
3
|
+
from typing import Any, Optional
|
|
4
|
+
|
|
5
|
+
from pydantic import BaseModel, ConfigDict
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class CollectionResponse(BaseModel):
|
|
9
|
+
"""STEP collection representation."""
|
|
10
|
+
model_config = ConfigDict(extra="allow")
|
|
11
|
+
|
|
12
|
+
id: str
|
|
13
|
+
name: str | None = None
|
|
14
|
+
parent: str | None = None
|
|
15
|
+
values: Optional[dict[str, Any]] = None
|
|
16
|
+
content: Optional[list[dict[str, Any]]] = None
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class CollectionGroupResponse(BaseModel):
|
|
20
|
+
"""STEP collection group representation."""
|
|
21
|
+
model_config = ConfigDict(extra="allow")
|
|
22
|
+
|
|
23
|
+
id: str
|
|
24
|
+
name: str | None = None
|
|
25
|
+
parent: str | None = None
|
|
26
|
+
values: Optional[dict[str, Any]] = None
|