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.
Files changed (85) hide show
  1. wandelbots_isaacsim_api/__init__.py +50 -0
  2. wandelbots_isaacsim_api/api/__init__.py +25 -0
  3. wandelbots_isaacsim_api/api/collision_world_api.py +316 -0
  4. wandelbots_isaacsim_api/api/default_api.py +800 -0
  5. wandelbots_isaacsim_api/api/manipulators_motion_group_api.py +1619 -0
  6. wandelbots_isaacsim_api/api/periphery_camera_api.py +3434 -0
  7. wandelbots_isaacsim_api/api/prims_api.py +4963 -0
  8. wandelbots_isaacsim_api/api/stage_api.py +2351 -0
  9. wandelbots_isaacsim_api/api/teaching_api.py +1312 -0
  10. wandelbots_isaacsim_api/api/trajectory_api.py +1686 -0
  11. wandelbots_isaacsim_api/api/ui_api.py +562 -0
  12. wandelbots_isaacsim_api/api_client.py +800 -0
  13. wandelbots_isaacsim_api/api_response.py +21 -0
  14. wandelbots_isaacsim_api/collision/__init__.py +0 -0
  15. wandelbots_isaacsim_api/collision/utils.py +99 -0
  16. wandelbots_isaacsim_api/configuration.py +561 -0
  17. wandelbots_isaacsim_api/exceptions.py +216 -0
  18. wandelbots_isaacsim_api/models/__init__.py +135 -0
  19. wandelbots_isaacsim_api/models/auth0_credentials.py +100 -0
  20. wandelbots_isaacsim_api/models/body_apply_relative_pose.py +99 -0
  21. wandelbots_isaacsim_api/models/body_assign_default_poses.py +91 -0
  22. wandelbots_isaacsim_api/models/body_reset_to_default_poses.py +91 -0
  23. wandelbots_isaacsim_api/models/body_set_joint_state.py +93 -0
  24. wandelbots_isaacsim_api/models/body_set_prim_metadata.py +97 -0
  25. wandelbots_isaacsim_api/models/body_set_prim_visibility.py +103 -0
  26. wandelbots_isaacsim_api/models/body_set_semantic_label.py +93 -0
  27. wandelbots_isaacsim_api/models/body_update_colliders.py +93 -0
  28. wandelbots_isaacsim_api/models/body_update_pose.py +97 -0
  29. wandelbots_isaacsim_api/models/bounding_box2_d.py +98 -0
  30. wandelbots_isaacsim_api/models/bounding_box3_d.py +100 -0
  31. wandelbots_isaacsim_api/models/box.py +119 -0
  32. wandelbots_isaacsim_api/models/box_sweep_parameters.py +111 -0
  33. wandelbots_isaacsim_api/models/capsule.py +105 -0
  34. wandelbots_isaacsim_api/models/collider.py +101 -0
  35. wandelbots_isaacsim_api/models/convex_hull.py +103 -0
  36. wandelbots_isaacsim_api/models/create_ghost_object.py +102 -0
  37. wandelbots_isaacsim_api/models/custom_prim.py +100 -0
  38. wandelbots_isaacsim_api/models/custom_prim_data.py +93 -0
  39. wandelbots_isaacsim_api/models/cylinder.py +105 -0
  40. wandelbots_isaacsim_api/models/ghost_object.py +106 -0
  41. wandelbots_isaacsim_api/models/ghost_object_source.py +93 -0
  42. wandelbots_isaacsim_api/models/gizmo_prim.py +98 -0
  43. wandelbots_isaacsim_api/models/http_validation_error.py +108 -0
  44. wandelbots_isaacsim_api/models/instance_segmentation_data.py +97 -0
  45. wandelbots_isaacsim_api/models/instance_segmentation_info.py +91 -0
  46. wandelbots_isaacsim_api/models/motion_group_configuration.py +99 -0
  47. wandelbots_isaacsim_api/models/motion_stream_configuration.py +101 -0
  48. wandelbots_isaacsim_api/models/patch_trajectory_data.py +107 -0
  49. wandelbots_isaacsim_api/models/plane.py +101 -0
  50. wandelbots_isaacsim_api/models/point_cloud.py +95 -0
  51. wandelbots_isaacsim_api/models/pose.py +137 -0
  52. wandelbots_isaacsim_api/models/pose_position_inner.py +138 -0
  53. wandelbots_isaacsim_api/models/prim.py +165 -0
  54. wandelbots_isaacsim_api/models/prim_selection.py +91 -0
  55. wandelbots_isaacsim_api/models/quat_pose.py +92 -0
  56. wandelbots_isaacsim_api/models/relative_pose_mode.py +39 -0
  57. wandelbots_isaacsim_api/models/response_get_pose.py +134 -0
  58. wandelbots_isaacsim_api/models/response_get_relative_pose.py +134 -0
  59. wandelbots_isaacsim_api/models/response_list_default_poses_value.py +140 -0
  60. wandelbots_isaacsim_api/models/semantic_segmentation_data.py +97 -0
  61. wandelbots_isaacsim_api/models/semantic_segmentation_info.py +91 -0
  62. wandelbots_isaacsim_api/models/shape.py +194 -0
  63. wandelbots_isaacsim_api/models/simulation_state.py +101 -0
  64. wandelbots_isaacsim_api/models/sphere.py +103 -0
  65. wandelbots_isaacsim_api/models/sphere_sweep_parameters.py +107 -0
  66. wandelbots_isaacsim_api/models/stage_units.py +91 -0
  67. wandelbots_isaacsim_api/models/sweep_arguments.py +134 -0
  68. wandelbots_isaacsim_api/models/tcp_source.py +99 -0
  69. wandelbots_isaacsim_api/models/trajectory_data.py +101 -0
  70. wandelbots_isaacsim_api/models/trajectory_marker.py +97 -0
  71. wandelbots_isaacsim_api/models/trajectory_object.py +101 -0
  72. wandelbots_isaacsim_api/models/trajectory_options.py +94 -0
  73. wandelbots_isaacsim_api/models/usd_stage_model.py +91 -0
  74. wandelbots_isaacsim_api/models/validation_error.py +112 -0
  75. wandelbots_isaacsim_api/models/validation_error_loc_inner.py +138 -0
  76. wandelbots_isaacsim_api/models/ws_pose.py +92 -0
  77. wandelbots_isaacsim_api/py.typed +0 -0
  78. wandelbots_isaacsim_api/rest.py +212 -0
  79. wandelbots_isaacsim_api/trajectory/__init__.py +17 -0
  80. wandelbots_isaacsim_api/trajectory/trajectory_viewer.py +111 -0
  81. wandelbots_isaacsim_api/trajectory/utils.py +154 -0
  82. wandelbots_isaacsim_api-2.2.2.dist-info/LICENSE +201 -0
  83. wandelbots_isaacsim_api-2.2.2.dist-info/METADATA +60 -0
  84. wandelbots_isaacsim_api-2.2.2.dist-info/RECORD +85 -0
  85. wandelbots_isaacsim_api-2.2.2.dist-info/WHEEL +4 -0
