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.
Files changed (117) hide show
  1. step_rest_client/__init__.py +136 -0
  2. step_rest_client/api/__init__.py +26 -0
  3. step_rest_client/api/assets_api.py +7960 -0
  4. step_rest_client/api/attributes_api.py +340 -0
  5. step_rest_client/api/background_process_types_api.py +640 -0
  6. step_rest_client/api/background_processes_api.py +1577 -0
  7. step_rest_client/api/classifications_api.py +7991 -0
  8. step_rest_client/api/data_container_types_api.py +340 -0
  9. step_rest_client/api/data_type_groups_api.py +340 -0
  10. step_rest_client/api/entities_api.py +8680 -0
  11. step_rest_client/api/event_processors_api.py +3337 -0
  12. step_rest_client/api/export_api.py +383 -0
  13. step_rest_client/api/gateway_integration_endpoints_api.py +1232 -0
  14. step_rest_client/api/import_api.py +390 -0
  15. step_rest_client/api/inbound_integration_endpoints_api.py +2815 -0
  16. step_rest_client/api/lists_of_values_api.py +642 -0
  17. step_rest_client/api/object_types_api.py +340 -0
  18. step_rest_client/api/outbound_integration_endpoints_api.py +3655 -0
  19. step_rest_client/api/products_api.py +8007 -0
  20. step_rest_client/api/reference_types_api.py +340 -0
  21. step_rest_client/api/reporting_api.py +707 -0
  22. step_rest_client/api/units_api.py +340 -0
  23. step_rest_client/api/workflow_tasks_api.py +1887 -0
  24. step_rest_client/api/workflows_api.py +1270 -0
  25. step_rest_client/api_client.py +797 -0
  26. step_rest_client/api_response.py +21 -0
  27. step_rest_client/configuration.py +597 -0
  28. step_rest_client/exceptions.py +216 -0
  29. step_rest_client/models/__init__.py +98 -0
  30. step_rest_client/models/amount.py +89 -0
  31. step_rest_client/models/and_condition.py +107 -0
  32. step_rest_client/models/approval_response.py +87 -0
  33. step_rest_client/models/approval_status.py +99 -0
  34. step_rest_client/models/asset.py +129 -0
  35. step_rest_client/models/attribute.py +120 -0
  36. step_rest_client/models/attribute_link.py +102 -0
  37. step_rest_client/models/background_process.py +139 -0
  38. step_rest_client/models/background_process_attachment_metadata.py +105 -0
  39. step_rest_client/models/background_process_identification.py +89 -0
  40. step_rest_client/models/background_process_type.py +89 -0
  41. step_rest_client/models/classification.py +135 -0
  42. step_rest_client/models/condition.py +265 -0
  43. step_rest_client/models/data_container.py +139 -0
  44. step_rest_client/models/data_container_entry.py +117 -0
  45. step_rest_client/models/data_container_object_condition.py +181 -0
  46. step_rest_client/models/data_container_type.py +106 -0
  47. step_rest_client/models/data_type_group.py +108 -0
  48. step_rest_client/models/endpoint_statistics.py +109 -0
  49. step_rest_client/models/endpoint_status.py +99 -0
  50. step_rest_client/models/entity.py +142 -0
  51. step_rest_client/models/error.py +91 -0
  52. step_rest_client/models/event_processor.py +93 -0
  53. step_rest_client/models/event_processor_statistics.py +97 -0
  54. step_rest_client/models/event_processor_status.py +99 -0
  55. step_rest_client/models/event_queue_status.py +89 -0
  56. step_rest_client/models/execution_report_entry.py +103 -0
  57. step_rest_client/models/export_specification.py +89 -0
  58. step_rest_client/models/find_similar_business_rule_result.py +91 -0
  59. step_rest_client/models/find_similar_entities_request.py +95 -0
  60. step_rest_client/models/find_similar_entities_response.py +103 -0
  61. step_rest_client/models/find_similar_entities_response_record.py +95 -0
  62. step_rest_client/models/find_similar_execution_report.py +103 -0
  63. step_rest_client/models/gateway_integration_endpoint.py +93 -0
  64. step_rest_client/models/has_data_container_object_condition.py +106 -0
  65. step_rest_client/models/has_reference_to_condition.py +108 -0
  66. step_rest_client/models/id_condition.py +105 -0
  67. step_rest_client/models/inbound_integration_endpoint.py +93 -0
  68. step_rest_client/models/incoming_reference_entry.py +118 -0
  69. step_rest_client/models/list_of_values.py +110 -0
  70. step_rest_client/models/list_of_values_entry.py +91 -0
  71. step_rest_client/models/lov_value_condition.py +100 -0
  72. step_rest_client/models/match_and_merge_execution_report.py +119 -0
  73. step_rest_client/models/match_and_merge_general_execution_report.py +91 -0
  74. step_rest_client/models/match_and_merge_potential_duplicate.py +93 -0
  75. step_rest_client/models/match_and_merge_record_in.py +95 -0
  76. step_rest_client/models/match_and_merge_record_out.py +117 -0
  77. step_rest_client/models/match_and_merge_response.py +103 -0
  78. step_rest_client/models/multi_data_container.py +101 -0
  79. step_rest_client/models/multi_reference.py +97 -0
  80. step_rest_client/models/multi_value.py +103 -0
  81. step_rest_client/models/name_condition.py +107 -0
  82. step_rest_client/models/numeric_value_condition.py +111 -0
  83. step_rest_client/models/object_type.py +104 -0
  84. step_rest_client/models/object_type_condition.py +96 -0
  85. step_rest_client/models/or_condition.py +107 -0
  86. step_rest_client/models/outbound_integration_endpoint.py +93 -0
  87. step_rest_client/models/product.py +150 -0
  88. step_rest_client/models/query.py +91 -0
  89. step_rest_client/models/query_result.py +99 -0
  90. step_rest_client/models/reference.py +139 -0
  91. step_rest_client/models/reference_entry.py +141 -0
  92. step_rest_client/models/reference_metadata_condition.py +181 -0
  93. step_rest_client/models/reference_type.py +114 -0
  94. step_rest_client/models/rejected_by_business_condition.py +93 -0
  95. step_rest_client/models/simple_below_condition.py +105 -0
  96. step_rest_client/models/single_data_container.py +97 -0
  97. step_rest_client/models/single_reference.py +93 -0
  98. step_rest_client/models/single_value.py +103 -0
  99. step_rest_client/models/status_flag.py +89 -0
  100. step_rest_client/models/text_value_condition.py +111 -0
  101. step_rest_client/models/trigger_workflow_event.py +93 -0
  102. step_rest_client/models/unit.py +104 -0
  103. step_rest_client/models/value.py +137 -0
  104. step_rest_client/models/value_entry.py +91 -0
  105. step_rest_client/models/workflow.py +91 -0
  106. step_rest_client/models/workflow_event.py +89 -0
  107. step_rest_client/models/workflow_instance.py +87 -0
  108. step_rest_client/models/workflow_instance_creation.py +93 -0
  109. step_rest_client/models/workflow_node.py +99 -0
  110. step_rest_client/models/workflow_task.py +113 -0
  111. step_rest_client/models/workflow_task_query.py +101 -0
  112. step_rest_client/py.typed +0 -0
  113. step_rest_client/rest.py +258 -0
  114. step_rest_client-1.0.0.dist-info/METADATA +23 -0
  115. step_rest_client-1.0.0.dist-info/RECORD +117 -0
  116. step_rest_client-1.0.0.dist-info/WHEEL +5 -0
  117. step_rest_client-1.0.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,216 @@
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 &quot;Main&quot; 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 &quot;abstract&quot; 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 &quot;Value&quot; but as evident from the model, the &quot;Value&quot; will always be &quot;oneOf&quot; either &quot;SingleValue&quot;, that has a &quot;value&quot; property for which the value is an object, or &quot;MultiValue&quot;, that has a &quot;values&quot; property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property (&quot;values&quot;, &quot;references&quot; and &quot;dataContainers&quot;) 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 &quot;Model&quot; / &quot;schema&quot; to type extending the previously specified type</li><li>Renaming a &quot;Model&quot; / &quot;schema&quot; 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
+ from typing import Any, Optional
15
+ from typing_extensions import Self
16
+
17
+ class OpenApiException(Exception):
18
+ """The base exception class for all OpenAPIExceptions"""
19
+
20
+
21
+ class ApiTypeError(OpenApiException, TypeError):
22
+ def __init__(self, msg, path_to_item=None, valid_classes=None,
23
+ key_type=None) -> None:
24
+ """ Raises an exception for TypeErrors
25
+
26
+ Args:
27
+ msg (str): the exception message
28
+
29
+ Keyword Args:
30
+ path_to_item (list): a list of keys an indices to get to the
31
+ current_item
32
+ None if unset
33
+ valid_classes (tuple): the primitive classes that current item
34
+ should be an instance of
35
+ None if unset
36
+ key_type (bool): False if our value is a value in a dict
37
+ True if it is a key in a dict
38
+ False if our item is an item in a list
39
+ None if unset
40
+ """
41
+ self.path_to_item = path_to_item
42
+ self.valid_classes = valid_classes
43
+ self.key_type = key_type
44
+ full_msg = msg
45
+ if path_to_item:
46
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
47
+ super(ApiTypeError, self).__init__(full_msg)
48
+
49
+
50
+ class ApiValueError(OpenApiException, ValueError):
51
+ def __init__(self, msg, path_to_item=None) -> None:
52
+ """
53
+ Args:
54
+ msg (str): the exception message
55
+
56
+ Keyword Args:
57
+ path_to_item (list) the path to the exception in the
58
+ received_data dict. None if unset
59
+ """
60
+
61
+ self.path_to_item = path_to_item
62
+ full_msg = msg
63
+ if path_to_item:
64
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
65
+ super(ApiValueError, self).__init__(full_msg)
66
+
67
+
68
+ class ApiAttributeError(OpenApiException, AttributeError):
69
+ def __init__(self, msg, path_to_item=None) -> None:
70
+ """
71
+ Raised when an attribute reference or assignment fails.
72
+
73
+ Args:
74
+ msg (str): the exception message
75
+
76
+ Keyword Args:
77
+ path_to_item (None/list) the path to the exception in the
78
+ received_data dict
79
+ """
80
+ self.path_to_item = path_to_item
81
+ full_msg = msg
82
+ if path_to_item:
83
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
84
+ super(ApiAttributeError, self).__init__(full_msg)
85
+
86
+
87
+ class ApiKeyError(OpenApiException, KeyError):
88
+ def __init__(self, msg, path_to_item=None) -> None:
89
+ """
90
+ Args:
91
+ msg (str): the exception message
92
+
93
+ Keyword Args:
94
+ path_to_item (None/list) the path to the exception in the
95
+ received_data dict
96
+ """
97
+ self.path_to_item = path_to_item
98
+ full_msg = msg
99
+ if path_to_item:
100
+ full_msg = "{0} at {1}".format(msg, render_path(path_to_item))
101
+ super(ApiKeyError, self).__init__(full_msg)
102
+
103
+
104
+ class ApiException(OpenApiException):
105
+
106
+ def __init__(
107
+ self,
108
+ status=None,
109
+ reason=None,
110
+ http_resp=None,
111
+ *,
112
+ body: Optional[str] = None,
113
+ data: Optional[Any] = None,
114
+ ) -> None:
115
+ self.status = status
116
+ self.reason = reason
117
+ self.body = body
118
+ self.data = data
119
+ self.headers = None
120
+
121
+ if http_resp:
122
+ if self.status is None:
123
+ self.status = http_resp.status
124
+ if self.reason is None:
125
+ self.reason = http_resp.reason
126
+ if self.body is None:
127
+ try:
128
+ self.body = http_resp.data.decode('utf-8')
129
+ except Exception:
130
+ pass
131
+ self.headers = http_resp.getheaders()
132
+
133
+ @classmethod
134
+ def from_response(
135
+ cls,
136
+ *,
137
+ http_resp,
138
+ body: Optional[str],
139
+ data: Optional[Any],
140
+ ) -> Self:
141
+ if http_resp.status == 400:
142
+ raise BadRequestException(http_resp=http_resp, body=body, data=data)
143
+
144
+ if http_resp.status == 401:
145
+ raise UnauthorizedException(http_resp=http_resp, body=body, data=data)
146
+
147
+ if http_resp.status == 403:
148
+ raise ForbiddenException(http_resp=http_resp, body=body, data=data)
149
+
150
+ if http_resp.status == 404:
151
+ raise NotFoundException(http_resp=http_resp, body=body, data=data)
152
+
153
+ # Added new conditions for 409 and 422
154
+ if http_resp.status == 409:
155
+ raise ConflictException(http_resp=http_resp, body=body, data=data)
156
+
157
+ if http_resp.status == 422:
158
+ raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data)
159
+
160
+ if 500 <= http_resp.status <= 599:
161
+ raise ServiceException(http_resp=http_resp, body=body, data=data)
162
+ raise ApiException(http_resp=http_resp, body=body, data=data)
163
+
164
+ def __str__(self):
165
+ """Custom error messages for exception"""
166
+ error_message = "({0})\n"\
167
+ "Reason: {1}\n".format(self.status, self.reason)
168
+ if self.headers:
169
+ error_message += "HTTP response headers: {0}\n".format(
170
+ self.headers)
171
+
172
+ if self.data or self.body:
173
+ error_message += "HTTP response body: {0}\n".format(self.data or self.body)
174
+
175
+ return error_message
176
+
177
+
178
+ class BadRequestException(ApiException):
179
+ pass
180
+
181
+
182
+ class NotFoundException(ApiException):
183
+ pass
184
+
185
+
186
+ class UnauthorizedException(ApiException):
187
+ pass
188
+
189
+
190
+ class ForbiddenException(ApiException):
191
+ pass
192
+
193
+
194
+ class ServiceException(ApiException):
195
+ pass
196
+
197
+
198
+ class ConflictException(ApiException):
199
+ """Exception for HTTP 409 Conflict."""
200
+ pass
201
+
202
+
203
+ class UnprocessableEntityException(ApiException):
204
+ """Exception for HTTP 422 Unprocessable Entity."""
205
+ pass
206
+
207
+
208
+ def render_path(path_to_item):
209
+ """Returns a string representation of a path"""
210
+ result = ""
211
+ for pth in path_to_item:
212
+ if isinstance(pth, int):
213
+ result += "[{0}]".format(pth)
214
+ else:
215
+ result += "['{0}']".format(pth)
216
+ return result
@@ -0,0 +1,98 @@
1
+ # coding: utf-8
2
+
3
+ # flake8: noqa
4
+ """
5
+ STEP REST API V2
6
+
7
+ <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 &quot;Main&quot; 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 &quot;abstract&quot; 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 &quot;Value&quot; but as evident from the model, the &quot;Value&quot; will always be &quot;oneOf&quot; either &quot;SingleValue&quot;, that has a &quot;value&quot; property for which the value is an object, or &quot;MultiValue&quot;, that has a &quot;values&quot; property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property (&quot;values&quot;, &quot;references&quot; and &quot;dataContainers&quot;) 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 &quot;Model&quot; / &quot;schema&quot; to type extending the previously specified type</li><li>Renaming a &quot;Model&quot; / &quot;schema&quot; 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>
8
+
9
+ The version of the OpenAPI document: 1.3.0
10
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
11
+
12
+ Do not edit the class manually.
13
+ """ # noqa: E501
14
+
15
+
16
+ # import models into model package
17
+ from step_rest_client.models.amount import Amount
18
+ from step_rest_client.models.and_condition import AndCondition
19
+ from step_rest_client.models.approval_response import ApprovalResponse
20
+ from step_rest_client.models.approval_status import ApprovalStatus
21
+ from step_rest_client.models.asset import Asset
22
+ from step_rest_client.models.attribute import Attribute
23
+ from step_rest_client.models.attribute_link import AttributeLink
24
+ from step_rest_client.models.background_process import BackgroundProcess
25
+ from step_rest_client.models.background_process_attachment_metadata import BackgroundProcessAttachmentMetadata
26
+ from step_rest_client.models.background_process_identification import BackgroundProcessIdentification
27
+ from step_rest_client.models.background_process_type import BackgroundProcessType
28
+ from step_rest_client.models.classification import Classification
29
+ from step_rest_client.models.condition import Condition
30
+ from step_rest_client.models.data_container import DataContainer
31
+ from step_rest_client.models.data_container_entry import DataContainerEntry
32
+ from step_rest_client.models.data_container_object_condition import DataContainerObjectCondition
33
+ from step_rest_client.models.data_container_type import DataContainerType
34
+ from step_rest_client.models.data_type_group import DataTypeGroup
35
+ from step_rest_client.models.endpoint_statistics import EndpointStatistics
36
+ from step_rest_client.models.endpoint_status import EndpointStatus
37
+ from step_rest_client.models.entity import Entity
38
+ from step_rest_client.models.error import Error
39
+ from step_rest_client.models.event_processor import EventProcessor
40
+ from step_rest_client.models.event_processor_statistics import EventProcessorStatistics
41
+ from step_rest_client.models.event_processor_status import EventProcessorStatus
42
+ from step_rest_client.models.event_queue_status import EventQueueStatus
43
+ from step_rest_client.models.execution_report_entry import ExecutionReportEntry
44
+ from step_rest_client.models.export_specification import ExportSpecification
45
+ from step_rest_client.models.find_similar_business_rule_result import FindSimilarBusinessRuleResult
46
+ from step_rest_client.models.find_similar_entities_request import FindSimilarEntitiesRequest
47
+ from step_rest_client.models.find_similar_entities_response import FindSimilarEntitiesResponse
48
+ from step_rest_client.models.find_similar_entities_response_record import FindSimilarEntitiesResponseRecord
49
+ from step_rest_client.models.find_similar_execution_report import FindSimilarExecutionReport
50
+ from step_rest_client.models.gateway_integration_endpoint import GatewayIntegrationEndpoint
51
+ from step_rest_client.models.has_data_container_object_condition import HasDataContainerObjectCondition
52
+ from step_rest_client.models.has_reference_to_condition import HasReferenceToCondition
53
+ from step_rest_client.models.id_condition import IdCondition
54
+ from step_rest_client.models.inbound_integration_endpoint import InboundIntegrationEndpoint
55
+ from step_rest_client.models.incoming_reference_entry import IncomingReferenceEntry
56
+ from step_rest_client.models.list_of_values import ListOfValues
57
+ from step_rest_client.models.list_of_values_entry import ListOfValuesEntry
58
+ from step_rest_client.models.lov_value_condition import LovValueCondition
59
+ from step_rest_client.models.match_and_merge_execution_report import MatchAndMergeExecutionReport
60
+ from step_rest_client.models.match_and_merge_general_execution_report import MatchAndMergeGeneralExecutionReport
61
+ from step_rest_client.models.match_and_merge_potential_duplicate import MatchAndMergePotentialDuplicate
62
+ from step_rest_client.models.match_and_merge_record_in import MatchAndMergeRecordIn
63
+ from step_rest_client.models.match_and_merge_record_out import MatchAndMergeRecordOut
64
+ from step_rest_client.models.match_and_merge_response import MatchAndMergeResponse
65
+ from step_rest_client.models.multi_data_container import MultiDataContainer
66
+ from step_rest_client.models.multi_reference import MultiReference
67
+ from step_rest_client.models.multi_value import MultiValue
68
+ from step_rest_client.models.name_condition import NameCondition
69
+ from step_rest_client.models.numeric_value_condition import NumericValueCondition
70
+ from step_rest_client.models.object_type import ObjectType
71
+ from step_rest_client.models.object_type_condition import ObjectTypeCondition
72
+ from step_rest_client.models.or_condition import OrCondition
73
+ from step_rest_client.models.outbound_integration_endpoint import OutboundIntegrationEndpoint
74
+ from step_rest_client.models.product import Product
75
+ from step_rest_client.models.query import Query
76
+ from step_rest_client.models.query_result import QueryResult
77
+ from step_rest_client.models.reference import Reference
78
+ from step_rest_client.models.reference_entry import ReferenceEntry
79
+ from step_rest_client.models.reference_metadata_condition import ReferenceMetadataCondition
80
+ from step_rest_client.models.reference_type import ReferenceType
81
+ from step_rest_client.models.rejected_by_business_condition import RejectedByBusinessCondition
82
+ from step_rest_client.models.simple_below_condition import SimpleBelowCondition
83
+ from step_rest_client.models.single_data_container import SingleDataContainer
84
+ from step_rest_client.models.single_reference import SingleReference
85
+ from step_rest_client.models.single_value import SingleValue
86
+ from step_rest_client.models.status_flag import StatusFlag
87
+ from step_rest_client.models.text_value_condition import TextValueCondition
88
+ from step_rest_client.models.trigger_workflow_event import TriggerWorkflowEvent
89
+ from step_rest_client.models.unit import Unit
90
+ from step_rest_client.models.value import Value
91
+ from step_rest_client.models.value_entry import ValueEntry
92
+ from step_rest_client.models.workflow import Workflow
93
+ from step_rest_client.models.workflow_event import WorkflowEvent
94
+ from step_rest_client.models.workflow_instance import WorkflowInstance
95
+ from step_rest_client.models.workflow_instance_creation import WorkflowInstanceCreation
96
+ from step_rest_client.models.workflow_node import WorkflowNode
97
+ from step_rest_client.models.workflow_task import WorkflowTask
98
+ from step_rest_client.models.workflow_task_query import WorkflowTaskQuery
@@ -0,0 +1,89 @@
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 &quot;Main&quot; 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 &quot;abstract&quot; 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 &quot;Value&quot; but as evident from the model, the &quot;Value&quot; will always be &quot;oneOf&quot; either &quot;SingleValue&quot;, that has a &quot;value&quot; property for which the value is an object, or &quot;MultiValue&quot;, that has a &quot;values&quot; property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property (&quot;values&quot;, &quot;references&quot; and &quot;dataContainers&quot;) 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 &quot;Model&quot; / &quot;schema&quot; to type extending the previously specified type</li><li>Renaming a &quot;Model&quot; / &quot;schema&quot; 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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class Amount(BaseModel):
26
+ """
27
+ Simple amount representation
28
+ """ # noqa: E501
29
+ amount: Optional[StrictInt] = Field(default=None, description="The amount")
30
+ __properties: ClassVar[List[str]] = ["amount"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of Amount from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ * OpenAPI `readOnly` fields are excluded.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ "amount",
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ return _dict
74
+
75
+ @classmethod
76
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
77
+ """Create an instance of Amount from a dict"""
78
+ if obj is None:
79
+ return None
80
+
81
+ if not isinstance(obj, dict):
82
+ return cls.model_validate(obj)
83
+
84
+ _obj = cls.model_validate({
85
+ "amount": obj.get("amount")
86
+ })
87
+ return _obj
88
+
89
+
@@ -0,0 +1,107 @@
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 &quot;Main&quot; 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 &quot;abstract&quot; 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 &quot;Value&quot; but as evident from the model, the &quot;Value&quot; will always be &quot;oneOf&quot; either &quot;SingleValue&quot;, that has a &quot;value&quot; property for which the value is an object, or &quot;MultiValue&quot;, that has a &quot;values&quot; property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property (&quot;values&quot;, &quot;references&quot; and &quot;dataContainers&quot;) 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 &quot;Model&quot; / &quot;schema&quot; to type extending the previously specified type</li><li>Renaming a &quot;Model&quot; / &quot;schema&quot; 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
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class AndCondition(BaseModel):
27
+ """
28
+ Compound condition that lets you \"AND\" multiple other conditions
29
+ """ # noqa: E501
30
+ condition_type: StrictStr = Field(description="The condition type. Must have the value \"and\" for this type of condition.", alias="conditionType")
31
+ conditions: Annotated[List[Condition], Field(min_length=2, max_length=5)] = Field(description="The conditions to be AND'ed")
32
+ __properties: ClassVar[List[str]] = ["conditionType", "conditions"]
33
+
34
+ @field_validator('condition_type')
35
+ def condition_type_validate_enum(cls, value):
36
+ """Validates the enum"""
37
+ if value not in set(['and', 'or', 'id', 'name', 'textvalue', 'numericvalue', 'objecttype', 'simplebelow', 'lovvalue', 'hasreferenceto', 'hasdatacontainerobject']):
38
+ raise ValueError("must be one of enum values ('and', 'or', 'id', 'name', 'textvalue', 'numericvalue', 'objecttype', 'simplebelow', 'lovvalue', 'hasreferenceto', 'hasdatacontainerobject')")
39
+ return value
40
+
41
+ model_config = ConfigDict(
42
+ populate_by_name=True,
43
+ validate_assignment=True,
44
+ protected_namespaces=(),
45
+ )
46
+
47
+
48
+ def to_str(self) -> str:
49
+ """Returns the string representation of the model using alias"""
50
+ return pprint.pformat(self.model_dump(by_alias=True))
51
+
52
+ def to_json(self) -> str:
53
+ """Returns the JSON representation of the model using alias"""
54
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
55
+ return json.dumps(self.to_dict())
56
+
57
+ @classmethod
58
+ def from_json(cls, json_str: str) -> Optional[Self]:
59
+ """Create an instance of AndCondition from a JSON string"""
60
+ return cls.from_dict(json.loads(json_str))
61
+
62
+ def to_dict(self) -> Dict[str, Any]:
63
+ """Return the dictionary representation of the model using alias.
64
+
65
+ This has the following differences from calling pydantic's
66
+ `self.model_dump(by_alias=True)`:
67
+
68
+ * `None` is only added to the output dict for nullable fields that
69
+ were set at model initialization. Other fields with value `None`
70
+ are ignored.
71
+ """
72
+ excluded_fields: Set[str] = set([
73
+ ])
74
+
75
+ _dict = self.model_dump(
76
+ by_alias=True,
77
+ exclude=excluded_fields,
78
+ exclude_none=True,
79
+ )
80
+ # override the default output from pydantic by calling `to_dict()` of each item in conditions (list)
81
+ _items = []
82
+ if self.conditions:
83
+ for _item_conditions in self.conditions:
84
+ if _item_conditions:
85
+ _items.append(_item_conditions.to_dict())
86
+ _dict['conditions'] = _items
87
+ return _dict
88
+
89
+ @classmethod
90
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
91
+ """Create an instance of AndCondition from a dict"""
92
+ if obj is None:
93
+ return None
94
+
95
+ if not isinstance(obj, dict):
96
+ return cls.model_validate(obj)
97
+
98
+ _obj = cls.model_validate({
99
+ "conditionType": obj.get("conditionType"),
100
+ "conditions": [Condition.from_dict(_item) for _item in obj["conditions"]] if obj.get("conditions") is not None else None
101
+ })
102
+ return _obj
103
+
104
+ from step_rest_client.models.condition import Condition
105
+ # TODO: Rewrite to not use raise_errors
106
+ AndCondition.model_rebuild(raise_errors=False)
107
+
@@ -0,0 +1,87 @@
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 &quot;Main&quot; 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 &quot;abstract&quot; 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 &quot;Value&quot; but as evident from the model, the &quot;Value&quot; will always be &quot;oneOf&quot; either &quot;SingleValue&quot;, that has a &quot;value&quot; property for which the value is an object, or &quot;MultiValue&quot;, that has a &quot;values&quot; property for which the value is an array.<br/>Clients are advised to use the presence or absence of the plural array property (&quot;values&quot;, &quot;references&quot; and &quot;dataContainers&quot;) 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 &quot;Model&quot; / &quot;schema&quot; to type extending the previously specified type</li><li>Renaming a &quot;Model&quot; / &quot;schema&quot; 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 typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class ApprovalResponse(BaseModel):
26
+ """
27
+ Returned when a workspace revisable object is successfully approved. Holds zero or more messages for part objects that could not be synchronized to the Approved workspace.
28
+ """ # noqa: E501
29
+ messages: Optional[List[StrictStr]] = Field(default=None, description="Messages related to part objects that could not be synchronized to the Approved workspace")
30
+ __properties: ClassVar[List[str]] = ["messages"]
31
+
32
+ model_config = ConfigDict(
33
+ populate_by_name=True,
34
+ validate_assignment=True,
35
+ protected_namespaces=(),
36
+ )
37
+
38
+
39
+ def to_str(self) -> str:
40
+ """Returns the string representation of the model using alias"""
41
+ return pprint.pformat(self.model_dump(by_alias=True))
42
+
43
+ def to_json(self) -> str:
44
+ """Returns the JSON representation of the model using alias"""
45
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
46
+ return json.dumps(self.to_dict())
47
+
48
+ @classmethod
49
+ def from_json(cls, json_str: str) -> Optional[Self]:
50
+ """Create an instance of ApprovalResponse from a JSON string"""
51
+ return cls.from_dict(json.loads(json_str))
52
+
53
+ def to_dict(self) -> Dict[str, Any]:
54
+ """Return the dictionary representation of the model using alias.
55
+
56
+ This has the following differences from calling pydantic's
57
+ `self.model_dump(by_alias=True)`:
58
+
59
+ * `None` is only added to the output dict for nullable fields that
60
+ were set at model initialization. Other fields with value `None`
61
+ are ignored.
62
+ """
63
+ excluded_fields: Set[str] = set([
64
+ ])
65
+
66
+ _dict = self.model_dump(
67
+ by_alias=True,
68
+ exclude=excluded_fields,
69
+ exclude_none=True,
70
+ )
71
+ return _dict
72
+
73
+ @classmethod
74
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
75
+ """Create an instance of ApprovalResponse from a dict"""
76
+ if obj is None:
77
+ return None
78
+
79
+ if not isinstance(obj, dict):
80
+ return cls.model_validate(obj)
81
+
82
+ _obj = cls.model_validate({
83
+ "messages": obj.get("messages")
84
+ })
85
+ return _obj
86
+
87
+