step_rest_client 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.
- step_rest_client/__init__.py +136 -0
- step_rest_client/api/__init__.py +26 -0
- step_rest_client/api/assets_api.py +7960 -0
- step_rest_client/api/attributes_api.py +340 -0
- step_rest_client/api/background_process_types_api.py +640 -0
- step_rest_client/api/background_processes_api.py +1577 -0
- step_rest_client/api/classifications_api.py +7991 -0
- step_rest_client/api/data_container_types_api.py +340 -0
- step_rest_client/api/data_type_groups_api.py +340 -0
- step_rest_client/api/entities_api.py +8680 -0
- step_rest_client/api/event_processors_api.py +3337 -0
- step_rest_client/api/export_api.py +383 -0
- step_rest_client/api/gateway_integration_endpoints_api.py +1232 -0
- step_rest_client/api/import_api.py +390 -0
- step_rest_client/api/inbound_integration_endpoints_api.py +2815 -0
- step_rest_client/api/lists_of_values_api.py +642 -0
- step_rest_client/api/object_types_api.py +340 -0
- step_rest_client/api/outbound_integration_endpoints_api.py +3655 -0
- step_rest_client/api/products_api.py +8007 -0
- step_rest_client/api/reference_types_api.py +340 -0
- step_rest_client/api/reporting_api.py +707 -0
- step_rest_client/api/units_api.py +340 -0
- step_rest_client/api/workflow_tasks_api.py +1887 -0
- step_rest_client/api/workflows_api.py +1270 -0
- step_rest_client/api_client.py +797 -0
- step_rest_client/api_response.py +21 -0
- step_rest_client/configuration.py +597 -0
- step_rest_client/exceptions.py +216 -0
- step_rest_client/models/__init__.py +98 -0
- step_rest_client/models/amount.py +89 -0
- step_rest_client/models/and_condition.py +107 -0
- step_rest_client/models/approval_response.py +87 -0
- step_rest_client/models/approval_status.py +99 -0
- step_rest_client/models/asset.py +129 -0
- step_rest_client/models/attribute.py +120 -0
- step_rest_client/models/attribute_link.py +102 -0
- step_rest_client/models/background_process.py +139 -0
- step_rest_client/models/background_process_attachment_metadata.py +105 -0
- step_rest_client/models/background_process_identification.py +89 -0
- step_rest_client/models/background_process_type.py +89 -0
- step_rest_client/models/classification.py +135 -0
- step_rest_client/models/condition.py +265 -0
- step_rest_client/models/data_container.py +139 -0
- step_rest_client/models/data_container_entry.py +117 -0
- step_rest_client/models/data_container_object_condition.py +181 -0
- step_rest_client/models/data_container_type.py +106 -0
- step_rest_client/models/data_type_group.py +108 -0
- step_rest_client/models/endpoint_statistics.py +109 -0
- step_rest_client/models/endpoint_status.py +99 -0
- step_rest_client/models/entity.py +142 -0
- step_rest_client/models/error.py +91 -0
- step_rest_client/models/event_processor.py +93 -0
- step_rest_client/models/event_processor_statistics.py +97 -0
- step_rest_client/models/event_processor_status.py +99 -0
- step_rest_client/models/event_queue_status.py +89 -0
- step_rest_client/models/execution_report_entry.py +103 -0
- step_rest_client/models/export_specification.py +89 -0
- step_rest_client/models/find_similar_business_rule_result.py +91 -0
- step_rest_client/models/find_similar_entities_request.py +95 -0
- step_rest_client/models/find_similar_entities_response.py +103 -0
- step_rest_client/models/find_similar_entities_response_record.py +95 -0
- step_rest_client/models/find_similar_execution_report.py +103 -0
- step_rest_client/models/gateway_integration_endpoint.py +93 -0
- step_rest_client/models/has_data_container_object_condition.py +106 -0
- step_rest_client/models/has_reference_to_condition.py +108 -0
- step_rest_client/models/id_condition.py +105 -0
- step_rest_client/models/inbound_integration_endpoint.py +93 -0
- step_rest_client/models/incoming_reference_entry.py +118 -0
- step_rest_client/models/list_of_values.py +110 -0
- step_rest_client/models/list_of_values_entry.py +91 -0
- step_rest_client/models/lov_value_condition.py +100 -0
- step_rest_client/models/match_and_merge_execution_report.py +119 -0
- step_rest_client/models/match_and_merge_general_execution_report.py +91 -0
- step_rest_client/models/match_and_merge_potential_duplicate.py +93 -0
- step_rest_client/models/match_and_merge_record_in.py +95 -0
- step_rest_client/models/match_and_merge_record_out.py +117 -0
- step_rest_client/models/match_and_merge_response.py +103 -0
- step_rest_client/models/multi_data_container.py +101 -0
- step_rest_client/models/multi_reference.py +97 -0
- step_rest_client/models/multi_value.py +103 -0
- step_rest_client/models/name_condition.py +107 -0
- step_rest_client/models/numeric_value_condition.py +111 -0
- step_rest_client/models/object_type.py +104 -0
- step_rest_client/models/object_type_condition.py +96 -0
- step_rest_client/models/or_condition.py +107 -0
- step_rest_client/models/outbound_integration_endpoint.py +93 -0
- step_rest_client/models/product.py +150 -0
- step_rest_client/models/query.py +91 -0
- step_rest_client/models/query_result.py +99 -0
- step_rest_client/models/reference.py +139 -0
- step_rest_client/models/reference_entry.py +141 -0
- step_rest_client/models/reference_metadata_condition.py +181 -0
- step_rest_client/models/reference_type.py +114 -0
- step_rest_client/models/rejected_by_business_condition.py +93 -0
- step_rest_client/models/simple_below_condition.py +105 -0
- step_rest_client/models/single_data_container.py +97 -0
- step_rest_client/models/single_reference.py +93 -0
- step_rest_client/models/single_value.py +103 -0
- step_rest_client/models/status_flag.py +89 -0
- step_rest_client/models/text_value_condition.py +111 -0
- step_rest_client/models/trigger_workflow_event.py +93 -0
- step_rest_client/models/unit.py +104 -0
- step_rest_client/models/value.py +137 -0
- step_rest_client/models/value_entry.py +91 -0
- step_rest_client/models/workflow.py +91 -0
- step_rest_client/models/workflow_event.py +89 -0
- step_rest_client/models/workflow_instance.py +87 -0
- step_rest_client/models/workflow_instance_creation.py +93 -0
- step_rest_client/models/workflow_node.py +99 -0
- step_rest_client/models/workflow_task.py +113 -0
- step_rest_client/models/workflow_task_query.py +101 -0
- step_rest_client/py.typed +0 -0
- step_rest_client/rest.py +258 -0
- step_rest_client-1.0.0.dist-info/METADATA +23 -0
- step_rest_client-1.0.0.dist-info/RECORD +117 -0
- step_rest_client-1.0.0.dist-info/WHEEL +5 -0
- step_rest_client-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,181 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
STEP REST API V2
|
5
|
+
|
6
|
+
<h1>About</h1><p>The STEP REST API V2 provides read and write access to a set of core STEP objects using the HTTP operations GET, PUT, POST, PATCH and DELETE.</p><h1>Resource Representation</h1><p>With the exception of a few resource operations for retrieving and uploading binary data, all request and response bodies are JSON, compliant with the schema documented here.</p><h1>Context and Workspace</h1><p>All requests are handled in a specific STEP context and workspace and both can be specified via query parameters available for all resource operations. A context must always be specified while requests per default will be handled in the "Main" workspace.</p><h1>Polymorphism</h1><p>In STEP, attributes, reference types and data container types can all be either single- or multivalued. The STEP REST API V2 uses polymorphism to address this complexity with resources that include values, references and data containers specified to produce and consume a common "abstract" supertype that always will be one of either the single- or multivalued subtype.<br/>As an example, the GET /entities/{id}/values/{attributeId} resource operation is specified to return a "Value" but as evident from the model, the "Value" will always be "oneOf" either "SingleValue", that has a "value" property for which the value is an object, or "MultiValue", that has a "values" property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property ("values", "references" and "dataContainers") to determine the concrete type.</p><h1>Authentication</h1><p>The REST API is protected by HTTP Basic Authentication or if OAuth2-based authentication is enabled (SaaS customers only), by Bearer Authentication. With Basic Authentication, user name and password are supplied with each request and it is therefore highly recommended to only use the API in conjunction with HTTPS. For more information about OAuth2-based authentication for SaaS customers, please see the STEP Authentication Guide.</p><h1>Versioning</h1><p>The STEP REST API V2 is versioned using semantic versioning. Stibo Systems reserve the right to make non-breaking, minor / patch changes in any release without warning and clients must be coded / configured to be 'tolerant' and capable of handling such changes.</p><p>Examples of breaking, major changes:</p><ul><li>Renaming of a property</li><li>Removal of a property</li><li>Property type change</li><li>Addition of new property required for write operations</li><li>Marking existing property as required for write operations</li><li>Removal of resource or resource operation</li><li>Materially different behavior for existing resource operation</li></ul><p>Examples of non-breaking, minor / patch changes:</p><ul><li>Addition of new properties in request responses</li><li>Addition of new query parameter not required for write operations</li><li>Addition of new resource or resource operation</li><li>Bug fixes that do not change the schema or resource operations as described here</li><li>Inclusion of a response body for resource operations specified to return a 200 response with no body</li><li>Change of response "Model" / "schema" to type extending the previously specified type</li><li>Renaming a "Model" / "schema" type</li></ul><p>In addition, error message texts may change without warning within the same version. Client program logic should not depend upon the message content.</p><h1>Error Handling</h1><p>The STEP REST API V2 responds with standard HTTP status codes, with 2** responses indicating a success, 4** responses indicating a client error and 5** indicating a server error. Notice that this specification does not specify common error responses like 500 (internal server error) or 401 (unauthorized) for the individual resource operations. Clients should however be capable of handling such responses.</p><p>Error responses have a JSON response body (see Error schema below) containing HTTP status code information in addition to a message providing details about the error. As mentioned above, client program logic should not depend upon the message content.</p><p>The specific status codes used in the API are:</p><ul><li>200 (OK): Success, response may or may not have a body</li><li>201 (Created): Entity successfully created, response may or may not have a body</li><li>400 (Bad request): The server cannot or will not process the request due to an apparent client error</li><li>401 (Unauthorized): Returned only in relation to failed authentication</li><li>404 (Not Found): Returned only in relation to objects specified via path parameters (variable parts of the URL). If STEP objects referenced in request bodies or via query parameters cannot be found, the response will be 400.</li><li>429 (Too Many Requests): Clients are per default limited to 100 requests per second. Returned if the rate limit is exceeded.</li><li>500 (Internal Server Error): Unexpected error (could potentially cover an issue that rightfully should be a 400)</li></ul>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import json
|
17
|
+
import pprint
|
18
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
19
|
+
from typing import Any, List, Optional
|
20
|
+
from step_rest_client.models.lov_value_condition import LovValueCondition
|
21
|
+
from step_rest_client.models.numeric_value_condition import NumericValueCondition
|
22
|
+
from step_rest_client.models.text_value_condition import TextValueCondition
|
23
|
+
from pydantic import StrictStr, Field
|
24
|
+
from typing import Union, List, Set, Optional, Dict
|
25
|
+
from typing_extensions import Literal, Self
|
26
|
+
|
27
|
+
DATACONTAINEROBJECTCONDITION_ONE_OF_SCHEMAS = ["AndCondition", "LovValueCondition", "NumericValueCondition", "OrCondition", "TextValueCondition"]
|
28
|
+
|
29
|
+
class DataContainerObjectCondition(BaseModel):
|
30
|
+
"""
|
31
|
+
An \"abstract\" representation of a condition that can be used to match data container objects. Must always either be an AndCondition, an OrCondition, a TextValueCondition, a NumericValueCondition, or an LovValueCondition. Notice that conditions nested in compound conditions must also be valid data container object conditions.
|
32
|
+
"""
|
33
|
+
# data type: AndCondition
|
34
|
+
oneof_schema_1_validator: Optional[AndCondition] = None
|
35
|
+
# data type: OrCondition
|
36
|
+
oneof_schema_2_validator: Optional[OrCondition] = None
|
37
|
+
# data type: TextValueCondition
|
38
|
+
oneof_schema_3_validator: Optional[TextValueCondition] = None
|
39
|
+
# data type: NumericValueCondition
|
40
|
+
oneof_schema_4_validator: Optional[NumericValueCondition] = None
|
41
|
+
# data type: LovValueCondition
|
42
|
+
oneof_schema_5_validator: Optional[LovValueCondition] = None
|
43
|
+
actual_instance: Optional[Union[AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition]] = None
|
44
|
+
one_of_schemas: Set[str] = { "AndCondition", "LovValueCondition", "NumericValueCondition", "OrCondition", "TextValueCondition" }
|
45
|
+
|
46
|
+
model_config = ConfigDict(
|
47
|
+
validate_assignment=True,
|
48
|
+
protected_namespaces=(),
|
49
|
+
)
|
50
|
+
|
51
|
+
|
52
|
+
def __init__(self, *args, **kwargs) -> None:
|
53
|
+
if args:
|
54
|
+
if len(args) > 1:
|
55
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
56
|
+
if kwargs:
|
57
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
58
|
+
super().__init__(actual_instance=args[0])
|
59
|
+
else:
|
60
|
+
super().__init__(**kwargs)
|
61
|
+
|
62
|
+
@field_validator('actual_instance')
|
63
|
+
def actual_instance_must_validate_oneof(cls, v):
|
64
|
+
instance = DataContainerObjectCondition.model_construct()
|
65
|
+
error_messages = []
|
66
|
+
match = 0
|
67
|
+
# validate data type: AndCondition
|
68
|
+
if not isinstance(v, AndCondition):
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `AndCondition`")
|
70
|
+
else:
|
71
|
+
match += 1
|
72
|
+
# validate data type: OrCondition
|
73
|
+
if not isinstance(v, OrCondition):
|
74
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `OrCondition`")
|
75
|
+
else:
|
76
|
+
match += 1
|
77
|
+
# validate data type: TextValueCondition
|
78
|
+
if not isinstance(v, TextValueCondition):
|
79
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `TextValueCondition`")
|
80
|
+
else:
|
81
|
+
match += 1
|
82
|
+
# validate data type: NumericValueCondition
|
83
|
+
if not isinstance(v, NumericValueCondition):
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NumericValueCondition`")
|
85
|
+
else:
|
86
|
+
match += 1
|
87
|
+
# validate data type: LovValueCondition
|
88
|
+
if not isinstance(v, LovValueCondition):
|
89
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `LovValueCondition`")
|
90
|
+
else:
|
91
|
+
match += 1
|
92
|
+
if match > 1:
|
93
|
+
# more than 1 match
|
94
|
+
raise ValueError("Multiple matches found when setting `actual_instance` in DataContainerObjectCondition with oneOf schemas: AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition. Details: " + ", ".join(error_messages))
|
95
|
+
elif match == 0:
|
96
|
+
# no match
|
97
|
+
raise ValueError("No match found when setting `actual_instance` in DataContainerObjectCondition with oneOf schemas: AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition. Details: " + ", ".join(error_messages))
|
98
|
+
else:
|
99
|
+
return v
|
100
|
+
|
101
|
+
@classmethod
|
102
|
+
def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
|
103
|
+
return cls.from_json(json.dumps(obj))
|
104
|
+
|
105
|
+
@classmethod
|
106
|
+
def from_json(cls, json_str: str) -> Self:
|
107
|
+
"""Returns the object represented by the json string"""
|
108
|
+
instance = cls.model_construct()
|
109
|
+
error_messages = []
|
110
|
+
match = 0
|
111
|
+
|
112
|
+
# deserialize data into AndCondition
|
113
|
+
try:
|
114
|
+
instance.actual_instance = AndCondition.from_json(json_str)
|
115
|
+
match += 1
|
116
|
+
except (ValidationError, ValueError) as e:
|
117
|
+
error_messages.append(str(e))
|
118
|
+
# deserialize data into OrCondition
|
119
|
+
try:
|
120
|
+
instance.actual_instance = OrCondition.from_json(json_str)
|
121
|
+
match += 1
|
122
|
+
except (ValidationError, ValueError) as e:
|
123
|
+
error_messages.append(str(e))
|
124
|
+
# deserialize data into TextValueCondition
|
125
|
+
try:
|
126
|
+
instance.actual_instance = TextValueCondition.from_json(json_str)
|
127
|
+
match += 1
|
128
|
+
except (ValidationError, ValueError) as e:
|
129
|
+
error_messages.append(str(e))
|
130
|
+
# deserialize data into NumericValueCondition
|
131
|
+
try:
|
132
|
+
instance.actual_instance = NumericValueCondition.from_json(json_str)
|
133
|
+
match += 1
|
134
|
+
except (ValidationError, ValueError) as e:
|
135
|
+
error_messages.append(str(e))
|
136
|
+
# deserialize data into LovValueCondition
|
137
|
+
try:
|
138
|
+
instance.actual_instance = LovValueCondition.from_json(json_str)
|
139
|
+
match += 1
|
140
|
+
except (ValidationError, ValueError) as e:
|
141
|
+
error_messages.append(str(e))
|
142
|
+
|
143
|
+
if match > 1:
|
144
|
+
# more than 1 match
|
145
|
+
raise ValueError("Multiple matches found when deserializing the JSON string into DataContainerObjectCondition with oneOf schemas: AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition. Details: " + ", ".join(error_messages))
|
146
|
+
elif match == 0:
|
147
|
+
# no match
|
148
|
+
raise ValueError("No match found when deserializing the JSON string into DataContainerObjectCondition with oneOf schemas: AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition. Details: " + ", ".join(error_messages))
|
149
|
+
else:
|
150
|
+
return instance
|
151
|
+
|
152
|
+
def to_json(self) -> str:
|
153
|
+
"""Returns the JSON representation of the actual instance"""
|
154
|
+
if self.actual_instance is None:
|
155
|
+
return "null"
|
156
|
+
|
157
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
158
|
+
return self.actual_instance.to_json()
|
159
|
+
else:
|
160
|
+
return json.dumps(self.actual_instance)
|
161
|
+
|
162
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], AndCondition, LovValueCondition, NumericValueCondition, OrCondition, TextValueCondition]]:
|
163
|
+
"""Returns the dict representation of the actual instance"""
|
164
|
+
if self.actual_instance is None:
|
165
|
+
return None
|
166
|
+
|
167
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
168
|
+
return self.actual_instance.to_dict()
|
169
|
+
else:
|
170
|
+
# primitive type
|
171
|
+
return self.actual_instance
|
172
|
+
|
173
|
+
def to_str(self) -> str:
|
174
|
+
"""Returns the string representation of the actual instance"""
|
175
|
+
return pprint.pformat(self.model_dump())
|
176
|
+
|
177
|
+
from step_rest_client.models.and_condition import AndCondition
|
178
|
+
from step_rest_client.models.or_condition import OrCondition
|
179
|
+
# TODO: Rewrite to not use raise_errors
|
180
|
+
DataContainerObjectCondition.model_rebuild(raise_errors=False)
|
181
|
+
|
@@ -0,0 +1,106 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
STEP REST API V2
|
5
|
+
|
6
|
+
<h1>About</h1><p>The STEP REST API V2 provides read and write access to a set of core STEP objects using the HTTP operations GET, PUT, POST, PATCH and DELETE.</p><h1>Resource Representation</h1><p>With the exception of a few resource operations for retrieving and uploading binary data, all request and response bodies are JSON, compliant with the schema documented here.</p><h1>Context and Workspace</h1><p>All requests are handled in a specific STEP context and workspace and both can be specified via query parameters available for all resource operations. A context must always be specified while requests per default will be handled in the "Main" workspace.</p><h1>Polymorphism</h1><p>In STEP, attributes, reference types and data container types can all be either single- or multivalued. The STEP REST API V2 uses polymorphism to address this complexity with resources that include values, references and data containers specified to produce and consume a common "abstract" supertype that always will be one of either the single- or multivalued subtype.<br/>As an example, the GET /entities/{id}/values/{attributeId} resource operation is specified to return a "Value" but as evident from the model, the "Value" will always be "oneOf" either "SingleValue", that has a "value" property for which the value is an object, or "MultiValue", that has a "values" property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property ("values", "references" and "dataContainers") to determine the concrete type.</p><h1>Authentication</h1><p>The REST API is protected by HTTP Basic Authentication or if OAuth2-based authentication is enabled (SaaS customers only), by Bearer Authentication. With Basic Authentication, user name and password are supplied with each request and it is therefore highly recommended to only use the API in conjunction with HTTPS. For more information about OAuth2-based authentication for SaaS customers, please see the STEP Authentication Guide.</p><h1>Versioning</h1><p>The STEP REST API V2 is versioned using semantic versioning. Stibo Systems reserve the right to make non-breaking, minor / patch changes in any release without warning and clients must be coded / configured to be 'tolerant' and capable of handling such changes.</p><p>Examples of breaking, major changes:</p><ul><li>Renaming of a property</li><li>Removal of a property</li><li>Property type change</li><li>Addition of new property required for write operations</li><li>Marking existing property as required for write operations</li><li>Removal of resource or resource operation</li><li>Materially different behavior for existing resource operation</li></ul><p>Examples of non-breaking, minor / patch changes:</p><ul><li>Addition of new properties in request responses</li><li>Addition of new query parameter not required for write operations</li><li>Addition of new resource or resource operation</li><li>Bug fixes that do not change the schema or resource operations as described here</li><li>Inclusion of a response body for resource operations specified to return a 200 response with no body</li><li>Change of response "Model" / "schema" to type extending the previously specified type</li><li>Renaming a "Model" / "schema" type</li></ul><p>In addition, error message texts may change without warning within the same version. Client program logic should not depend upon the message content.</p><h1>Error Handling</h1><p>The STEP REST API V2 responds with standard HTTP status codes, with 2** responses indicating a success, 4** responses indicating a client error and 5** indicating a server error. Notice that this specification does not specify common error responses like 500 (internal server error) or 401 (unauthorized) for the individual resource operations. Clients should however be capable of handling such responses.</p><p>Error responses have a JSON response body (see Error schema below) containing HTTP status code information in addition to a message providing details about the error. As mentioned above, client program logic should not depend upon the message content.</p><p>The specific status codes used in the API are:</p><ul><li>200 (OK): Success, response may or may not have a body</li><li>201 (Created): Entity successfully created, response may or may not have a body</li><li>400 (Bad request): The server cannot or will not process the request due to an apparent client error</li><li>401 (Unauthorized): Returned only in relation to failed authentication</li><li>404 (Not Found): Returned only in relation to objects specified via path parameters (variable parts of the URL). If STEP objects referenced in request bodies or via query parameters cannot be found, the response will be 400.</li><li>429 (Too Many Requests): Clients are per default limited to 100 requests per second. Returned if the rate limit is exceeded.</li><li>500 (Internal Server Error): Unexpected error (could potentially cover an issue that rightfully should be a 400)</li></ul>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from step_rest_client.models.value import Value
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class DataContainerType(BaseModel):
|
27
|
+
"""
|
28
|
+
A data container type object
|
29
|
+
""" # noqa: E501
|
30
|
+
id: Optional[StrictStr] = Field(default=None, description="ID of the data container type object")
|
31
|
+
name: Optional[StrictStr] = Field(default=None, description="Data container type name")
|
32
|
+
multivalued: Optional[StrictBool] = Field(default=None, description="Boolean indication of whether the data container type allows for multiple data container entries / objects")
|
33
|
+
values: Optional[Dict[str, Value]] = Field(default=None, description="Data container type metadata values. Keys are attribute IDs and values either a SingleValue or a MultiValue depending on whether the attribute is multivalued.")
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "multivalued", "values"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def to_str(self) -> str:
|
44
|
+
"""Returns the string representation of the model using alias"""
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
+
|
47
|
+
def to_json(self) -> str:
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
+
return json.dumps(self.to_dict())
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
+
"""Create an instance of DataContainerType from a JSON string"""
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
56
|
+
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
"""
|
67
|
+
excluded_fields: Set[str] = set([
|
68
|
+
])
|
69
|
+
|
70
|
+
_dict = self.model_dump(
|
71
|
+
by_alias=True,
|
72
|
+
exclude=excluded_fields,
|
73
|
+
exclude_none=True,
|
74
|
+
)
|
75
|
+
# override the default output from pydantic by calling `to_dict()` of each value in values (dict)
|
76
|
+
_field_dict = {}
|
77
|
+
if self.values:
|
78
|
+
for _key_values in self.values:
|
79
|
+
if self.values[_key_values]:
|
80
|
+
_field_dict[_key_values] = self.values[_key_values].to_dict()
|
81
|
+
_dict['values'] = _field_dict
|
82
|
+
return _dict
|
83
|
+
|
84
|
+
@classmethod
|
85
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
86
|
+
"""Create an instance of DataContainerType from a dict"""
|
87
|
+
if obj is None:
|
88
|
+
return None
|
89
|
+
|
90
|
+
if not isinstance(obj, dict):
|
91
|
+
return cls.model_validate(obj)
|
92
|
+
|
93
|
+
_obj = cls.model_validate({
|
94
|
+
"id": obj.get("id"),
|
95
|
+
"name": obj.get("name"),
|
96
|
+
"multivalued": obj.get("multivalued"),
|
97
|
+
"values": dict(
|
98
|
+
(_k, Value.from_dict(_v))
|
99
|
+
for _k, _v in obj["values"].items()
|
100
|
+
)
|
101
|
+
if obj.get("values") is not None
|
102
|
+
else None
|
103
|
+
})
|
104
|
+
return _obj
|
105
|
+
|
106
|
+
|
@@ -0,0 +1,108 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
STEP REST API V2
|
5
|
+
|
6
|
+
<h1>About</h1><p>The STEP REST API V2 provides read and write access to a set of core STEP objects using the HTTP operations GET, PUT, POST, PATCH and DELETE.</p><h1>Resource Representation</h1><p>With the exception of a few resource operations for retrieving and uploading binary data, all request and response bodies are JSON, compliant with the schema documented here.</p><h1>Context and Workspace</h1><p>All requests are handled in a specific STEP context and workspace and both can be specified via query parameters available for all resource operations. A context must always be specified while requests per default will be handled in the "Main" workspace.</p><h1>Polymorphism</h1><p>In STEP, attributes, reference types and data container types can all be either single- or multivalued. The STEP REST API V2 uses polymorphism to address this complexity with resources that include values, references and data containers specified to produce and consume a common "abstract" supertype that always will be one of either the single- or multivalued subtype.<br/>As an example, the GET /entities/{id}/values/{attributeId} resource operation is specified to return a "Value" but as evident from the model, the "Value" will always be "oneOf" either "SingleValue", that has a "value" property for which the value is an object, or "MultiValue", that has a "values" property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property ("values", "references" and "dataContainers") to determine the concrete type.</p><h1>Authentication</h1><p>The REST API is protected by HTTP Basic Authentication or if OAuth2-based authentication is enabled (SaaS customers only), by Bearer Authentication. With Basic Authentication, user name and password are supplied with each request and it is therefore highly recommended to only use the API in conjunction with HTTPS. For more information about OAuth2-based authentication for SaaS customers, please see the STEP Authentication Guide.</p><h1>Versioning</h1><p>The STEP REST API V2 is versioned using semantic versioning. Stibo Systems reserve the right to make non-breaking, minor / patch changes in any release without warning and clients must be coded / configured to be 'tolerant' and capable of handling such changes.</p><p>Examples of breaking, major changes:</p><ul><li>Renaming of a property</li><li>Removal of a property</li><li>Property type change</li><li>Addition of new property required for write operations</li><li>Marking existing property as required for write operations</li><li>Removal of resource or resource operation</li><li>Materially different behavior for existing resource operation</li></ul><p>Examples of non-breaking, minor / patch changes:</p><ul><li>Addition of new properties in request responses</li><li>Addition of new query parameter not required for write operations</li><li>Addition of new resource or resource operation</li><li>Bug fixes that do not change the schema or resource operations as described here</li><li>Inclusion of a response body for resource operations specified to return a 200 response with no body</li><li>Change of response "Model" / "schema" to type extending the previously specified type</li><li>Renaming a "Model" / "schema" type</li></ul><p>In addition, error message texts may change without warning within the same version. Client program logic should not depend upon the message content.</p><h1>Error Handling</h1><p>The STEP REST API V2 responds with standard HTTP status codes, with 2** responses indicating a success, 4** responses indicating a client error and 5** indicating a server error. Notice that this specification does not specify common error responses like 500 (internal server error) or 401 (unauthorized) for the individual resource operations. Clients should however be capable of handling such responses.</p><p>Error responses have a JSON response body (see Error schema below) containing HTTP status code information in addition to a message providing details about the error. As mentioned above, client program logic should not depend upon the message content.</p><p>The specific status codes used in the API are:</p><ul><li>200 (OK): Success, response may or may not have a body</li><li>201 (Created): Entity successfully created, response may or may not have a body</li><li>400 (Bad request): The server cannot or will not process the request due to an apparent client error</li><li>401 (Unauthorized): Returned only in relation to failed authentication</li><li>404 (Not Found): Returned only in relation to objects specified via path parameters (variable parts of the URL). If STEP objects referenced in request bodies or via query parameters cannot be found, the response will be 400.</li><li>429 (Too Many Requests): Clients are per default limited to 100 requests per second. Returned if the rate limit is exceeded.</li><li>500 (Internal Server Error): Unexpected error (could potentially cover an issue that rightfully should be a 400)</li></ul>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from step_rest_client.models.value import Value
|
23
|
+
from typing import Optional, Set
|
24
|
+
from typing_extensions import Self
|
25
|
+
|
26
|
+
class DataTypeGroup(BaseModel):
|
27
|
+
"""
|
28
|
+
A data type group (a.k.a. \"attribute group\") object
|
29
|
+
""" # noqa: E501
|
30
|
+
id: Optional[StrictStr] = Field(default=None, description="ID of the data type group object")
|
31
|
+
name: Optional[StrictStr] = Field(default=None, description="Data type group name")
|
32
|
+
parent: Optional[StrictStr] = Field(default=None, description="ID of parent data type group")
|
33
|
+
values: Optional[Dict[str, Value]] = Field(default=None, description="Data type group metadata values. Keys are attribute IDs and values either a SingleValue or a MultiValue depending on whether the attribute is multivalued.")
|
34
|
+
__properties: ClassVar[List[str]] = ["id", "name", "parent", "values"]
|
35
|
+
|
36
|
+
model_config = ConfigDict(
|
37
|
+
populate_by_name=True,
|
38
|
+
validate_assignment=True,
|
39
|
+
protected_namespaces=(),
|
40
|
+
)
|
41
|
+
|
42
|
+
|
43
|
+
def to_str(self) -> str:
|
44
|
+
"""Returns the string representation of the model using alias"""
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
46
|
+
|
47
|
+
def to_json(self) -> str:
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
49
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
50
|
+
return json.dumps(self.to_dict())
|
51
|
+
|
52
|
+
@classmethod
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
54
|
+
"""Create an instance of DataTypeGroup from a JSON string"""
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
56
|
+
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
59
|
+
|
60
|
+
This has the following differences from calling pydantic's
|
61
|
+
`self.model_dump(by_alias=True)`:
|
62
|
+
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
64
|
+
were set at model initialization. Other fields with value `None`
|
65
|
+
are ignored.
|
66
|
+
* OpenAPI `readOnly` fields are excluded.
|
67
|
+
"""
|
68
|
+
excluded_fields: Set[str] = set([
|
69
|
+
"id",
|
70
|
+
])
|
71
|
+
|
72
|
+
_dict = self.model_dump(
|
73
|
+
by_alias=True,
|
74
|
+
exclude=excluded_fields,
|
75
|
+
exclude_none=True,
|
76
|
+
)
|
77
|
+
# override the default output from pydantic by calling `to_dict()` of each value in values (dict)
|
78
|
+
_field_dict = {}
|
79
|
+
if self.values:
|
80
|
+
for _key_values in self.values:
|
81
|
+
if self.values[_key_values]:
|
82
|
+
_field_dict[_key_values] = self.values[_key_values].to_dict()
|
83
|
+
_dict['values'] = _field_dict
|
84
|
+
return _dict
|
85
|
+
|
86
|
+
@classmethod
|
87
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
88
|
+
"""Create an instance of DataTypeGroup from a dict"""
|
89
|
+
if obj is None:
|
90
|
+
return None
|
91
|
+
|
92
|
+
if not isinstance(obj, dict):
|
93
|
+
return cls.model_validate(obj)
|
94
|
+
|
95
|
+
_obj = cls.model_validate({
|
96
|
+
"id": obj.get("id"),
|
97
|
+
"name": obj.get("name"),
|
98
|
+
"parent": obj.get("parent"),
|
99
|
+
"values": dict(
|
100
|
+
(_k, Value.from_dict(_v))
|
101
|
+
for _k, _v in obj["values"].items()
|
102
|
+
)
|
103
|
+
if obj.get("values") is not None
|
104
|
+
else None
|
105
|
+
})
|
106
|
+
return _obj
|
107
|
+
|
108
|
+
|
@@ -0,0 +1,109 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
STEP REST API V2
|
5
|
+
|
6
|
+
<h1>About</h1><p>The STEP REST API V2 provides read and write access to a set of core STEP objects using the HTTP operations GET, PUT, POST, PATCH and DELETE.</p><h1>Resource Representation</h1><p>With the exception of a few resource operations for retrieving and uploading binary data, all request and response bodies are JSON, compliant with the schema documented here.</p><h1>Context and Workspace</h1><p>All requests are handled in a specific STEP context and workspace and both can be specified via query parameters available for all resource operations. A context must always be specified while requests per default will be handled in the "Main" workspace.</p><h1>Polymorphism</h1><p>In STEP, attributes, reference types and data container types can all be either single- or multivalued. The STEP REST API V2 uses polymorphism to address this complexity with resources that include values, references and data containers specified to produce and consume a common "abstract" supertype that always will be one of either the single- or multivalued subtype.<br/>As an example, the GET /entities/{id}/values/{attributeId} resource operation is specified to return a "Value" but as evident from the model, the "Value" will always be "oneOf" either "SingleValue", that has a "value" property for which the value is an object, or "MultiValue", that has a "values" property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property ("values", "references" and "dataContainers") to determine the concrete type.</p><h1>Authentication</h1><p>The REST API is protected by HTTP Basic Authentication or if OAuth2-based authentication is enabled (SaaS customers only), by Bearer Authentication. With Basic Authentication, user name and password are supplied with each request and it is therefore highly recommended to only use the API in conjunction with HTTPS. For more information about OAuth2-based authentication for SaaS customers, please see the STEP Authentication Guide.</p><h1>Versioning</h1><p>The STEP REST API V2 is versioned using semantic versioning. Stibo Systems reserve the right to make non-breaking, minor / patch changes in any release without warning and clients must be coded / configured to be 'tolerant' and capable of handling such changes.</p><p>Examples of breaking, major changes:</p><ul><li>Renaming of a property</li><li>Removal of a property</li><li>Property type change</li><li>Addition of new property required for write operations</li><li>Marking existing property as required for write operations</li><li>Removal of resource or resource operation</li><li>Materially different behavior for existing resource operation</li></ul><p>Examples of non-breaking, minor / patch changes:</p><ul><li>Addition of new properties in request responses</li><li>Addition of new query parameter not required for write operations</li><li>Addition of new resource or resource operation</li><li>Bug fixes that do not change the schema or resource operations as described here</li><li>Inclusion of a response body for resource operations specified to return a 200 response with no body</li><li>Change of response "Model" / "schema" to type extending the previously specified type</li><li>Renaming a "Model" / "schema" type</li></ul><p>In addition, error message texts may change without warning within the same version. Client program logic should not depend upon the message content.</p><h1>Error Handling</h1><p>The STEP REST API V2 responds with standard HTTP status codes, with 2** responses indicating a success, 4** responses indicating a client error and 5** indicating a server error. Notice that this specification does not specify common error responses like 500 (internal server error) or 401 (unauthorized) for the individual resource operations. Clients should however be capable of handling such responses.</p><p>Error responses have a JSON response body (see Error schema below) containing HTTP status code information in addition to a message providing details about the error. As mentioned above, client program logic should not depend upon the message content.</p><p>The specific status codes used in the API are:</p><ul><li>200 (OK): Success, response may or may not have a body</li><li>201 (Created): Entity successfully created, response may or may not have a body</li><li>400 (Bad request): The server cannot or will not process the request due to an apparent client error</li><li>401 (Unauthorized): Returned only in relation to failed authentication</li><li>404 (Not Found): Returned only in relation to objects specified via path parameters (variable parts of the URL). If STEP objects referenced in request bodies or via query parameters cannot be found, the response will be 400.</li><li>429 (Too Many Requests): Clients are per default limited to 100 requests per second. Returned if the rate limit is exceeded.</li><li>500 (Internal Server Error): Unexpected error (could potentially cover an issue that rightfully should be a 400)</li></ul>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class EndpointStatistics(BaseModel):
|
26
|
+
"""
|
27
|
+
Statistics for inbound/outbound integration endpoint
|
28
|
+
""" # noqa: E501
|
29
|
+
enabled_on: Optional[StrictStr] = Field(default=None, description="Time that the endpoint was enabled in yyyy-mm-ddThh:mm:ss±hh:mm format. Will be null for disabled endpoints.", alias="enabledOn")
|
30
|
+
last_run: Optional[StrictStr] = Field(default=None, description="Time for last run (invocation) in yyyy-mm-ddThh:mm:ss±hh:mm format. Will be null if the endpoint has never run.", alias="lastRun")
|
31
|
+
next_run: Optional[StrictStr] = Field(default=None, description="Time for next run (invocation) in yyyy-mm-ddThh:mm:ss±hh:mm format. Will be null if no next run is scheduled.", alias="nextRun")
|
32
|
+
number_of_created_worker_processes: Optional[StrictInt] = Field(default=None, description="The number of worker processes that have been created for this endpoint", alias="numberOfCreatedWorkerProcesses")
|
33
|
+
avg_worker_process_processing_time_in_seconds: Optional[StrictInt] = Field(default=None, description="Average worker process processing time in seconds. Will be null if no processes have run or if the information is not available.", alias="avgWorkerProcessProcessingTimeInSeconds")
|
34
|
+
max_worker_process_processing_time_in_seconds: Optional[StrictInt] = Field(default=None, description="Maximum worker process processing time in seconds. Will be null if no processes have run or if the information is not available.", alias="maxWorkerProcessProcessingTimeInSeconds")
|
35
|
+
__properties: ClassVar[List[str]] = ["enabledOn", "lastRun", "nextRun", "numberOfCreatedWorkerProcesses", "avgWorkerProcessProcessingTimeInSeconds", "maxWorkerProcessProcessingTimeInSeconds"]
|
36
|
+
|
37
|
+
model_config = ConfigDict(
|
38
|
+
populate_by_name=True,
|
39
|
+
validate_assignment=True,
|
40
|
+
protected_namespaces=(),
|
41
|
+
)
|
42
|
+
|
43
|
+
|
44
|
+
def to_str(self) -> str:
|
45
|
+
"""Returns the string representation of the model using alias"""
|
46
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
47
|
+
|
48
|
+
def to_json(self) -> str:
|
49
|
+
"""Returns the JSON representation of the model using alias"""
|
50
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
51
|
+
return json.dumps(self.to_dict())
|
52
|
+
|
53
|
+
@classmethod
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
55
|
+
"""Create an instance of EndpointStatistics from a JSON string"""
|
56
|
+
return cls.from_dict(json.loads(json_str))
|
57
|
+
|
58
|
+
def to_dict(self) -> Dict[str, Any]:
|
59
|
+
"""Return the dictionary representation of the model using alias.
|
60
|
+
|
61
|
+
This has the following differences from calling pydantic's
|
62
|
+
`self.model_dump(by_alias=True)`:
|
63
|
+
|
64
|
+
* `None` is only added to the output dict for nullable fields that
|
65
|
+
were set at model initialization. Other fields with value `None`
|
66
|
+
are ignored.
|
67
|
+
* OpenAPI `readOnly` fields are excluded.
|
68
|
+
* OpenAPI `readOnly` fields are excluded.
|
69
|
+
* OpenAPI `readOnly` fields are excluded.
|
70
|
+
* OpenAPI `readOnly` fields are excluded.
|
71
|
+
* OpenAPI `readOnly` fields are excluded.
|
72
|
+
* OpenAPI `readOnly` fields are excluded.
|
73
|
+
"""
|
74
|
+
excluded_fields: Set[str] = set([
|
75
|
+
"enabled_on",
|
76
|
+
"last_run",
|
77
|
+
"next_run",
|
78
|
+
"number_of_created_worker_processes",
|
79
|
+
"avg_worker_process_processing_time_in_seconds",
|
80
|
+
"max_worker_process_processing_time_in_seconds",
|
81
|
+
])
|
82
|
+
|
83
|
+
_dict = self.model_dump(
|
84
|
+
by_alias=True,
|
85
|
+
exclude=excluded_fields,
|
86
|
+
exclude_none=True,
|
87
|
+
)
|
88
|
+
return _dict
|
89
|
+
|
90
|
+
@classmethod
|
91
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
92
|
+
"""Create an instance of EndpointStatistics from a dict"""
|
93
|
+
if obj is None:
|
94
|
+
return None
|
95
|
+
|
96
|
+
if not isinstance(obj, dict):
|
97
|
+
return cls.model_validate(obj)
|
98
|
+
|
99
|
+
_obj = cls.model_validate({
|
100
|
+
"enabledOn": obj.get("enabledOn"),
|
101
|
+
"lastRun": obj.get("lastRun"),
|
102
|
+
"nextRun": obj.get("nextRun"),
|
103
|
+
"numberOfCreatedWorkerProcesses": obj.get("numberOfCreatedWorkerProcesses"),
|
104
|
+
"avgWorkerProcessProcessingTimeInSeconds": obj.get("avgWorkerProcessProcessingTimeInSeconds"),
|
105
|
+
"maxWorkerProcessProcessingTimeInSeconds": obj.get("maxWorkerProcessProcessingTimeInSeconds")
|
106
|
+
})
|
107
|
+
return _obj
|
108
|
+
|
109
|
+
|
@@ -0,0 +1,99 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
|
3
|
+
"""
|
4
|
+
STEP REST API V2
|
5
|
+
|
6
|
+
<h1>About</h1><p>The STEP REST API V2 provides read and write access to a set of core STEP objects using the HTTP operations GET, PUT, POST, PATCH and DELETE.</p><h1>Resource Representation</h1><p>With the exception of a few resource operations for retrieving and uploading binary data, all request and response bodies are JSON, compliant with the schema documented here.</p><h1>Context and Workspace</h1><p>All requests are handled in a specific STEP context and workspace and both can be specified via query parameters available for all resource operations. A context must always be specified while requests per default will be handled in the "Main" workspace.</p><h1>Polymorphism</h1><p>In STEP, attributes, reference types and data container types can all be either single- or multivalued. The STEP REST API V2 uses polymorphism to address this complexity with resources that include values, references and data containers specified to produce and consume a common "abstract" supertype that always will be one of either the single- or multivalued subtype.<br/>As an example, the GET /entities/{id}/values/{attributeId} resource operation is specified to return a "Value" but as evident from the model, the "Value" will always be "oneOf" either "SingleValue", that has a "value" property for which the value is an object, or "MultiValue", that has a "values" property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property ("values", "references" and "dataContainers") to determine the concrete type.</p><h1>Authentication</h1><p>The REST API is protected by HTTP Basic Authentication or if OAuth2-based authentication is enabled (SaaS customers only), by Bearer Authentication. With Basic Authentication, user name and password are supplied with each request and it is therefore highly recommended to only use the API in conjunction with HTTPS. For more information about OAuth2-based authentication for SaaS customers, please see the STEP Authentication Guide.</p><h1>Versioning</h1><p>The STEP REST API V2 is versioned using semantic versioning. Stibo Systems reserve the right to make non-breaking, minor / patch changes in any release without warning and clients must be coded / configured to be 'tolerant' and capable of handling such changes.</p><p>Examples of breaking, major changes:</p><ul><li>Renaming of a property</li><li>Removal of a property</li><li>Property type change</li><li>Addition of new property required for write operations</li><li>Marking existing property as required for write operations</li><li>Removal of resource or resource operation</li><li>Materially different behavior for existing resource operation</li></ul><p>Examples of non-breaking, minor / patch changes:</p><ul><li>Addition of new properties in request responses</li><li>Addition of new query parameter not required for write operations</li><li>Addition of new resource or resource operation</li><li>Bug fixes that do not change the schema or resource operations as described here</li><li>Inclusion of a response body for resource operations specified to return a 200 response with no body</li><li>Change of response "Model" / "schema" to type extending the previously specified type</li><li>Renaming a "Model" / "schema" type</li></ul><p>In addition, error message texts may change without warning within the same version. Client program logic should not depend upon the message content.</p><h1>Error Handling</h1><p>The STEP REST API V2 responds with standard HTTP status codes, with 2** responses indicating a success, 4** responses indicating a client error and 5** indicating a server error. Notice that this specification does not specify common error responses like 500 (internal server error) or 401 (unauthorized) for the individual resource operations. Clients should however be capable of handling such responses.</p><p>Error responses have a JSON response body (see Error schema below) containing HTTP status code information in addition to a message providing details about the error. As mentioned above, client program logic should not depend upon the message content.</p><p>The specific status codes used in the API are:</p><ul><li>200 (OK): Success, response may or may not have a body</li><li>201 (Created): Entity successfully created, response may or may not have a body</li><li>400 (Bad request): The server cannot or will not process the request due to an apparent client error</li><li>401 (Unauthorized): Returned only in relation to failed authentication</li><li>404 (Not Found): Returned only in relation to objects specified via path parameters (variable parts of the URL). If STEP objects referenced in request bodies or via query parameters cannot be found, the response will be 400.</li><li>429 (Too Many Requests): Clients are per default limited to 100 requests per second. Returned if the rate limit is exceeded.</li><li>500 (Internal Server Error): Unexpected error (could potentially cover an issue that rightfully should be a 400)</li></ul>
|
7
|
+
|
8
|
+
The version of the OpenAPI document: 1.3.0
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
10
|
+
|
11
|
+
Do not edit the class manually.
|
12
|
+
""" # noqa: E501
|
13
|
+
|
14
|
+
|
15
|
+
from __future__ import annotations
|
16
|
+
import pprint
|
17
|
+
import re # noqa: F401
|
18
|
+
import json
|
19
|
+
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
22
|
+
from typing import Optional, Set
|
23
|
+
from typing_extensions import Self
|
24
|
+
|
25
|
+
class EndpointStatus(BaseModel):
|
26
|
+
"""
|
27
|
+
Status for inbound/outbound integration endpoint
|
28
|
+
""" # noqa: E501
|
29
|
+
status: Optional[StrictStr] = Field(default=None, description="Status for endpoint")
|
30
|
+
__properties: ClassVar[List[str]] = ["status"]
|
31
|
+
|
32
|
+
@field_validator('status')
|
33
|
+
def status_validate_enum(cls, value):
|
34
|
+
"""Validates the enum"""
|
35
|
+
if value is None:
|
36
|
+
return value
|
37
|
+
|
38
|
+
if value not in set(['enabled', 'disabled', 'failed']):
|
39
|
+
raise ValueError("must be one of enum values ('enabled', 'disabled', 'failed')")
|
40
|
+
return value
|
41
|
+
|
42
|
+
model_config = ConfigDict(
|
43
|
+
populate_by_name=True,
|
44
|
+
validate_assignment=True,
|
45
|
+
protected_namespaces=(),
|
46
|
+
)
|
47
|
+
|
48
|
+
|
49
|
+
def to_str(self) -> str:
|
50
|
+
"""Returns the string representation of the model using alias"""
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
52
|
+
|
53
|
+
def to_json(self) -> str:
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
56
|
+
return json.dumps(self.to_dict())
|
57
|
+
|
58
|
+
@classmethod
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
60
|
+
"""Create an instance of EndpointStatus from a JSON string"""
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
62
|
+
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
65
|
+
|
66
|
+
This has the following differences from calling pydantic's
|
67
|
+
`self.model_dump(by_alias=True)`:
|
68
|
+
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
70
|
+
were set at model initialization. Other fields with value `None`
|
71
|
+
are ignored.
|
72
|
+
* OpenAPI `readOnly` fields are excluded.
|
73
|
+
"""
|
74
|
+
excluded_fields: Set[str] = set([
|
75
|
+
"status",
|
76
|
+
])
|
77
|
+
|
78
|
+
_dict = self.model_dump(
|
79
|
+
by_alias=True,
|
80
|
+
exclude=excluded_fields,
|
81
|
+
exclude_none=True,
|
82
|
+
)
|
83
|
+
return _dict
|
84
|
+
|
85
|
+
@classmethod
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
87
|
+
"""Create an instance of EndpointStatus from a dict"""
|
88
|
+
if obj is None:
|
89
|
+
return None
|
90
|
+
|
91
|
+
if not isinstance(obj, dict):
|
92
|
+
return cls.model_validate(obj)
|
93
|
+
|
94
|
+
_obj = cls.model_validate({
|
95
|
+
"status": obj.get("status")
|
96
|
+
})
|
97
|
+
return _obj
|
98
|
+
|
99
|
+
|