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.
Files changed (70) hide show
  1. stepxmlclient/__init__.py +22 -0
  2. stepxmlclient/client.py +373 -0
  3. stepxmlclient/creator.py +317 -0
  4. stepxmlclient/model/__init__.py +418 -0
  5. stepxmlclient/model/asset.py +250 -0
  6. stepxmlclient/model/attribute.py +288 -0
  7. stepxmlclient/model/business.py +233 -0
  8. stepxmlclient/model/classification.py +409 -0
  9. stepxmlclient/model/complex_elements.py +260 -0
  10. stepxmlclient/model/deletion.py +87 -0
  11. stepxmlclient/model/entity.py +368 -0
  12. stepxmlclient/model/metadata.py +199 -0
  13. stepxmlclient/model/organization.py +167 -0
  14. stepxmlclient/model/product.py +519 -0
  15. stepxmlclient/model/relations.py +105 -0
  16. stepxmlclient/model/replacement.py +417 -0
  17. stepxmlclient/parser.py +2805 -0
  18. stepxmlclient/rest_client/__init__.py +16 -0
  19. stepxmlclient/rest_client/base.py +388 -0
  20. stepxmlclient/rest_client/client.py +127 -0
  21. stepxmlclient/rest_client/exceptions.py +97 -0
  22. stepxmlclient/rest_client/models/__init__.py +175 -0
  23. stepxmlclient/rest_client/models/asset.py +253 -0
  24. stepxmlclient/rest_client/models/attribute.py +112 -0
  25. stepxmlclient/rest_client/models/background_process.py +23 -0
  26. stepxmlclient/rest_client/models/batch.py +41 -0
  27. stepxmlclient/rest_client/models/classification.py +57 -0
  28. stepxmlclient/rest_client/models/collection.py +26 -0
  29. stepxmlclient/rest_client/models/common.py +192 -0
  30. stepxmlclient/rest_client/models/context.py +16 -0
  31. stepxmlclient/rest_client/models/data_type_group.py +15 -0
  32. stepxmlclient/rest_client/models/entity.py +63 -0
  33. stepxmlclient/rest_client/models/event_processor.py +15 -0
  34. stepxmlclient/rest_client/models/import_export.py +43 -0
  35. stepxmlclient/rest_client/models/integration_endpoint.py +16 -0
  36. stepxmlclient/rest_client/models/product.py +200 -0
  37. stepxmlclient/rest_client/models/relations.py +280 -0
  38. stepxmlclient/rest_client/models/system_information.py +11 -0
  39. stepxmlclient/rest_client/models/user.py +28 -0
  40. stepxmlclient/rest_client/models/workflow.py +30 -0
  41. stepxmlclient/rest_client/operations/__init__.py +54 -0
  42. stepxmlclient/rest_client/operations/assets.py +652 -0
  43. stepxmlclient/rest_client/operations/attributes.py +252 -0
  44. stepxmlclient/rest_client/operations/background_processes.py +84 -0
  45. stepxmlclient/rest_client/operations/batch.py +28 -0
  46. stepxmlclient/rest_client/operations/classifications.py +248 -0
  47. stepxmlclient/rest_client/operations/collection_groups.py +46 -0
  48. stepxmlclient/rest_client/operations/collections.py +67 -0
  49. stepxmlclient/rest_client/operations/contexts.py +88 -0
  50. stepxmlclient/rest_client/operations/data_type_groups.py +68 -0
  51. stepxmlclient/rest_client/operations/entities.py +295 -0
  52. stepxmlclient/rest_client/operations/event_processors.py +109 -0
  53. stepxmlclient/rest_client/operations/exports.py +153 -0
  54. stepxmlclient/rest_client/operations/gateway.py +53 -0
  55. stepxmlclient/rest_client/operations/inbound.py +472 -0
  56. stepxmlclient/rest_client/operations/outbound.py +64 -0
  57. stepxmlclient/rest_client/operations/products.py +489 -0
  58. stepxmlclient/rest_client/operations/relations.py +349 -0
  59. stepxmlclient/rest_client/operations/reports.py +27 -0
  60. stepxmlclient/rest_client/operations/system_information.py +28 -0
  61. stepxmlclient/rest_client/operations/user_groups.py +79 -0
  62. stepxmlclient/rest_client/operations/users.py +119 -0
  63. stepxmlclient/rest_client/operations/workflow_tasks.py +61 -0
  64. stepxmlclient/rest_client/operations/workflows.py +50 -0
  65. stepxmlclient/upload.py +293 -0
  66. stepxmlclient-1.0.0.dist-info/METADATA +666 -0
  67. stepxmlclient-1.0.0.dist-info/RECORD +70 -0
  68. stepxmlclient-1.0.0.dist-info/WHEEL +5 -0
  69. stepxmlclient-1.0.0.dist-info/licenses/LICENSE +21 -0
  70. stepxmlclient-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,280 @@
