across-server-openapi-python 0.0.1__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 (128) hide show
  1. across/__init__.py +0 -0
  2. across/sdk/__init__.py +0 -0
  3. across/sdk/v1/__init__.py +251 -0
  4. across/sdk/v1/abstract_credential_storage.py +16 -0
  5. across/sdk/v1/api/__init__.py +20 -0
  6. across/sdk/v1/api/auth_api.py +1097 -0
  7. across/sdk/v1/api/filter_api.py +623 -0
  8. across/sdk/v1/api/group_api.py +586 -0
  9. across/sdk/v1/api/group_invite_api.py +1165 -0
  10. across/sdk/v1/api/group_role_api.py +2070 -0
  11. across/sdk/v1/api/instrument_api.py +633 -0
  12. across/sdk/v1/api/internal_api.py +571 -0
  13. across/sdk/v1/api/observation_api.py +940 -0
  14. across/sdk/v1/api/observatory_api.py +670 -0
  15. across/sdk/v1/api/permission_api.py +285 -0
  16. across/sdk/v1/api/role_api.py +552 -0
  17. across/sdk/v1/api/schedule_api.py +1914 -0
  18. across/sdk/v1/api/service_account_api.py +2353 -0
  19. across/sdk/v1/api/telescope_api.py +667 -0
  20. across/sdk/v1/api/tle_api.py +317 -0
  21. across/sdk/v1/api/tools_api.py +812 -0
  22. across/sdk/v1/api/user_api.py +2263 -0
  23. across/sdk/v1/api_client.py +801 -0
  24. across/sdk/v1/api_client_wrapper.py +239 -0
  25. across/sdk/v1/api_response.py +21 -0
  26. across/sdk/v1/configuration.py +605 -0
  27. across/sdk/v1/exceptions.py +216 -0
  28. across/sdk/v1/models/__init__.py +103 -0
  29. across/sdk/v1/models/access_token_response.py +89 -0
  30. across/sdk/v1/models/across_server_routes_v1_group_invite_schemas_group_invite.py +104 -0
  31. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group_role.py +124 -0
  32. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_service_account.py +106 -0
  33. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_user.py +95 -0
  34. across/sdk/v1/models/across_server_routes_v1_group_schemas_group.py +111 -0
  35. across/sdk/v1/models/across_server_routes_v1_group_schemas_user.py +105 -0
  36. across/sdk/v1/models/across_server_routes_v1_role_schemas_user.py +96 -0
  37. across/sdk/v1/models/across_server_routes_v1_system_service_account_schemas_service_account.py +90 -0
  38. across/sdk/v1/models/across_server_routes_v1_system_service_account_schemas_service_account_secret.py +92 -0
  39. across/sdk/v1/models/across_server_routes_v1_user_schemas_group.py +101 -0
  40. across/sdk/v1/models/across_server_routes_v1_user_schemas_group_invite.py +99 -0
  41. across/sdk/v1/models/across_server_routes_v1_user_schemas_group_role.py +99 -0
  42. across/sdk/v1/models/across_server_routes_v1_user_schemas_user.py +135 -0
  43. across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account.py +111 -0
  44. across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account_secret.py +118 -0
  45. across/sdk/v1/models/alt_az_constraint.py +130 -0
  46. across/sdk/v1/models/bandpass.py +149 -0
  47. across/sdk/v1/models/bandpass_type.py +155 -0
  48. across/sdk/v1/models/constrained_date.py +93 -0
  49. across/sdk/v1/models/constraint_reason.py +89 -0
  50. across/sdk/v1/models/constraint_type.py +43 -0
  51. across/sdk/v1/models/coordinate.py +100 -0
  52. across/sdk/v1/models/date_range.py +90 -0
  53. across/sdk/v1/models/depth_unit.py +39 -0
  54. across/sdk/v1/models/earth_limb_constraint.py +124 -0
  55. across/sdk/v1/models/energy_bandpass.py +121 -0
  56. across/sdk/v1/models/energy_unit.py +40 -0
  57. across/sdk/v1/models/ephemeris_type.py +39 -0
  58. across/sdk/v1/models/filter.py +135 -0
  59. across/sdk/v1/models/frequency_bandpass.py +121 -0
  60. across/sdk/v1/models/frequency_unit.py +40 -0
  61. across/sdk/v1/models/grant_type.py +37 -0
  62. across/sdk/v1/models/ground_parameters.py +91 -0
  63. across/sdk/v1/models/group_invite_create.py +87 -0
  64. across/sdk/v1/models/group_invite_group_details.py +94 -0
  65. across/sdk/v1/models/group_read.py +91 -0
  66. across/sdk/v1/models/group_role_create.py +89 -0
  67. across/sdk/v1/models/group_role_read.py +99 -0
  68. across/sdk/v1/models/http_validation_error.py +95 -0
  69. across/sdk/v1/models/id_name_schema.py +96 -0
  70. across/sdk/v1/models/instrument.py +163 -0
  71. across/sdk/v1/models/instrument_constraints_inner.py +237 -0
  72. across/sdk/v1/models/ivoa_obs_category.py +39 -0
  73. across/sdk/v1/models/ivoa_obs_tracking_type.py +38 -0
  74. across/sdk/v1/models/jpl_parameters.py +87 -0
  75. across/sdk/v1/models/moon_angle_constraint.py +124 -0
  76. across/sdk/v1/models/nullable_date_range.py +100 -0
  77. across/sdk/v1/models/observation.py +248 -0
  78. across/sdk/v1/models/observation_create.py +249 -0
  79. across/sdk/v1/models/observation_status.py +40 -0
  80. across/sdk/v1/models/observation_type.py +39 -0
  81. across/sdk/v1/models/observatory.py +145 -0
  82. across/sdk/v1/models/observatory_ephemeris_type.py +96 -0
  83. across/sdk/v1/models/observatory_type.py +37 -0
  84. across/sdk/v1/models/page_observation.py +116 -0
  85. across/sdk/v1/models/page_schedule.py +116 -0
  86. across/sdk/v1/models/parameters.py +164 -0
  87. across/sdk/v1/models/permission.py +89 -0
  88. across/sdk/v1/models/point.py +89 -0
  89. across/sdk/v1/models/role.py +100 -0
  90. across/sdk/v1/models/role_base.py +89 -0
  91. across/sdk/v1/models/saa_polygon_constraint.py +101 -0
  92. across/sdk/v1/models/schedule.py +144 -0
  93. across/sdk/v1/models/schedule_cadence.py +99 -0
  94. across/sdk/v1/models/schedule_create.py +123 -0
  95. across/sdk/v1/models/schedule_create_many.py +97 -0
  96. across/sdk/v1/models/schedule_fidelity.py +37 -0
  97. across/sdk/v1/models/schedule_status.py +38 -0
  98. across/sdk/v1/models/service_account_create.py +101 -0
  99. across/sdk/v1/models/service_account_secret.py +103 -0
  100. across/sdk/v1/models/service_account_update.py +106 -0
  101. across/sdk/v1/models/spice_parameters.py +89 -0
  102. across/sdk/v1/models/sun_angle_constraint.py +124 -0
  103. across/sdk/v1/models/system_service_account.py +121 -0
  104. across/sdk/v1/models/system_service_account_secret.py +123 -0
  105. across/sdk/v1/models/telescope.py +135 -0
  106. across/sdk/v1/models/telescope_instrument.py +163 -0
  107. across/sdk/v1/models/tle.py +99 -0
  108. across/sdk/v1/models/tle_create.py +94 -0
  109. across/sdk/v1/models/tle_parameters.py +89 -0
  110. across/sdk/v1/models/unit_value.py +94 -0
  111. across/sdk/v1/models/user_create.py +93 -0
  112. across/sdk/v1/models/user_info.py +95 -0
  113. across/sdk/v1/models/user_update.py +106 -0
  114. across/sdk/v1/models/validation_error.py +99 -0
  115. across/sdk/v1/models/validation_error_loc_inner.py +138 -0
  116. across/sdk/v1/models/visibility_result.py +97 -0
  117. across/sdk/v1/models/visibility_type.py +38 -0
  118. across/sdk/v1/models/visibility_window.py +99 -0
  119. across/sdk/v1/models/wavelength_bandpass.py +142 -0
  120. across/sdk/v1/models/wavelength_unit.py +39 -0
  121. across/sdk/v1/models/window.py +96 -0
  122. across/sdk/v1/py.typed +0 -0
  123. across/sdk/v1/rest.py +258 -0
  124. across_server_openapi_python-0.0.1.dist-info/METADATA +326 -0
  125. across_server_openapi_python-0.0.1.dist-info/RECORD +128 -0
  126. across_server_openapi_python-0.0.1.dist-info/WHEEL +5 -0
  127. across_server_openapi_python-0.0.1.dist-info/licenses/LICENSE +42 -0
  128. across_server_openapi_python-0.0.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,99 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 0.3.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 across.sdk.v1.models.permission import Permission
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class GroupRoleRead(BaseModel):
27
+ """
28
+ GroupRoleRead
29
+ """ # noqa: E501
30
+ name: StrictStr
31
+ permissions: List[Permission]
32
+ id: StrictStr
33
+ __properties: ClassVar[List[str]] = ["name", "permissions", "id"]
34
+
35
+ model_config = ConfigDict(
36
+ populate_by_name=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
+ return json.dumps(self.to_dict())
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of GroupRoleRead from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # override the default output from pydantic by calling `to_dict()` of each item in permissions (list)
75
+ _items = []
76
+ if self.permissions:
77
+ for _item_permissions in self.permissions:
78
+ if _item_permissions:
79
+ _items.append(_item_permissions.to_dict())
80
+ _dict['permissions'] = _items
81
+ return _dict
82
+
83
+ @classmethod
84
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
85
+ """Create an instance of GroupRoleRead from a dict"""
86
+ if obj is None:
87
+ return None
88
+
89
+ if not isinstance(obj, dict):
90
+ return cls.model_validate(obj)
91
+
92
+ _obj = cls.model_validate({
93
+ "name": obj.get("name"),
94
+ "permissions": [Permission.from_dict(_item) for _item in obj["permissions"]] if obj.get("permissions") is not None else None,
95
+ "id": obj.get("id")
96
+ })
97
+ return _obj
98
+
99
+
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 0.3.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
21
+ from typing import Any, ClassVar, Dict, List, Optional
22
+ from across.sdk.v1.models.validation_error import ValidationError
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+
26
+ class HTTPValidationError(BaseModel):
27
+ """
28
+ HTTPValidationError
29
+ """ # noqa: E501
30
+ detail: Optional[List[ValidationError]] = None
31
+ __properties: ClassVar[List[str]] = ["detail"]
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))
43
+
44
+ def to_json(self) -> str:
45
+ """Returns the JSON representation of the model using alias"""
46
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
+ return json.dumps(self.to_dict())
48
+
49
+ @classmethod
50
+ def from_json(cls, json_str: str) -> Optional[Self]:
51
+ """Create an instance of HTTPValidationError from a JSON string"""
52
+ return cls.from_dict(json.loads(json_str))
53
+
54
+ def to_dict(self) -> Dict[str, Any]:
55
+ """Return the dictionary representation of the model using alias.
56
+
57
+ This has the following differences from calling pydantic's
58
+ `self.model_dump(by_alias=True)`:
59
+
60
+ * `None` is only added to the output dict for nullable fields that
61
+ were set at model initialization. Other fields with value `None`
62
+ are ignored.
63
+ """
64
+ excluded_fields: Set[str] = set([
65
+ ])
66
+
67
+ _dict = self.model_dump(
68
+ by_alias=True,
69
+ exclude=excluded_fields,
70
+ exclude_none=True,
71
+ )
72
+ # override the default output from pydantic by calling `to_dict()` of each item in detail (list)
73
+ _items = []
74
+ if self.detail:
75
+ for _item_detail in self.detail:
76
+ if _item_detail:
77
+ _items.append(_item_detail.to_dict())
78
+ _dict['detail'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of HTTPValidationError from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "detail": [ValidationError.from_dict(_item) for _item in obj["detail"]] if obj.get("detail") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 0.3.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, Optional
22
+ from typing import Optional, Set
23
+ from typing_extensions import Self
24
+
25
+ class IDNameSchema(BaseModel):
26
+ """
27
+ IDNameSchema
28
+ """ # noqa: E501
29
+ id: StrictStr
30
+ name: StrictStr
31
+ short_name: Optional[StrictStr]
32
+ __properties: ClassVar[List[str]] = ["id", "name", "short_name"]
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))
44
+
45
+ def to_json(self) -> str:
46
+ """Returns the JSON representation of the model using alias"""
47
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
48
+ return json.dumps(self.to_dict())
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of IDNameSchema from a JSON string"""
53
+ return cls.from_dict(json.loads(json_str))
54
+
55
+ def to_dict(self) -> Dict[str, Any]:
56
+ """Return the dictionary representation of the model using alias.
57
+
58
+ This has the following differences from calling pydantic's
59
+ `self.model_dump(by_alias=True)`:
60
+
61
+ * `None` is only added to the output dict for nullable fields that
62
+ were set at model initialization. Other fields with value `None`
63
+ are ignored.
64
+ """
65
+ excluded_fields: Set[str] = set([
66
+ ])
67
+
68
+ _dict = self.model_dump(
69
+ by_alias=True,
70
+ exclude=excluded_fields,
71
+ exclude_none=True,
72
+ )
73
+ # set to None if short_name (nullable) is None
74
+ # and model_fields_set contains the field
75
+ if self.short_name is None and "short_name" in self.model_fields_set:
76
+ _dict['short_name'] = None
77
+
78
+ return _dict
79
+
80
+ @classmethod
81
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
82
+ """Create an instance of IDNameSchema from a dict"""
83
+ if obj is None:
84
+ return None
85
+
86
+ if not isinstance(obj, dict):
87
+ return cls.model_validate(obj)
88
+
89
+ _obj = cls.model_validate({
90
+ "id": obj.get("id"),
91
+ "name": obj.get("name"),
92
+ "short_name": obj.get("short_name")
93
+ })
94
+ return _obj
95
+
96
+
@@ -0,0 +1,163 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 0.3.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 datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict, StrictStr
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from across.sdk.v1.models.filter import Filter
24
+ from across.sdk.v1.models.id_name_schema import IDNameSchema
25
+ from across.sdk.v1.models.instrument_constraints_inner import InstrumentConstraintsInner
26
+ from across.sdk.v1.models.point import Point
27
+ from across.sdk.v1.models.visibility_type import VisibilityType
28
+ from typing import Optional, Set
29
+ from typing_extensions import Self
30
+
31
+ class Instrument(BaseModel):
32
+ """
33
+ A Pydantic model class representing a created Instrument Notes ----- Inherits from InstrumentBase Methods ------- from_orm(instrument: InstrumentModel) -> Instrument Static method that instantiates this class from a Instrument database record
34
+ """ # noqa: E501
35
+ id: StrictStr
36
+ created_on: datetime
37
+ name: StrictStr
38
+ short_name: StrictStr
39
+ telescope: Optional[IDNameSchema] = None
40
+ footprints: Optional[List[List[Point]]] = None
41
+ filters: Optional[List[Filter]] = None
42
+ constraints: Optional[List[InstrumentConstraintsInner]] = None
43
+ visibility_type: Optional[VisibilityType] = None
44
+ __properties: ClassVar[List[str]] = ["id", "created_on", "name", "short_name", "telescope", "footprints", "filters", "constraints", "visibility_type"]
45
+
46
+ model_config = ConfigDict(
47
+ populate_by_name=True,
48
+ validate_assignment=True,
49
+ protected_namespaces=(),
50
+ )
51
+
52
+
53
+ def to_str(self) -> str:
54
+ """Returns the string representation of the model using alias"""
55
+ return pprint.pformat(self.model_dump(by_alias=True))
56
+
57
+ def to_json(self) -> str:
58
+ """Returns the JSON representation of the model using alias"""
59
+ # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
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 Instrument 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
+ # override the default output from pydantic by calling `to_dict()` of telescope
86
+ if self.telescope:
87
+ _dict['telescope'] = self.telescope.to_dict()
88
+ # override the default output from pydantic by calling `to_dict()` of each item in footprints (list of list)
89
+ _items = []
90
+ if self.footprints:
91
+ for _item_footprints in self.footprints:
92
+ if _item_footprints:
93
+ _items.append(
94
+ [_inner_item.to_dict() for _inner_item in _item_footprints if _inner_item is not None]
95
+ )
96
+ _dict['footprints'] = _items
97
+ # override the default output from pydantic by calling `to_dict()` of each item in filters (list)
98
+ _items = []
99
+ if self.filters:
100
+ for _item_filters in self.filters:
101
+ if _item_filters:
102
+ _items.append(_item_filters.to_dict())
103
+ _dict['filters'] = _items
104
+ # override the default output from pydantic by calling `to_dict()` of each item in constraints (list)
105
+ _items = []
106
+ if self.constraints:
107
+ for _item_constraints in self.constraints:
108
+ if _item_constraints:
109
+ _items.append(_item_constraints.to_dict())
110
+ _dict['constraints'] = _items
111
+ # set to None if telescope (nullable) is None
112
+ # and model_fields_set contains the field
113
+ if self.telescope is None and "telescope" in self.model_fields_set:
114
+ _dict['telescope'] = None
115
+
116
+ # set to None if footprints (nullable) is None
117
+ # and model_fields_set contains the field
118
+ if self.footprints is None and "footprints" in self.model_fields_set:
119
+ _dict['footprints'] = None
120
+
121
+ # set to None if filters (nullable) is None
122
+ # and model_fields_set contains the field
123
+ if self.filters is None and "filters" in self.model_fields_set:
124
+ _dict['filters'] = None
125
+
126
+ # set to None if constraints (nullable) is None
127
+ # and model_fields_set contains the field
128
+ if self.constraints is None and "constraints" in self.model_fields_set:
129
+ _dict['constraints'] = None
130
+
131
+ # set to None if visibility_type (nullable) is None
132
+ # and model_fields_set contains the field
133
+ if self.visibility_type is None and "visibility_type" in self.model_fields_set:
134
+ _dict['visibility_type'] = None
135
+
136
+ return _dict
137
+
138
+ @classmethod
139
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
140
+ """Create an instance of Instrument from a dict"""
141
+ if obj is None:
142
+ return None
143
+
144
+ if not isinstance(obj, dict):
145
+ return cls.model_validate(obj)
146
+
147
+ _obj = cls.model_validate({
148
+ "id": obj.get("id"),
149
+ "created_on": obj.get("created_on"),
150
+ "name": obj.get("name"),
151
+ "short_name": obj.get("short_name"),
152
+ "telescope": IDNameSchema.from_dict(obj["telescope"]) if obj.get("telescope") is not None else None,
153
+ "footprints": [
154
+ [Point.from_dict(_inner_item) for _inner_item in _item]
155
+ for _item in obj["footprints"]
156
+ ] if obj.get("footprints") is not None else None,
157
+ "filters": [Filter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None,
158
+ "constraints": [InstrumentConstraintsInner.from_dict(_item) for _item in obj["constraints"]] if obj.get("constraints") is not None else None,
159
+ "visibility_type": obj.get("visibility_type")
160
+ })
161
+ return _obj
162
+
163
+
@@ -0,0 +1,237 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 0.3.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 across.sdk.v1.models.alt_az_constraint import AltAzConstraint
21
+ from across.sdk.v1.models.earth_limb_constraint import EarthLimbConstraint
22
+ from across.sdk.v1.models.moon_angle_constraint import MoonAngleConstraint
23
+ from across.sdk.v1.models.saa_polygon_constraint import SAAPolygonConstraint
24
+ from across.sdk.v1.models.sun_angle_constraint import SunAngleConstraint
25
+ from pydantic import StrictStr, Field
26
+ from typing import Union, List, Set, Optional, Dict
27
+ from typing_extensions import Literal, Self
28
+
29
+ INSTRUMENTCONSTRAINTSINNER_ONE_OF_SCHEMAS = ["AltAzConstraint", "EarthLimbConstraint", "MoonAngleConstraint", "SAAPolygonConstraint", "SunAngleConstraint"]
30
+
31
+ class InstrumentConstraintsInner(BaseModel):
32
+ """
33
+ InstrumentConstraintsInner
34
+ """
35
+ # data type: EarthLimbConstraint
36
+ oneof_schema_1_validator: Optional[EarthLimbConstraint] = None
37
+ # data type: MoonAngleConstraint
38
+ oneof_schema_2_validator: Optional[MoonAngleConstraint] = None
39
+ # data type: SunAngleConstraint
40
+ oneof_schema_3_validator: Optional[SunAngleConstraint] = None
41
+ # data type: SAAPolygonConstraint
42
+ oneof_schema_4_validator: Optional[SAAPolygonConstraint] = None
43
+ # data type: AltAzConstraint
44
+ oneof_schema_5_validator: Optional[AltAzConstraint] = None
45
+ actual_instance: Optional[Union[AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint]] = None
46
+ one_of_schemas: Set[str] = { "AltAzConstraint", "EarthLimbConstraint", "MoonAngleConstraint", "SAAPolygonConstraint", "SunAngleConstraint" }
47
+
48
+ model_config = ConfigDict(
49
+ validate_assignment=True,
50
+ protected_namespaces=(),
51
+ )
52
+
53
+
54
+ discriminator_value_class_map: Dict[str, str] = {
55
+ }
56
+
57
+ def __init__(self, *args, **kwargs) -> None:
58
+ if args:
59
+ if len(args) > 1:
60
+ raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
61
+ if kwargs:
62
+ raise ValueError("If a position argument is used, keyword arguments cannot be used.")
63
+ super().__init__(actual_instance=args[0])
64
+ else:
65
+ super().__init__(**kwargs)
66
+
67
+ @field_validator('actual_instance')
68
+ def actual_instance_must_validate_oneof(cls, v):
69
+ instance = InstrumentConstraintsInner.model_construct()
70
+ error_messages = []
71
+ match = 0
72
+ # validate data type: EarthLimbConstraint
73
+ if not isinstance(v, EarthLimbConstraint):
74
+ error_messages.append(f"Error! Input type `{type(v)}` is not `EarthLimbConstraint`")
75
+ else:
76
+ match += 1
77
+ # validate data type: MoonAngleConstraint
78
+ if not isinstance(v, MoonAngleConstraint):
79
+ error_messages.append(f"Error! Input type `{type(v)}` is not `MoonAngleConstraint`")
80
+ else:
81
+ match += 1
82
+ # validate data type: SunAngleConstraint
83
+ if not isinstance(v, SunAngleConstraint):
84
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SunAngleConstraint`")
85
+ else:
86
+ match += 1
87
+ # validate data type: SAAPolygonConstraint
88
+ if not isinstance(v, SAAPolygonConstraint):
89
+ error_messages.append(f"Error! Input type `{type(v)}` is not `SAAPolygonConstraint`")
90
+ else:
91
+ match += 1
92
+ # validate data type: AltAzConstraint
93
+ if not isinstance(v, AltAzConstraint):
94
+ error_messages.append(f"Error! Input type `{type(v)}` is not `AltAzConstraint`")
95
+ else:
96
+ match += 1
97
+ if match > 1:
98
+ # more than 1 match
99
+ raise ValueError("Multiple matches found when setting `actual_instance` in InstrumentConstraintsInner with oneOf schemas: AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint. Details: " + ", ".join(error_messages))
100
+ elif match == 0:
101
+ # no match
102
+ raise ValueError("No match found when setting `actual_instance` in InstrumentConstraintsInner with oneOf schemas: AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint. Details: " + ", ".join(error_messages))
103
+ else:
104
+ return v
105
+
106
+ @classmethod
107
+ def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self:
108
+ return cls.from_json(json.dumps(obj))
109
+
110
+ @classmethod
111
+ def from_json(cls, json_str: str) -> Self:
112
+ """Returns the object represented by the json string"""
113
+ instance = cls.model_construct()
114
+ error_messages = []
115
+ match = 0
116
+
117
+ # use oneOf discriminator to lookup the data type
118
+ _data_type = json.loads(json_str).get("name")
119
+ if not _data_type:
120
+ raise ValueError("Failed to lookup data type from the field `name` in the input.")
121
+
122
+ # check if data type is `AltAzConstraint`
123
+ if _data_type == "Altitude/Azimuth Avoidance":
124
+ instance.actual_instance = AltAzConstraint.from_json(json_str)
125
+ return instance
126
+
127
+ # check if data type is `EarthLimbConstraint`
128
+ if _data_type == "Earth Limb":
129
+ instance.actual_instance = EarthLimbConstraint.from_json(json_str)
130
+ return instance
131
+
132
+ # check if data type is `MoonAngleConstraint`
133
+ if _data_type == "Moon Angle":
134
+ instance.actual_instance = MoonAngleConstraint.from_json(json_str)
135
+ return instance
136
+
137
+ # check if data type is `SAAPolygonConstraint`
138
+ if _data_type == "South Atlantic Anomaly":
139
+ instance.actual_instance = SAAPolygonConstraint.from_json(json_str)
140
+ return instance
141
+
142
+ # check if data type is `SunAngleConstraint`
143
+ if _data_type == "Sun Angle":
144
+ instance.actual_instance = SunAngleConstraint.from_json(json_str)
145
+ return instance
146
+
147
+ # check if data type is `AltAzConstraint`
148
+ if _data_type == "AltAzConstraint":
149
+ instance.actual_instance = AltAzConstraint.from_json(json_str)
150
+ return instance
151
+
152
+ # check if data type is `EarthLimbConstraint`
153
+ if _data_type == "EarthLimbConstraint":
154
+ instance.actual_instance = EarthLimbConstraint.from_json(json_str)
155
+ return instance
156
+
157
+ # check if data type is `MoonAngleConstraint`
158
+ if _data_type == "MoonAngleConstraint":
159
+ instance.actual_instance = MoonAngleConstraint.from_json(json_str)
160
+ return instance
161
+
162
+ # check if data type is `SAAPolygonConstraint`
163
+ if _data_type == "SAAPolygonConstraint":
164
+ instance.actual_instance = SAAPolygonConstraint.from_json(json_str)
165
+ return instance
166
+
167
+ # check if data type is `SunAngleConstraint`
168
+ if _data_type == "SunAngleConstraint":
169
+ instance.actual_instance = SunAngleConstraint.from_json(json_str)
170
+ return instance
171
+
172
+ # deserialize data into EarthLimbConstraint
173
+ try:
174
+ instance.actual_instance = EarthLimbConstraint.from_json(json_str)
175
+ match += 1
176
+ except (ValidationError, ValueError) as e:
177
+ error_messages.append(str(e))
178
+ # deserialize data into MoonAngleConstraint
179
+ try:
180
+ instance.actual_instance = MoonAngleConstraint.from_json(json_str)
181
+ match += 1
182
+ except (ValidationError, ValueError) as e:
183
+ error_messages.append(str(e))
184
+ # deserialize data into SunAngleConstraint
185
+ try:
186
+ instance.actual_instance = SunAngleConstraint.from_json(json_str)
187
+ match += 1
188
+ except (ValidationError, ValueError) as e:
189
+ error_messages.append(str(e))
190
+ # deserialize data into SAAPolygonConstraint
191
+ try:
192
+ instance.actual_instance = SAAPolygonConstraint.from_json(json_str)
193
+ match += 1
194
+ except (ValidationError, ValueError) as e:
195
+ error_messages.append(str(e))
196
+ # deserialize data into AltAzConstraint
197
+ try:
198
+ instance.actual_instance = AltAzConstraint.from_json(json_str)
199
+ match += 1
200
+ except (ValidationError, ValueError) as e:
201
+ error_messages.append(str(e))
202
+
203
+ if match > 1:
204
+ # more than 1 match
205
+ raise ValueError("Multiple matches found when deserializing the JSON string into InstrumentConstraintsInner with oneOf schemas: AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint. Details: " + ", ".join(error_messages))
206
+ elif match == 0:
207
+ # no match
208
+ raise ValueError("No match found when deserializing the JSON string into InstrumentConstraintsInner with oneOf schemas: AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint. Details: " + ", ".join(error_messages))
209
+ else:
210
+ return instance
211
+
212
+ def to_json(self) -> str:
213
+ """Returns the JSON representation of the actual instance"""
214
+ if self.actual_instance is None:
215
+ return "null"
216
+
217
+ if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
218
+ return self.actual_instance.to_json()
219
+ else:
220
+ return json.dumps(self.actual_instance)
221
+
222
+ def to_dict(self) -> Optional[Union[Dict[str, Any], AltAzConstraint, EarthLimbConstraint, MoonAngleConstraint, SAAPolygonConstraint, SunAngleConstraint]]:
223
+ """Returns the dict representation of the actual instance"""
224
+ if self.actual_instance is None:
225
+ return None
226
+
227
+ if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
228
+ return self.actual_instance.to_dict()
229
+ else:
230
+ # primitive type
231
+ return self.actual_instance
232
+
233
+ def to_str(self) -> str:
234
+ """Returns the string representation of the actual instance"""
235
+ return pprint.pformat(self.model_dump())
236
+
237
+