@@ -0,0 +1,165 @@
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 json
17
+ import pprint
18
+ from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
19
+ from typing import Any, List, Optional
20
+ from wandelbots_isaacsim_api.models.custom_prim import CustomPrim
21
+ from wandelbots_isaacsim_api.models.gizmo_prim import GizmoPrim
22
+ from pydantic import StrictStr, Field
23
+ from typing import Union, List, Set, Optional, Dict
24
+ from typing_extensions import Literal, Self
25
+
26
+ PRIM_ONE_OF_SCHEMAS = ["CustomPrim", "GizmoPrim"]
27
+
28
+ class Prim(BaseModel):
29
+ """
30
+ Prim
31
+ """
32
+ # data type: GizmoPrim
33
+ oneof_schema_1_validator: Optional[GizmoPrim] = None
34
+ # data type: CustomPrim
35
+ oneof_schema_2_validator: Optional[CustomPrim] = None
36
+ actual_instance: Optional[Union[CustomPrim, GizmoPrim]] = None
37
+ one_of_schemas: Set[str] = { "CustomPrim", "GizmoPrim" }
38
+
39
+ model_config = ConfigDict(
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ discriminator_value_class_map: Dict[str, str] = {
46
+ }
47
+
48
+ def __init__(self, *args, **kwargs) -> None:
49
+ if args:
50
+ if len(args) > 1:
51
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
+ if kwargs:
53
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
+ super().__init__(actual_instance=args[0])
55
+ else:
56
+ super().__init__(**kwargs)
57
+
58
+ @field_validator('actual_instance')
59
+ def actual_instance_must_validate_oneof(cls, v):
60
+ instance = Prim.model_construct()
61
+ error_messages = []
62
+ match = 0
63
+ # validate data type: GizmoPrim
64
+ if not isinstance(v, GizmoPrim):
65
+ error_messages.append(f"Error! Input type `{type(v)}` is not `GizmoPrim`")
66
+ else:
67
+ match += 1
68
+ # validate data type: CustomPrim
69
+ if not isinstance(v, CustomPrim):
70
+ error_messages.append(f"Error! Input type `{type(v)}` is not `CustomPrim`")
71
+ else:
72
+ match += 1
73
+ if match > 1:
74
+ # more than 1 match
75
+ raise ValueError("Multiple matches found when setting `actual_instance` in Prim with oneOf schemas: CustomPrim, GizmoPrim. Details: " + ", ".join(error_messages))
76
+ elif match == 0:
77
+ # no match
78
+ raise ValueError("No match found when setting `actual_instance` in Prim with oneOf schemas: CustomPrim, GizmoPrim. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ match = 0
92
+
93
+ # use oneOf discriminator to lookup the data type
94
+ _data_type = json.loads(json_str).get("type")
95
+ if not _data_type:
96
+ raise ValueError("Failed to lookup data type from the field `type` in the input.")
97
+
98
+ # check if data type is `CustomPrim`
99
+ if _data_type == "custom":
100
+ instance.actual_instance = CustomPrim.from_json(json_str)
101
+ return instance
102
+
103
+ # check if data type is `GizmoPrim`
104
+ if _data_type == "gizmo":
105
+ instance.actual_instance = GizmoPrim.from_json(json_str)
106
+ return instance
107
+
108
+ # check if data type is `CustomPrim`
109
+ if _data_type == "CustomPrim":
110
+ instance.actual_instance = CustomPrim.from_json(json_str)
111
+ return instance
112
+
113
+ # check if data type is `GizmoPrim`
114
+ if _data_type == "GizmoPrim":
115
+ instance.actual_instance = GizmoPrim.from_json(json_str)
116
+ return instance
117
+
118
+ # deserialize data into GizmoPrim
119
+ try:
120
+ instance.actual_instance = GizmoPrim.from_json(json_str)
121
+ match += 1
122
+ except (ValidationError, ValueError) as e:
123
+ error_messages.append(str(e))
124
+ # deserialize data into CustomPrim
125
+ try:
126
+ instance.actual_instance = CustomPrim.from_json(json_str)
127
+ match += 1
128
+ except (ValidationError, ValueError) as e:
129
+ error_messages.append(str(e))
130
+
131
+ if match > 1:
132
+ # more than 1 match
133
+ raise ValueError("Multiple matches found when deserializing the JSON string into Prim with oneOf schemas: CustomPrim, GizmoPrim. Details: " + ", ".join(error_messages))
134
+ elif match == 0:
135
+ # no match
136
+ raise ValueError("No match found when deserializing the JSON string into Prim with oneOf schemas: CustomPrim, GizmoPrim. Details: " + ", ".join(error_messages))
137
+ else:
138
+ return instance
139
+
140
+ def to_json(self) -> str:
141
+ """Returns the JSON representation of the actual instance"""
142
+ if self.actual_instance is None:
143
+ return "null"
144
+
145
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
146
+ return self.actual_instance.to_json()
147
+ else:
148
+ return json.dumps(self.actual_instance)
149
+
150
+ def to_dict(self) -> Optional[Union[Dict[str, Any], CustomPrim, GizmoPrim]]:
151
+ """Returns the dict representation of the actual instance"""
152
+ if self.actual_instance is None:
153
+ return None
154
+
155
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
156
+ return self.actual_instance.to_dict()
157
+ else:
158
+ # primitive type
159
+ return self.actual_instance
160
+
161
+ def to_str(self) -> str:
162
+ """Returns the string representation of the actual instance"""
163
+ return pprint.pformat(self.model_dump())
164
+
165
+
@@ -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, StrictStr
21
+ from typing import Any, ClassVar, Dict, List
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class PrimSelection(BaseModel):
26
+ """
27
+ PrimSelection
28
+ """ # noqa: E501
29
+ prim_paths: List[StrictStr]
30
+ __properties: ClassVar[List[str]] = ["prim_paths"]
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 PrimSelection 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 PrimSelection 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
+ "prim_paths": obj.get("prim_paths")
88
+ })
89
+ return _obj
90
+
91
+
@@ -0,0 +1,92 @@
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, StrictFloat, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from typing_extensions import Annotated
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class QuatPose(BaseModel):
27
+ """
28
+ QuatPose
29
+ """ # noqa: E501
30
+ pose: Optional[Annotated[List[Union[StrictFloat, StrictInt]], Field(min_length=7, max_length=7)]] = Field(default=None, description="Pose in quaternion vector format (WS)")
31
+ __properties: ClassVar[List[str]] = ["pose"]
32
+
33
+ model_config = ConfigDict(
34
+ populate_by_name=True,
35
+ validate_assignment=True,
36
+ protected_namespaces=(),
37
+ )
38
+
39
+
40
+ def to_str(self) -> str:
41
+ """Returns the string representation of the model using alias"""
42
+ return pprint.pformat(self.model_dump(by_alias=True, exclude_none=True))
43
+
44
+ def to_json(self) -> str:
45
+ """
46
+ Returns the JSON representation of the model using alias
47
+
48
+ Do not use pydantic v2 .model_dump_json(by_alias=True, exclude_unset=True) here!
49
+ It is unable to resolve nested types generated by openapi-generator.
50
+ """
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 QuatPose 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
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ return _dict
77
+
78
+ @classmethod
79
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
80
+ """Create an instance of QuatPose from a dict"""
81
+ if obj is None:
82
+ return None
83
+
84
+ if not isinstance(obj, dict):
85
+ return cls.model_validate(obj)
86
+
87
+ _obj = cls.model_validate({
88
+ "pose": obj.get("pose")
89
+ })
90
+ return _obj
91
+
92
+
@@ -0,0 +1,39 @@
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 json
17
+ from enum import Enum
18
+ from typing_extensions import Self
19
+
20
+
21
+ class RelativePoseMode(str, Enum):
22
+ """
23
+ RelativePoseMode
24
+ """
25
+
26
+ """
27
+ allowed enum values
28
+ """
29
+ NORMAL = 'normal'
30
+ INVERSE_FIRST = 'inverse_first'
31
+ INVERSE_SECOND = 'inverse_second'
32
+ INVERSE_BOTH = 'inverse_both'
33
+
34
+ @classmethod
35
+ def from_json(cls, json_str: str) -> Self:
36
+ """Create an instance of RelativePoseMode from a JSON string"""
37
+ return cls(json.loads(json_str))
38
+
39
+
@@ -0,0 +1,134 @@
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
+ RESPONSEGETPOSE_ANY_OF_SCHEMAS = ["QuatPose", "WSPose"]
29
+
30
+ class ResponseGetPose(BaseModel):
31
+ """
32
+ ResponseGetPose
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
+ instance = ResponseGetPose.model_construct()
63
+ error_messages = []
64
+ # validate data type: WSPose
65
+ if not isinstance(v, WSPose):
66
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WSPose`")
67
+ else:
68
+ return v
69
+
70
+ # validate data type: QuatPose
71
+ if not isinstance(v, QuatPose):
72
+ error_messages.append(f"Error! Input type `{type(v)}` is not `QuatPose`")
73
+ else:
74
+ return v
75
+
76
+ if error_messages:
77
+ # no match
78
+ raise ValueError("No match found when setting the actual_instance in ResponseGetPose with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ # anyof_schema_1_validator: Optional[WSPose] = None
92
+ try:
93
+ instance.actual_instance = WSPose.from_json(json_str)
94
+ return instance
95
+ except (ValidationError, ValueError) as e:
96
+ error_messages.append(str(e))
97
+ # anyof_schema_2_validator: Optional[QuatPose] = None
98
+ try:
99
+ instance.actual_instance = QuatPose.from_json(json_str)
100
+ return instance
101
+ except (ValidationError, ValueError) as e:
102
+ error_messages.append(str(e))
103
+
104
+ if error_messages:
105
+ # no match
106
+ raise ValueError("No match found when deserializing the JSON string into ResponseGetPose with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
107
+ else:
108
+ return instance
109
+
110
+ def to_json(self) -> str:
111
+ """Returns the JSON representation of the actual instance"""
112
+ if self.actual_instance is None:
113
+ return "null"
114
+
115
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
116
+ return self.actual_instance.to_json()
117
+ else:
118
+ return json.dumps(self.actual_instance)
119
+
120
+ def to_dict(self) -> Optional[Union[Dict[str, Any], QuatPose, WSPose]]:
121
+ """Returns the dict representation of the actual instance"""
122
+ if self.actual_instance is None:
123
+ return None
124
+
125
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
126
+ return self.actual_instance.to_dict()
127
+ else:
128
+ return self.actual_instance
129
+
130
+ def to_str(self) -> str:
131
+ """Returns the string representation of the actual instance"""
132
+ return pprint.pformat(self.model_dump())
133
+
134
+
@@ -0,0 +1,134 @@
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
+ RESPONSEGETRELATIVEPOSE_ANY_OF_SCHEMAS = ["QuatPose", "WSPose"]
29
+
30
+ class ResponseGetRelativePose(BaseModel):
31
+ """
32
+ ResponseGetRelativePose
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
+ instance = ResponseGetRelativePose.model_construct()
63
+ error_messages = []
64
+ # validate data type: WSPose
65
+ if not isinstance(v, WSPose):
66
+ error_messages.append(f"Error! Input type `{type(v)}` is not `WSPose`")
67
+ else:
68
+ return v
69
+
70
+ # validate data type: QuatPose
71
+ if not isinstance(v, QuatPose):
72
+ error_messages.append(f"Error! Input type `{type(v)}` is not `QuatPose`")
73
+ else:
74
+ return v
75
+
76
+ if error_messages:
77
+ # no match
78
+ raise ValueError("No match found when setting the actual_instance in ResponseGetRelativePose with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
79
+ else:
80
+ return v
81
+
82
+ @classmethod
83
+ def from_dict(cls, obj: Dict[str, Any]) -> Self:
84
+ return cls.from_json(json.dumps(obj))
85
+
86
+ @classmethod
87
+ def from_json(cls, json_str: str) -> Self:
88
+ """Returns the object represented by the json string"""
89
+ instance = cls.model_construct()
90
+ error_messages = []
91
+ # anyof_schema_1_validator: Optional[WSPose] = None
92
+ try:
93
+ instance.actual_instance = WSPose.from_json(json_str)
94
+ return instance
95
+ except (ValidationError, ValueError) as e:
96
+ error_messages.append(str(e))
97
+ # anyof_schema_2_validator: Optional[QuatPose] = None
98
+ try:
99
+ instance.actual_instance = QuatPose.from_json(json_str)
100
+ return instance
101
+ except (ValidationError, ValueError) as e:
102
+ error_messages.append(str(e))
103
+
104
+ if error_messages:
105
+ # no match
106
+ raise ValueError("No match found when deserializing the JSON string into ResponseGetRelativePose with anyOf schemas: QuatPose, WSPose. Details: " + ", ".join(error_messages))
107
+ else:
108
+ return instance
109
+
110
+ def to_json(self) -> str:
111
+ """Returns the JSON representation of the actual instance"""
112
+ if self.actual_instance is None:
113
+ return "null"
114
+
115
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
116
+ return self.actual_instance.to_json()
117
+ else:
118
+ return json.dumps(self.actual_instance)
119
+
120
+ def to_dict(self) -> Optional[Union[Dict[str, Any], QuatPose, WSPose]]:
121
+ """Returns the dict representation of the actual instance"""
122
+ if self.actual_instance is None:
123
+ return None
124
+
125
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
126
+ return self.actual_instance.to_dict()
127
+ else:
128
+ return self.actual_instance
129
+
130
+ def to_str(self) -> str:
131
+ """Returns the string representation of the actual instance"""
132
+ return pprint.pformat(self.model_dump())
133
+
134
+