1
+ """Relationship and relation model classes for STEP REST API v2."""
2
+
3
+ from typing import Any, Dict, List, Optional
4
+
5
+ from pydantic import BaseModel, ConfigDict, Field
6
+
7
+
8
+ class RelationshipTypeResponse(BaseModel):
9
+ """Reference type definition (maps to STEP ``ReferenceType`` schema).
10
+
11
+ All fields are optional because the STEP REST API spec declares
12
+ ``required: []`` on this schema.
13
+ """
14
+
15
+ model_config = ConfigDict(populate_by_name=True, json_schema_extra={
16
+ "example": {
17
+ "id": "IS_PART_OF",
18
+ "name": "Is Part Of",
19
+ "productClassificationLinkType": False,
20
+ "multivalued": True
21
+ }
22
+ })
23
+
24
+ # Primary spec field — the STEP API returns 'id', not 'relationshipTypeId'.
25
+ id: str | None = Field(None, description="Reference type ID (spec field)")
26
+ # Backward-compatible alias so callers that used the old field name still work.
27
+ relationshipTypeId: str | None = Field(None, description="Alias for id (legacy field name)")
28
+ name: str | None = Field(None, description="Display name")
29
+ productClassificationLinkType: Optional[bool] = Field(None, description="Whether this is a classification link type")
30
+ multivalued: Optional[bool] = Field(None, description="Whether multiple targets are allowed")
31
+ validSourceObjectTypes: Optional[List[str]] = Field(None, description="Valid source object types")
32
+ validTargetObjectTypes: Optional[List[str]] = Field(None, description="Valid target object types")
33
+ # Legacy optional fields kept for backward compatibility
34
+ description: str | None = Field(None, description="Type description")
35
+ isDirectional: Optional[bool] = Field(None, description="Whether relationship is directional")
36
+ bidirectionalName: str | None = Field(None, description="Reverse relationship name")
37
+
38
+
39
+ class RelationshipResponse(BaseModel):
40
+ """Single reference/link between entities (maps to STEP ``ReferenceEntry`` schema).
41
+
42
+ All fields are optional because the STEP REST API spec declares
43
+ ``required: []`` on ``ReferenceEntry``. The spec fields are
44
+ ``contextLocal``, ``inherited``, ``target``, ``targetType``, ``values``,
45
+ and ``entity``.
46
+ """
47
+
48
+ model_config = ConfigDict(populate_by_name=True, json_schema_extra={
49
+ "example": {
50
+ "target": "PROD_002",
51
+ "targetType": "Product",
52
+ "contextLocal": True,
53
+ "inherited": False
54
+ }
55
+ })
56
+
57
+ # Spec-defined fields (ReferenceEntry)
58
+ contextLocal: Optional[bool] = Field(None, description="Whether the reference is context-local")
59
+ inherited: Optional[bool] = Field(None, description="Whether the reference is inherited")
60
+ target: str | None = Field(None, description="Target entity ID")
61
+ targetType: str | None = Field(None, description="Target entity type")
62
+ values: Optional[Dict[str, Any]] = Field(None, description="Reference attribute values")
63
+ entity: Optional[Dict[str, Any]] = Field(None, description="Embedded target entity")
64
+ # Legacy fields kept for backward compatibility
65
+ relationshipId: str | None = Field(None, description="Relationship ID (legacy)")
66
+ relationshipType: str | None = Field(None, description="Relationship type (legacy)")
67
+ sourceId: str | None = Field(None, description="Source entity ID (legacy)")
68
+ targetId: str | None = Field(None, description="Target entity ID (legacy alias for target)")
69
+ sourceType: str | None = Field(None, description="Source entity type (legacy)")
70
+ createdAt: str | None = Field(None, description="Creation timestamp")
71
+ modifiedAt: str | None = Field(None, description="Last modification timestamp")
72
+ metadata: Optional[Dict[str, Any]] = Field(None, description="Reference metadata")
73
+ status: str | None = Field(None, description="Reference status")
74
+
75
+
76
+ class RelationshipListResponse(BaseModel):
77
+ """Response containing list of references.
78
+
79
+ The STEP REST API spec returns a ``Reference`` schema for list-reference
80
+ endpoints, which has an empty properties definition (``required: []``).
81
+ All fields here are therefore optional.
82
+ """
83
+
84
+ model_config = ConfigDict(populate_by_name=True, json_schema_extra={
85
+ "example": {
86
+ "relationships": [],
87
+ "totalCount": 0,
88
+ "limit": 20,
89
+ "offset": 0
90
+ }
91
+ })
92
+
93
+ relationships: Optional[List[RelationshipResponse]] = Field(None, description="List of references")
94
+ totalCount: Optional[int] = Field(None, description="Total number of references")
95
+ limit: Optional[int] = Field(None, description="Result limit")
96
+ offset: Optional[int] = Field(None, description="Result offset")
97
+
98
+
99
+ class CrossReferenceResponse(BaseModel):
100
+ """Cross-reference between entities."""
101
+
102
+ model_config = ConfigDict(json_schema_extra={
103
+ "example": {
104
+ "crossReferenceId": "XREF_001",
105
+ "sourceEntityId": "PROD_001",
106
+ "targetEntityId": "PROD_002",
107
+ "referenceType": "RELATED_PRODUCT",
108
+ "description": "Alternative color variant",
109
+ "sequence": 1
110
+ }
111
+ })
112
+
113
+ crossReferenceId: str = Field(..., description="Unique cross-reference ID")
114
+ sourceEntityId: str = Field(..., description="Source entity ID")
115
+ targetEntityId: str = Field(..., description="Target entity ID")
116
+ referenceType: str = Field(..., description="Type of cross-reference")
117
+ description: str | None = Field(None, description="Reference description")
118
+ sequence: Optional[int] = Field(None, description="Display sequence")
119
+ createdAt: str | None = Field(None, description="Creation timestamp")
120
+
121
+
122
+ class CrossReferenceListResponse(BaseModel):
123
+ """Response containing list of cross-references."""
124
+
125
+ model_config = ConfigDict(json_schema_extra={
126
+ "example": {
127
+ "crossReferences": [
128
+ {"crossReferenceId": "XREF_001", "sourceEntityId": "PROD_001", "targetEntityId": "PROD_002", "referenceType": "RELATED_PRODUCT"}
129
+ ],
130
+ "totalCount": 50,
131
+ "limit": 20,
132
+ "offset": 0
133
+ }
134
+ })
135
+
136
+ crossReferences: List[CrossReferenceResponse] = Field(..., description="List of cross-references")
137
+ totalCount: int = Field(..., description="Total number of cross-references")
138
+ limit: int = Field(..., description="Result limit")
139
+ offset: int = Field(..., description="Result offset")
140
+
141
+
142
+ class RelationshipCreateRequest(BaseModel):
143
+ """Request to create a new relationship."""
144
+
145
+ model_config = ConfigDict(json_schema_extra={
146
+ "example": {
147
+ "relationshipType": "IS_PART_OF",
148
+ "sourceId": "PROD_001",
149
+ "targetId": "PROD_002",
150
+ "metadata": {"quantity": 5}
151
+ }
152
+ })
153
+
154
+ relationshipType: str = Field(..., description="Type of relationship to create")
155
+ sourceId: str = Field(..., description="Source entity ID")
156
+ targetId: str = Field(..., description="Target entity ID")
157
+ metadata: Optional[Dict[str, Any]] = Field(None, description="Relationship metadata")
158
+ status: str | None = Field("ACTIVE", description="Initial status")
159
+
160
+
161
+ class RelationshipUpdateRequest(BaseModel):
162
+ """Request to update an existing relationship."""
163
+
164
+ model_config = ConfigDict(json_schema_extra={
165
+ "example": {
166
+ "metadata": {"quantity": 10},
167
+ "status": "ACTIVE"
168
+ }
169
+ })
170
+
171
+ metadata: Optional[Dict[str, Any]] = Field(None, description="Updated metadata")
172
+ status: str | None = Field(None, description="Updated status")
173
+
174
+
175
+ class CrossReferenceCreateRequest(BaseModel):
176
+ """Request to create a cross-reference."""
177
+
178
+ model_config = ConfigDict(json_schema_extra={
179
+ "example": {
180
+ "sourceEntityId": "PROD_001",
181
+ "targetEntityId": "PROD_002",
182
+ "referenceType": "RELATED_PRODUCT",
183
+ "description": "Alternative color variant",
184
+ "sequence": 1
185
+ }
186
+ })
187
+
188
+ sourceEntityId: str = Field(..., description="Source entity ID")
189
+ targetEntityId: str = Field(..., description="Target entity ID")
190
+ referenceType: str = Field(..., description="Type of cross-reference")
191
+ description: str | None = Field(None, description="Reference description")
192
+ sequence: Optional[int] = Field(None, description="Display sequence")
193
+
194
+
195
+ class RelationshipGraphResponse(BaseModel):
196
+ """Graph representation of entity relationships."""
197
+
198
+ model_config = ConfigDict(json_schema_extra={
199
+ "example": {
200
+ "rootEntityId": "PROD_001",
201
+ "rootEntityType": "Product",
202
+ "nodes": [
203
+ {"entityId": "PROD_001", "entityType": "Product", "label": "Main Product"}
204
+ ],
205
+ "edges": [
206
+ {"source": "PROD_001", "target": "PROD_002", "relationshipType": "IS_PART_OF"}
207
+ ],
208
+ "depth": 2
209
+ }
210
+ })
211
+
212
+ rootEntityId: str = Field(..., description="Root entity ID")
213
+ rootEntityType: str = Field(..., description="Root entity type")
214
+ nodes: List[Dict[str, Any]] = Field(..., description="Graph nodes")
215
+ edges: List[Dict[str, Any]] = Field(..., description="Graph edges")
216
+ depth: Optional[int] = Field(None, description="Graph depth/levels")
217
+ totalNodes: Optional[int] = Field(None, description="Total nodes in graph")
218
+ totalEdges: Optional[int] = Field(None, description="Total edges in graph")
219
+
220
+
221
+ class LinkResponse(BaseModel):
222
+ """Product/Asset link or attachment."""
223
+
224
+ model_config = ConfigDict(json_schema_extra={
225
+ "example": {
226
+ "linkId": "LINK_001",
227
+ "sourceId": "PROD_001",
228
+ "targetId": "ASSET_001",
229
+ "linkType": "PRODUCT_IMAGE",
230
+ "sequence": 1,
231
+ "metadata": {"isPrimary": True}
232
+ }
233
+ })
234
+
235
+ linkId: str = Field(..., description="Unique link ID")
236
+ sourceId: str = Field(..., description="Source entity ID")
237
+ targetId: str = Field(..., description="Target entity ID")
238
+ linkType: str = Field(..., description="Type of link (PRODUCT_IMAGE, PRODUCT_DOCUMENT, etc.)")
239
+ sequence: Optional[int] = Field(None, description="Display sequence")
240
+ metadata: Optional[Dict[str, Any]] = Field(None, description="Link metadata")
241
+ createdAt: str | None = Field(None, description="Creation timestamp")
242
+
243
+
244
+ class LinkListResponse(BaseModel):
245
+ """Response containing list of links."""
246
+
247
+ model_config = ConfigDict(json_schema_extra={
248
+ "example": {
249
+ "links": [
250
+ {"linkId": "LINK_001", "sourceId": "PROD_001", "targetId": "ASSET_001", "linkType": "PRODUCT_IMAGE"}
251
+ ],
252
+ "totalCount": 25,
253
+ "limit": 20,
254
+ "offset": 0
255
+ }
256
+ })
257
+
258
+ links: List[LinkResponse] = Field(..., description="List of links")
259
+ totalCount: int = Field(..., description="Total number of links")
260
+ limit: int = Field(..., description="Result limit")
261
+ offset: int = Field(..., description="Result offset")
262
+
263
+
264
+ class LinkCreateRequest(BaseModel):
265
+ """Request to create a link."""
266
+
267
+ model_config = ConfigDict(json_schema_extra={
268
+ "example": {
269
+ "sourceId": "PROD_001",
270
+ "targetId": "ASSET_001",
271
+ "linkType": "PRODUCT_IMAGE",
272
+ "sequence": 1
273
+ }
274
+ })
275
+
276
+ sourceId: str = Field(..., description="Source entity ID")
277
+ targetId: str = Field(..., description="Target entity ID")
278
+ linkType: str = Field(..., description="Type of link")
279
+ sequence: Optional[int] = Field(None, description="Display sequence")
280
+ metadata: Optional[Dict[str, Any]] = Field(None, description="Link metadata")
@@ -0,0 +1,11 @@
1
+ """System information model for STEP REST API v2."""
2
+
3
+ from pydantic import BaseModel, ConfigDict
4
+
5
+
6
+ class SystemInformationResponse(BaseModel):
7
+ """System information returned by GET /system-information."""
8
+ model_config = ConfigDict(extra="allow")
9
+
10
+ customer_name: str | None = None
11
+ system_name: str | None = None
@@ -0,0 +1,28 @@
1
+ """User and user 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 UserResponse(BaseModel):
9
+ """STEP user representation."""
10
+ model_config = ConfigDict(extra="allow")
11
+
12
+ id: str
13
+ name: str | None = None
14
+ email: str | None = None
15
+ deactivated: Optional[bool] = None
16
+ values: Optional[dict[str, Any]] = None
17
+ user_groups: Optional[list[str]] = None
18
+
19
+
20
+ class UserGroupResponse(BaseModel):
21
+ """STEP user group representation."""
22
+ model_config = ConfigDict(extra="allow")
23
+
24
+ id: str
25
+ parent_id: str | None = None
26
+ name: str | None = None
27
+ vendor_root: str | None = None
28
+ values: Optional[dict[str, Any]] = None
@@ -0,0 +1,30 @@
1
+ """Workflow and workflow task models for STEP REST API v2."""
2
+
3
+ from typing import Any, Optional
4
+
5
+ from pydantic import BaseModel, ConfigDict
6
+
7
+
8
+ class WorkflowResponse(BaseModel):
9
+ """STEP workflow definition."""
10
+ model_config = ConfigDict(extra="allow")
11
+
12
+ id: str
13
+ name: str | None = None
14
+ valid_object_types: Optional[list[str]] = None
15
+
16
+
17
+ class WorkflowTaskResponse(BaseModel):
18
+ """STEP workflow task."""
19
+ model_config = ConfigDict(extra="allow")
20
+
21
+ id: str
22
+ node: Optional[dict[str, Any]] = None
23
+ workflow: str | None = None
24
+ state: str | None = None
25
+ user_assignee: str | None = None
26
+ group_assignee: str | None = None
27
+ deadline: str | None = None
28
+ status_flag: Optional[dict[str, Any]] = None
29
+ task_creation_time: str | None = None
30
+ instance: str | None = None
@@ -0,0 +1,54 @@
1
+ """REST API operations for STEP REST API v2.
2
+
3
+ Operation groups for different STEP entity types.
4
+ """
5
+
6
+ from .assets import AssetOperations
7
+ from .attributes import AttributeOperations
8
+ from .background_processes import BackgroundProcessOperations
9
+ from .batch import BatchOperations
10
+ from .classifications import ClassificationOperations
11
+ from .collection_groups import CollectionGroupOperations
12
+ from .collections import CollectionOperations
13
+ from .contexts import ContextOperations
14
+ from .data_type_groups import DataTypeGroupOperations
15
+ from .entities import EntityOperations
16
+ from .event_processors import EventProcessorOperations
17
+ from .exports import ExportOperations
18
+ from .gateway import GatewayOperations
19
+ from .inbound import InboundOperations
20
+ from .outbound import OutboundOperations
21
+ from .products import ProductOperations
22
+ from .relations import RelationOperations
23
+ from .reports import ReportOperations
24
+ from .system_information import SystemInformationOperations
25
+ from .user_groups import UserGroupOperations
26
+ from .users import UserOperations
27
+ from .workflow_tasks import WorkflowTaskOperations
28
+ from .workflows import WorkflowOperations
29
+
30
+ __all__ = [
31
+ 'AssetOperations',
32
+ 'AttributeOperations',
33
+ 'BackgroundProcessOperations',
34
+ 'BatchOperations',
35
+ 'ClassificationOperations',
36
+ 'CollectionGroupOperations',
37
+ 'CollectionOperations',
38
+ 'ContextOperations',
39
+ 'DataTypeGroupOperations',
40
+ 'EntityOperations',
41
+ 'EventProcessorOperations',
42
+ 'ExportOperations',
43
+ 'GatewayOperations',
44
+ 'InboundOperations',
45
+ 'OutboundOperations',
46
+ 'ProductOperations',
47
+ 'RelationOperations',
48
+ 'ReportOperations',
49
+ 'SystemInformationOperations',
50
+ 'UserGroupOperations',
51
+ 'UserOperations',
52
+ 'WorkflowOperations',
53
+ 'WorkflowTaskOperations',
54
+ ]