wandelbots-isaacsim-api 2.2.2__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.
- wandelbots_isaacsim_api/__init__.py +50 -0
- wandelbots_isaacsim_api/api/__init__.py +25 -0
- wandelbots_isaacsim_api/api/collision_world_api.py +316 -0
- wandelbots_isaacsim_api/api/default_api.py +800 -0
- wandelbots_isaacsim_api/api/manipulators_motion_group_api.py +1619 -0
- wandelbots_isaacsim_api/api/periphery_camera_api.py +3434 -0
- wandelbots_isaacsim_api/api/prims_api.py +4963 -0
- wandelbots_isaacsim_api/api/stage_api.py +2351 -0
- wandelbots_isaacsim_api/api/teaching_api.py +1312 -0
- wandelbots_isaacsim_api/api/trajectory_api.py +1686 -0
- wandelbots_isaacsim_api/api/ui_api.py +562 -0
- wandelbots_isaacsim_api/api_client.py +800 -0
- wandelbots_isaacsim_api/api_response.py +21 -0
- wandelbots_isaacsim_api/collision/__init__.py +0 -0
- wandelbots_isaacsim_api/collision/utils.py +99 -0
- wandelbots_isaacsim_api/configuration.py +561 -0
- wandelbots_isaacsim_api/exceptions.py +216 -0
- wandelbots_isaacsim_api/models/__init__.py +135 -0
- wandelbots_isaacsim_api/models/auth0_credentials.py +100 -0
- wandelbots_isaacsim_api/models/body_apply_relative_pose.py +99 -0
- wandelbots_isaacsim_api/models/body_assign_default_poses.py +91 -0
- wandelbots_isaacsim_api/models/body_reset_to_default_poses.py +91 -0
- wandelbots_isaacsim_api/models/body_set_joint_state.py +93 -0
- wandelbots_isaacsim_api/models/body_set_prim_metadata.py +97 -0
- wandelbots_isaacsim_api/models/body_set_prim_visibility.py +103 -0
- wandelbots_isaacsim_api/models/body_set_semantic_label.py +93 -0
- wandelbots_isaacsim_api/models/body_update_colliders.py +93 -0
- wandelbots_isaacsim_api/models/body_update_pose.py +97 -0
- wandelbots_isaacsim_api/models/bounding_box2_d.py +98 -0
- wandelbots_isaacsim_api/models/bounding_box3_d.py +100 -0
- wandelbots_isaacsim_api/models/box.py +119 -0
- wandelbots_isaacsim_api/models/box_sweep_parameters.py +111 -0
- wandelbots_isaacsim_api/models/capsule.py +105 -0
- wandelbots_isaacsim_api/models/collider.py +101 -0
- wandelbots_isaacsim_api/models/convex_hull.py +103 -0
- wandelbots_isaacsim_api/models/create_ghost_object.py +102 -0
- wandelbots_isaacsim_api/models/custom_prim.py +100 -0
- wandelbots_isaacsim_api/models/custom_prim_data.py +93 -0
- wandelbots_isaacsim_api/models/cylinder.py +105 -0
- wandelbots_isaacsim_api/models/ghost_object.py +106 -0
- wandelbots_isaacsim_api/models/ghost_object_source.py +93 -0
- wandelbots_isaacsim_api/models/gizmo_prim.py +98 -0
- wandelbots_isaacsim_api/models/http_validation_error.py +108 -0
- wandelbots_isaacsim_api/models/instance_segmentation_data.py +97 -0
- wandelbots_isaacsim_api/models/instance_segmentation_info.py +91 -0
- wandelbots_isaacsim_api/models/motion_group_configuration.py +99 -0
- wandelbots_isaacsim_api/models/motion_stream_configuration.py +101 -0
- wandelbots_isaacsim_api/models/patch_trajectory_data.py +107 -0
- wandelbots_isaacsim_api/models/plane.py +101 -0
- wandelbots_isaacsim_api/models/point_cloud.py +95 -0
- wandelbots_isaacsim_api/models/pose.py +137 -0
- wandelbots_isaacsim_api/models/pose_position_inner.py +138 -0
- wandelbots_isaacsim_api/models/prim.py +165 -0
- wandelbots_isaacsim_api/models/prim_selection.py +91 -0
- wandelbots_isaacsim_api/models/quat_pose.py +92 -0
- wandelbots_isaacsim_api/models/relative_pose_mode.py +39 -0
- wandelbots_isaacsim_api/models/response_get_pose.py +134 -0
- wandelbots_isaacsim_api/models/response_get_relative_pose.py +134 -0
- wandelbots_isaacsim_api/models/response_list_default_poses_value.py +140 -0
- wandelbots_isaacsim_api/models/semantic_segmentation_data.py +97 -0
- wandelbots_isaacsim_api/models/semantic_segmentation_info.py +91 -0
- wandelbots_isaacsim_api/models/shape.py +194 -0
- wandelbots_isaacsim_api/models/simulation_state.py +101 -0
- wandelbots_isaacsim_api/models/sphere.py +103 -0
- wandelbots_isaacsim_api/models/sphere_sweep_parameters.py +107 -0
- wandelbots_isaacsim_api/models/stage_units.py +91 -0
- wandelbots_isaacsim_api/models/sweep_arguments.py +134 -0
- wandelbots_isaacsim_api/models/tcp_source.py +99 -0
- wandelbots_isaacsim_api/models/trajectory_data.py +101 -0
- wandelbots_isaacsim_api/models/trajectory_marker.py +97 -0
- wandelbots_isaacsim_api/models/trajectory_object.py +101 -0
- wandelbots_isaacsim_api/models/trajectory_options.py +94 -0
- wandelbots_isaacsim_api/models/usd_stage_model.py +91 -0
- wandelbots_isaacsim_api/models/validation_error.py +112 -0
- wandelbots_isaacsim_api/models/validation_error_loc_inner.py +138 -0
- wandelbots_isaacsim_api/models/ws_pose.py +92 -0
- wandelbots_isaacsim_api/py.typed +0 -0
- wandelbots_isaacsim_api/rest.py +212 -0
- wandelbots_isaacsim_api/trajectory/__init__.py +17 -0
- wandelbots_isaacsim_api/trajectory/trajectory_viewer.py +111 -0
- wandelbots_isaacsim_api/trajectory/utils.py +154 -0
- wandelbots_isaacsim_api-2.2.2.dist-info/LICENSE +201 -0
- wandelbots_isaacsim_api-2.2.2.dist-info/METADATA +60 -0
- wandelbots_isaacsim_api-2.2.2.dist-info/RECORD +85 -0
- wandelbots_isaacsim_api-2.2.2.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Wandelbots Omniservice
|
|
5
|
+
|
|
6
|
+
A microservice-based framework for managing Omniverse functionalities
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.2.2
|
|
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
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from wandelbots_isaacsim_api.models.quat_pose import QuatPose
|
|
23
|
+
from wandelbots_isaacsim_api.models.ws_pose import WSPose
|
|
24
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
25
|
+
from typing_extensions import Literal, Self
|
|
26
|
+
from pydantic import Field
|
|
27
|
+
|
|
28
|
+
RESPONSELISTDEFAULTPOSESVALUE_ANY_OF_SCHEMAS = ["QuatPose", "WSPose"]
|
|
29
|
+
|
|
30
|
+
class ResponseListDefaultPosesValue(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
ResponseListDefaultPosesValue
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
# data type: WSPose
|
|
36
|
+
anyof_schema_1_validator: Optional[WSPose] = None
|
|
37
|
+
# data type: QuatPose
|
|
38
|
+
anyof_schema_2_validator: Optional[QuatPose] = None
|
|
39
|
+
if TYPE_CHECKING:
|
|
40
|
+
actual_instance: Optional[Union[QuatPose, WSPose]] = None
|
|
41
|
+
else:
|
|
42
|
+
actual_instance: Any = None
|
|
43
|
+
any_of_schemas: Set[str] = { "QuatPose", "WSPose" }
|
|
44
|
+
|
|
45
|
+
model_config = {
|
|
46
|
+
"validate_assignment": True,
|
|
47
|
+
"protected_namespaces": (),
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
51
|
+
if args:
|
|
52
|
+
if len(args) > 1:
|
|
53
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
54
|
+
if kwargs:
|
|
55
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
56
|
+
super().__init__(actual_instance=args[0])
|
|
57
|
+
else:
|
|
58
|
+
super().__init__(**kwargs)
|
|
59
|
+
|
|
60
|
+
@field_validator('actual_instance')
|
|
61
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
62
|
+
if v is None:
|
|
63
|
+
return v
|
|
64
|
+
|
|
65
|
+
instance = ResponseListDefaultPosesValue.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
# validate data type: WSPose
|
|
68
|
+
if not isinstance(v, WSPose):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `WSPose`")
|
|
70
|
+
else:
|
|
71
|
+
return v
|
|
72
|
+
|
|
73
|
+
# validate data type: QuatPose
|
|
74
|
+
if not isinstance(v, QuatPose):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `QuatPose`")
|
|
76
|
+
else:
|
|
77
|
+
return v
|
|
78
|
+
|
|
79
|
+
if error_messages:
|
|
80
|
+
# no match
|
|
81
|
+
raise ValueError("No match found when setting the actual_instance in ResponseListDefaultPosesValue with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
|
|
82
|
+
else:
|
|
83
|
+
return v
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
87
|
+
return cls.from_json(json.dumps(obj))
|
|
88
|
+
|
|
89
|
+
@classmethod
|
|
90
|
+
def from_json(cls, json_str: str) -> Self:
|
|
91
|
+
"""Returns the object represented by the json string"""
|
|
92
|
+
instance = cls.model_construct()
|
|
93
|
+
if json_str is None:
|
|
94
|
+
return instance
|
|
95
|
+
|
|
96
|
+
error_messages = []
|
|
97
|
+
# anyof_schema_1_validator: Optional[WSPose] = None
|
|
98
|
+
try:
|
|
99
|
+
instance.actual_instance = WSPose.from_json(json_str)
|
|
100
|
+
return instance
|
|
101
|
+
except (ValidationError, ValueError) as e:
|
|
102
|
+
error_messages.append(str(e))
|
|
103
|
+
# anyof_schema_2_validator: Optional[QuatPose] = None
|
|
104
|
+
try:
|
|
105
|
+
instance.actual_instance = QuatPose.from_json(json_str)
|
|
106
|
+
return instance
|
|
107
|
+
except (ValidationError, ValueError) as e:
|
|
108
|
+
error_messages.append(str(e))
|
|
109
|
+
|
|
110
|
+
if error_messages:
|
|
111
|
+
# no match
|
|
112
|
+
raise ValueError("No match found when deserializing the JSON string into ResponseListDefaultPosesValue with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
|
|
113
|
+
else:
|
|
114
|
+
return instance
|
|
115
|
+
|
|
116
|
+
def to_json(self) -> str:
|
|
117
|
+
"""Returns the JSON representation of the actual instance"""
|
|
118
|
+
if self.actual_instance is None:
|
|
119
|
+
return "null"
|
|
120
|
+
|
|
121
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
122
|
+
return self.actual_instance.to_json()
|
|
123
|
+
else:
|
|
124
|
+
return json.dumps(self.actual_instance)
|
|
125
|
+
|
|
126
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], QuatPose, WSPose]]:
|
|
127
|
+
"""Returns the dict representation of the actual instance"""
|
|
128
|
+
if self.actual_instance is None:
|
|
129
|
+
return None
|
|
130
|
+
|
|
131
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
132
|
+
return self.actual_instance.to_dict()
|
|
133
|
+
else:
|
|
134
|
+
return self.actual_instance
|
|
135
|
+
|
|
136
|
+
def to_str(self) -> str:
|
|
137
|
+
"""Returns the string representation of the actual instance"""
|
|
138
|
+
return pprint.pformat(self.model_dump())
|
|
139
|
+
|
|
140
|
+
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Wandelbots Omniservice
|
|
5
|
+
|
|
6
|
+
A microservice-based framework for managing Omniverse functionalities
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.2.2
|
|
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
|
|
22
|
+
from wandelbots_isaacsim_api.models.semantic_segmentation_info import SemanticSegmentationInfo
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class SemanticSegmentationData(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
SemanticSegmentationData
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
data: List[List[StrictInt]] = Field(description="Pixel-to-label array")
|
|
31
|
+
info: SemanticSegmentationInfo = Field(description="Semantic segmentation metadata")
|
|
32
|
+
__properties: ClassVar[List[str]] = ["data", "info"]
|
|
33
|
+
|
|
34
|
+
model_config = ConfigDict(
|
|
35
|
+
populate_by_name=True,
|
|
36
|
+
validate_assignment=True,
|
|
37
|
+
protected_namespaces=(),
|
|
38
|
+
)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
def to_str(self) -> str:
|
|
42
|
+
"""Returns the string representation of the model using alias"""
|
|
43
|
+
return pprint.pformat(self.model_dump(by_alias=True, exclude_none=True))
|
|
44
|
+
|
|
45
|
+
def to_json(self) -> str:
|
|
46
|
+
"""
|
|
47
|
+
Returns the JSON representation of the model using alias
|
|
48
|
+
|
|
49
|
+
Do not use pydantic v2 .model_dump_json(by_alias=True, exclude_unset=True) here!
|
|
50
|
+
It is unable to resolve nested types generated by openapi-generator.
|
|
51
|
+
"""
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of SemanticSegmentationData from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
"""
|
|
69
|
+
excluded_fields: Set[str] = set([
|
|
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 info
|
|
78
|
+
if self.info:
|
|
79
|
+
_dict['info'] = self.info.to_dict()
|
|
80
|
+
return _dict
|
|
81
|
+
|
|
82
|
+
@classmethod
|
|
83
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
84
|
+
"""Create an instance of SemanticSegmentationData from a dict"""
|
|
85
|
+
if obj is None:
|
|
86
|
+
return None
|
|
87
|
+
|
|
88
|
+
if not isinstance(obj, dict):
|
|
89
|
+
return cls.model_validate(obj)
|
|
90
|
+
|
|
91
|
+
_obj = cls.model_validate({
|
|
92
|
+
"data": obj.get("data"),
|
|
93
|
+
"info": SemanticSegmentationInfo.from_dict(obj["info"]) if obj.get("info") is not None else None
|
|
94
|
+
})
|
|
95
|
+
return _obj
|
|
96
|
+
|
|
97
|
+
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Wandelbots Omniservice
|
|
5
|
+
|
|
6
|
+
A microservice-based framework for managing Omniverse functionalities
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.2.2
|
|
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
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class SemanticSegmentationInfo(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SemanticSegmentationInfo
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
id_to_labels: Dict[str, Dict[str, StrictStr]] = Field(description="Mapping of semantic IDs to their class labels and attributes")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["id_to_labels"]
|
|
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, exclude_none=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""
|
|
45
|
+
Returns the JSON representation of the model using alias
|
|
46
|
+
|
|
47
|
+
Do not use pydantic v2 .model_dump_json(by_alias=True, exclude_unset=True) here!
|
|
48
|
+
It is unable to resolve nested types generated by openapi-generator.
|
|
49
|
+
"""
|
|
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 SemanticSegmentationInfo 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
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of SemanticSegmentationInfo from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"id_to_labels": obj.get("id_to_labels")
|
|
88
|
+
})
|
|
89
|
+
return _obj
|
|
90
|
+
|
|
91
|
+
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Wandelbots Omniservice
|
|
5
|
+
|
|
6
|
+
A microservice-based framework for managing Omniverse functionalities
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.2.2
|
|
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
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from wandelbots_isaacsim_api.models.box import Box
|
|
23
|
+
from wandelbots_isaacsim_api.models.capsule import Capsule
|
|
24
|
+
from wandelbots_isaacsim_api.models.convex_hull import ConvexHull
|
|
25
|
+
from wandelbots_isaacsim_api.models.cylinder import Cylinder
|
|
26
|
+
from wandelbots_isaacsim_api.models.plane import Plane
|
|
27
|
+
from wandelbots_isaacsim_api.models.sphere import Sphere
|
|
28
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
29
|
+
from typing_extensions import Literal, Self
|
|
30
|
+
from pydantic import Field
|
|
31
|
+
|
|
32
|
+
SHAPE_ANY_OF_SCHEMAS = ["Box", "Capsule", "ConvexHull", "Cylinder", "Plane", "Sphere"]
|
|
33
|
+
|
|
34
|
+
class Shape(BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
Shape
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
# data type: ConvexHull
|
|
40
|
+
anyof_schema_1_validator: Optional[ConvexHull] = None
|
|
41
|
+
# data type: Sphere
|
|
42
|
+
anyof_schema_2_validator: Optional[Sphere] = None
|
|
43
|
+
# data type: Box
|
|
44
|
+
anyof_schema_3_validator: Optional[Box] = None
|
|
45
|
+
# data type: Capsule
|
|
46
|
+
anyof_schema_4_validator: Optional[Capsule] = None
|
|
47
|
+
# data type: Cylinder
|
|
48
|
+
anyof_schema_5_validator: Optional[Cylinder] = None
|
|
49
|
+
# data type: Plane
|
|
50
|
+
anyof_schema_6_validator: Optional[Plane] = None
|
|
51
|
+
if TYPE_CHECKING:
|
|
52
|
+
actual_instance: Optional[Union[Box, Capsule, ConvexHull, Cylinder, Plane, Sphere]] = None
|
|
53
|
+
else:
|
|
54
|
+
actual_instance: Any = None
|
|
55
|
+
any_of_schemas: Set[str] = { "Box", "Capsule", "ConvexHull", "Cylinder", "Plane", "Sphere" }
|
|
56
|
+
|
|
57
|
+
model_config = {
|
|
58
|
+
"validate_assignment": True,
|
|
59
|
+
"protected_namespaces": (),
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
63
|
+
if args:
|
|
64
|
+
if len(args) > 1:
|
|
65
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
66
|
+
if kwargs:
|
|
67
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
68
|
+
super().__init__(actual_instance=args[0])
|
|
69
|
+
else:
|
|
70
|
+
super().__init__(**kwargs)
|
|
71
|
+
|
|
72
|
+
@field_validator('actual_instance')
|
|
73
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
74
|
+
instance = Shape.model_construct()
|
|
75
|
+
error_messages = []
|
|
76
|
+
# validate data type: ConvexHull
|
|
77
|
+
if not isinstance(v, ConvexHull):
|
|
78
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `ConvexHull`")
|
|
79
|
+
else:
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
# validate data type: Sphere
|
|
83
|
+
if not isinstance(v, Sphere):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Sphere`")
|
|
85
|
+
else:
|
|
86
|
+
return v
|
|
87
|
+
|
|
88
|
+
# validate data type: Box
|
|
89
|
+
if not isinstance(v, Box):
|
|
90
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Box`")
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
# validate data type: Capsule
|
|
95
|
+
if not isinstance(v, Capsule):
|
|
96
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Capsule`")
|
|
97
|
+
else:
|
|
98
|
+
return v
|
|
99
|
+
|
|
100
|
+
# validate data type: Cylinder
|
|
101
|
+
if not isinstance(v, Cylinder):
|
|
102
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Cylinder`")
|
|
103
|
+
else:
|
|
104
|
+
return v
|
|
105
|
+
|
|
106
|
+
# validate data type: Plane
|
|
107
|
+
if not isinstance(v, Plane):
|
|
108
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `Plane`")
|
|
109
|
+
else:
|
|
110
|
+
return v
|
|
111
|
+
|
|
112
|
+
if error_messages:
|
|
113
|
+
# no match
|
|
114
|
+
raise ValueError("No match found when setting the actual_instance in Shape with anyOf schemas: Box, Capsule, ConvexHull, Cylinder, Plane, Sphere. Details: " + ", ".join(error_messages))
|
|
115
|
+
else:
|
|
116
|
+
return v
|
|
117
|
+
|
|
118
|
+
@classmethod
|
|
119
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
120
|
+
return cls.from_json(json.dumps(obj))
|
|
121
|
+
|
|
122
|
+
@classmethod
|
|
123
|
+
def from_json(cls, json_str: str) -> Self:
|
|
124
|
+
"""Returns the object represented by the json string"""
|
|
125
|
+
instance = cls.model_construct()
|
|
126
|
+
error_messages = []
|
|
127
|
+
# anyof_schema_1_validator: Optional[ConvexHull] = None
|
|
128
|
+
try:
|
|
129
|
+
instance.actual_instance = ConvexHull.from_json(json_str)
|
|
130
|
+
return instance
|
|
131
|
+
except (ValidationError, ValueError) as e:
|
|
132
|
+
error_messages.append(str(e))
|
|
133
|
+
# anyof_schema_2_validator: Optional[Sphere] = None
|
|
134
|
+
try:
|
|
135
|
+
instance.actual_instance = Sphere.from_json(json_str)
|
|
136
|
+
return instance
|
|
137
|
+
except (ValidationError, ValueError) as e:
|
|
138
|
+
error_messages.append(str(e))
|
|
139
|
+
# anyof_schema_3_validator: Optional[Box] = None
|
|
140
|
+
try:
|
|
141
|
+
instance.actual_instance = Box.from_json(json_str)
|
|
142
|
+
return instance
|
|
143
|
+
except (ValidationError, ValueError) as e:
|
|
144
|
+
error_messages.append(str(e))
|
|
145
|
+
# anyof_schema_4_validator: Optional[Capsule] = None
|
|
146
|
+
try:
|
|
147
|
+
instance.actual_instance = Capsule.from_json(json_str)
|
|
148
|
+
return instance
|
|
149
|
+
except (ValidationError, ValueError) as e:
|
|
150
|
+
error_messages.append(str(e))
|
|
151
|
+
# anyof_schema_5_validator: Optional[Cylinder] = None
|
|
152
|
+
try:
|
|
153
|
+
instance.actual_instance = Cylinder.from_json(json_str)
|
|
154
|
+
return instance
|
|
155
|
+
except (ValidationError, ValueError) as e:
|
|
156
|
+
error_messages.append(str(e))
|
|
157
|
+
# anyof_schema_6_validator: Optional[Plane] = None
|
|
158
|
+
try:
|
|
159
|
+
instance.actual_instance = Plane.from_json(json_str)
|
|
160
|
+
return instance
|
|
161
|
+
except (ValidationError, ValueError) as e:
|
|
162
|
+
error_messages.append(str(e))
|
|
163
|
+
|
|
164
|
+
if error_messages:
|
|
165
|
+
# no match
|
|
166
|
+
raise ValueError("No match found when deserializing the JSON string into Shape with anyOf schemas: Box, Capsule, ConvexHull, Cylinder, Plane, Sphere. Details: " + ", ".join(error_messages))
|
|
167
|
+
else:
|
|
168
|
+
return instance
|
|
169
|
+
|
|
170
|
+
def to_json(self) -> str:
|
|
171
|
+
"""Returns the JSON representation of the actual instance"""
|
|
172
|
+
if self.actual_instance is None:
|
|
173
|
+
return "null"
|
|
174
|
+
|
|
175
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
176
|
+
return self.actual_instance.to_json()
|
|
177
|
+
else:
|
|
178
|
+
return json.dumps(self.actual_instance)
|
|
179
|
+
|
|
180
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], Box, Capsule, ConvexHull, Cylinder, Plane, Sphere]]:
|
|
181
|
+
"""Returns the dict representation of the actual instance"""
|
|
182
|
+
if self.actual_instance is None:
|
|
183
|
+
return None
|
|
184
|
+
|
|
185
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
186
|
+
return self.actual_instance.to_dict()
|
|
187
|
+
else:
|
|
188
|
+
return self.actual_instance
|
|
189
|
+
|
|
190
|
+
def to_str(self) -> str:
|
|
191
|
+
"""Returns the string representation of the actual instance"""
|
|
192
|
+
return pprint.pformat(self.model_dump())
|
|
193
|
+
|
|
194
|
+
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
Wandelbots Omniservice
|
|
5
|
+
|
|
6
|
+
A microservice-based framework for managing Omniverse functionalities
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 2.2.2
|
|
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 SimulationState(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
SimulationState
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
timeline: Optional[StrictStr] = Field(default=None, description="State simulation timeline")
|
|
30
|
+
__properties: ClassVar[List[str]] = ["timeline"]
|
|
31
|
+
|
|
32
|
+
@field_validator('timeline')
|
|
33
|
+
def timeline_validate_enum(cls, value):
|
|
34
|
+
"""Validates the enum"""
|
|
35
|
+
if value is None:
|
|
36
|
+
return value
|
|
37
|
+
|
|
38
|
+
if value not in set(['playing', 'paused', 'stopped']):
|
|
39
|
+
raise ValueError("must be one of enum values ('playing', 'paused', 'stopped')")
|
|
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, exclude_none=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""
|
|
55
|
+
Returns the JSON representation of the model using alias
|
|
56
|
+
|
|
57
|
+
Do not use pydantic v2 .model_dump_json(by_alias=True, exclude_unset=True) here!
|
|
58
|
+
It is unable to resolve nested types generated by openapi-generator.
|
|
59
|
+
"""
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of SimulationState from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
return _dict
|
|
86
|
+
|
|
87
|
+
@classmethod
|
|
88
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
89
|
+
"""Create an instance of SimulationState from a dict"""
|
|
90
|
+
if obj is None:
|
|
91
|
+
return None
|
|
92
|
+
|
|
93
|
+
if not isinstance(obj, dict):
|
|
94
|
+
return cls.model_validate(obj)
|
|
95
|
+
|
|
96
|
+
_obj = cls.model_validate({
|
|
97
|
+
"timeline": obj.get("timeline")
|
|
98
|
+
})
|
|
99
|
+
return _obj
|
|
100
|
+
|
|
101
|
+
|