across-server-openapi-python 1.3.0__py3-none-any.whl → 2.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.
- across/sdk/v1/__init__.py +76 -17
- across/sdk/v1/api/__init__.py +3 -1
- across/sdk/v1/api/auth_api.py +17 -286
- across/sdk/v1/api/broker_alert_api.py +1017 -0
- across/sdk/v1/api/broker_event_api.py +697 -0
- across/sdk/v1/api/filter_api.py +20 -20
- across/sdk/v1/api/group_api.py +31 -281
- across/sdk/v1/api/group_invite_api.py +65 -66
- across/sdk/v1/api/group_role_api.py +105 -106
- across/sdk/v1/api/instrument_api.py +20 -20
- across/sdk/v1/api/internal_api.py +20 -21
- across/sdk/v1/api/observation_api.py +762 -135
- across/sdk/v1/api/observation_request_api.py +2108 -0
- across/sdk/v1/api/observatory_api.py +24 -25
- across/sdk/v1/api/permission_api.py +5 -6
- across/sdk/v1/api/role_api.py +1 -1
- across/sdk/v1/api/schedule_api.py +84 -86
- across/sdk/v1/api/service_account_api.py +125 -126
- across/sdk/v1/api/telescope_api.py +26 -26
- across/sdk/v1/api/tle_api.py +7 -8
- across/sdk/v1/api/tools_api.py +55 -55
- across/sdk/v1/api/user_api.py +84 -333
- across/sdk/v1/api_client.py +111 -47
- across/sdk/v1/configuration.py +106 -33
- across/sdk/v1/exceptions.py +8 -6
- across/sdk/v1/models/__init__.py +36 -9
- across/sdk/v1/models/access_token_response.py +5 -4
- across/sdk/v1/models/across_server_routes_v1_group_invite_schemas_group_invite.py +106 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group.py +93 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group_role.py +20 -15
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_service_account.py +107 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_user.py +7 -5
- across/sdk/v1/models/across_server_routes_v1_group_schemas_group.py +12 -12
- across/sdk/v1/models/across_server_routes_v1_group_schemas_user.py +8 -7
- across/sdk/v1/models/across_server_routes_v1_role_schemas_user.py +95 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group.py +11 -10
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group_invite.py +8 -6
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group_role.py +106 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_user.py +14 -16
- across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account.py +8 -7
- across/sdk/v1/models/bandpass.py +1 -1
- across/sdk/v1/models/bandpass_type.py +1 -1
- across/sdk/v1/models/broker_alert.py +106 -0
- across/sdk/v1/models/broker_alert_create.py +115 -0
- across/sdk/v1/models/broker_alert_data_source.py +39 -0
- across/sdk/v1/models/broker_alert_status.py +41 -0
- across/sdk/v1/models/broker_event.py +115 -0
- across/sdk/v1/models/broker_event_type.py +41 -0
- across/sdk/v1/models/constrained_date.py +8 -6
- across/sdk/v1/models/constraint_reason.py +5 -4
- across/sdk/v1/models/constraint_type.py +1 -1
- across/sdk/v1/models/coordinate.py +5 -4
- across/sdk/v1/models/date_range.py +5 -4
- across/sdk/v1/models/date_range_create.py +96 -0
- across/sdk/v1/models/depth_unit.py +1 -1
- across/sdk/v1/models/energy_bandpass.py +5 -4
- across/sdk/v1/models/energy_unit.py +1 -1
- across/sdk/v1/models/ephemeris_type.py +1 -1
- across/sdk/v1/models/filter.py +8 -6
- across/sdk/v1/models/frequency_bandpass.py +5 -4
- across/sdk/v1/models/frequency_unit.py +1 -1
- across/sdk/v1/models/grant_type.py +1 -1
- across/sdk/v1/models/ground_parameters.py +5 -4
- across/sdk/v1/models/group.py +5 -15
- across/sdk/v1/models/group_base.py +93 -0
- across/sdk/v1/models/group_invite.py +1 -1
- across/sdk/v1/models/group_invite_create.py +5 -4
- across/sdk/v1/models/group_invite_group_details.py +7 -5
- across/sdk/v1/models/group_read.py +7 -5
- across/sdk/v1/models/group_role.py +37 -6
- across/sdk/v1/models/group_role_create.py +7 -5
- across/sdk/v1/models/group_role_read.py +16 -9
- across/sdk/v1/models/http_validation_error.py +6 -6
- across/sdk/v1/models/id_name_schema.py +7 -5
- across/sdk/v1/models/instrument.py +31 -15
- across/sdk/v1/models/ivoa_obs_category.py +1 -1
- across/sdk/v1/models/ivoa_obs_tracking_type.py +1 -1
- across/sdk/v1/models/joint_visibility_result.py +23 -23
- across/sdk/v1/models/jpl_parameters.py +5 -4
- across/sdk/v1/models/localization.py +128 -0
- across/sdk/v1/models/localization_contour_base.py +95 -0
- across/sdk/v1/models/localization_create.py +121 -0
- across/sdk/v1/models/location_inner.py +1 -1
- across/sdk/v1/models/name_resolver.py +5 -4
- across/sdk/v1/models/nullable_date_range.py +5 -4
- across/sdk/v1/models/nullable_end_date_range.py +96 -0
- across/sdk/v1/models/observation.py +11 -10
- across/sdk/v1/models/observation_create.py +9 -8
- across/sdk/v1/models/observation_footprint.py +10 -9
- across/sdk/v1/models/observation_footprint_create.py +6 -6
- across/sdk/v1/models/observation_request.py +202 -0
- across/sdk/v1/models/observation_request_create.py +148 -0
- across/sdk/v1/models/observation_request_create_many.py +95 -0
- across/sdk/v1/models/observation_request_status.py +40 -0
- across/sdk/v1/models/observation_request_update.py +213 -0
- across/sdk/v1/models/observation_request_version.py +99 -0
- across/sdk/v1/models/observation_status.py +1 -1
- across/sdk/v1/models/observation_strategy.py +1 -1
- across/sdk/v1/models/observation_type.py +1 -1
- across/sdk/v1/models/observation_window.py +134 -0
- across/sdk/v1/models/observation_window1.py +140 -0
- across/sdk/v1/models/observatory.py +9 -9
- across/sdk/v1/models/observatory_ephemeris_type.py +5 -4
- across/sdk/v1/models/observatory_type.py +1 -1
- across/sdk/v1/models/observing_proposal.py +93 -0
- across/sdk/v1/models/observing_proposal_create.py +98 -0
- across/sdk/v1/models/page_broker_alert.py +116 -0
- across/sdk/v1/models/page_broker_event.py +116 -0
- across/sdk/v1/models/page_observation.py +6 -6
- across/sdk/v1/models/page_observation_request.py +116 -0
- across/sdk/v1/models/page_schedule.py +6 -6
- across/sdk/v1/models/parameters.py +1 -1
- across/sdk/v1/models/permission.py +7 -5
- across/sdk/v1/models/point.py +5 -4
- across/sdk/v1/models/proper_motion.py +93 -0
- across/sdk/v1/models/role.py +4 -4
- across/sdk/v1/models/role_base.py +7 -5
- across/sdk/v1/models/schedule.py +10 -9
- across/sdk/v1/models/schedule_cadence.py +8 -6
- across/sdk/v1/models/schedule_create.py +8 -7
- across/sdk/v1/models/schedule_create_many.py +9 -8
- across/sdk/v1/models/schedule_fidelity.py +1 -1
- across/sdk/v1/models/schedule_status.py +1 -1
- across/sdk/v1/models/service_account.py +1 -1
- across/sdk/v1/models/service_account_create.py +5 -4
- across/sdk/v1/models/service_account_secret.py +7 -5
- across/sdk/v1/models/service_account_update.py +5 -4
- across/sdk/v1/models/setting.py +100 -0
- across/sdk/v1/models/setting_type.py +39 -0
- across/sdk/v1/models/spice_parameters.py +5 -4
- across/sdk/v1/models/system_service_account.py +9 -9
- across/sdk/v1/models/telescope.py +9 -9
- across/sdk/v1/models/telescope_instrument.py +31 -15
- across/sdk/v1/models/tle.py +5 -4
- across/sdk/v1/models/tle_create.py +5 -4
- across/sdk/v1/models/tle_parameters.py +5 -4
- across/sdk/v1/models/unit_value.py +5 -4
- across/sdk/v1/models/user.py +47 -7
- across/sdk/v1/models/user_create.py +5 -4
- across/sdk/v1/models/user_info.py +7 -5
- across/sdk/v1/models/user_update.py +5 -4
- across/sdk/v1/models/validation_error.py +21 -12
- across/sdk/v1/models/validation_error_loc_inner.py +1 -1
- across/sdk/v1/models/visibility_result.py +14 -11
- across/sdk/v1/models/visibility_type.py +1 -1
- across/sdk/v1/models/visibility_window.py +5 -4
- across/sdk/v1/models/wavelength_bandpass.py +5 -4
- across/sdk/v1/models/wavelength_unit.py +1 -1
- across/sdk/v1/models/window.py +5 -4
- across/sdk/v1/rest.py +88 -12
- {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/METADATA +122 -45
- across_server_openapi_python-2.0.0.dist-info/RECORD +162 -0
- {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/WHEEL +1 -1
- across_server_openapi_python-1.3.0.dist-info/RECORD +0 -126
- {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/licenses/LICENSE +0 -0
- {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,213 @@
|
|
|
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: 2.0.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, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from uuid import UUID
|
|
23
|
+
from across.sdk.v1.models.coordinate import Coordinate
|
|
24
|
+
from across.sdk.v1.models.observation_request_status import ObservationRequestStatus
|
|
25
|
+
from across.sdk.v1.models.observation_window1 import ObservationWindow1
|
|
26
|
+
from across.sdk.v1.models.observing_proposal_create import ObservingProposalCreate
|
|
27
|
+
from across.sdk.v1.models.proper_motion import ProperMotion
|
|
28
|
+
from across.sdk.v1.models.unit_value import UnitValue
|
|
29
|
+
from typing import Optional, Set
|
|
30
|
+
from typing_extensions import Self
|
|
31
|
+
from pydantic_core import to_jsonable_python
|
|
32
|
+
|
|
33
|
+
class ObservationRequestUpdate(BaseModel):
|
|
34
|
+
"""
|
|
35
|
+
ObservationRequestUpdate
|
|
36
|
+
""" # noqa: E501
|
|
37
|
+
science_justification: Optional[StrictStr] = None
|
|
38
|
+
object_name: Optional[StrictStr] = None
|
|
39
|
+
object_coordinates: Optional[Coordinate] = None
|
|
40
|
+
object_position_error: Optional[Union[StrictFloat, StrictInt]] = None
|
|
41
|
+
object_brightness: Optional[UnitValue] = None
|
|
42
|
+
observation_window: Optional[ObservationWindow1] = None
|
|
43
|
+
exposure_time: Optional[Union[StrictFloat, StrictInt]] = None
|
|
44
|
+
anonymize: Optional[StrictBool] = None
|
|
45
|
+
is_too: Optional[StrictBool] = None
|
|
46
|
+
instrument_id: Optional[UUID] = None
|
|
47
|
+
instrument_configuration: Optional[Dict[str, Any]] = None
|
|
48
|
+
status: Optional[ObservationRequestStatus] = None
|
|
49
|
+
status_reason: Optional[StrictStr] = None
|
|
50
|
+
proposal: Optional[ObservingProposalCreate] = None
|
|
51
|
+
proper_motion: Optional[ProperMotion] = None
|
|
52
|
+
__properties: ClassVar[List[str]] = ["science_justification", "object_name", "object_coordinates", "object_position_error", "object_brightness", "observation_window", "exposure_time", "anonymize", "is_too", "instrument_id", "instrument_configuration", "status", "status_reason", "proposal", "proper_motion"]
|
|
53
|
+
|
|
54
|
+
model_config = ConfigDict(
|
|
55
|
+
validate_by_name=True,
|
|
56
|
+
validate_by_alias=True,
|
|
57
|
+
validate_assignment=True,
|
|
58
|
+
protected_namespaces=(),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
def to_str(self) -> str:
|
|
63
|
+
"""Returns the string representation of the model using alias"""
|
|
64
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
65
|
+
|
|
66
|
+
def to_json(self) -> str:
|
|
67
|
+
"""Returns the JSON representation of the model using alias"""
|
|
68
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
69
|
+
|
|
70
|
+
@classmethod
|
|
71
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
72
|
+
"""Create an instance of ObservationRequestUpdate from a JSON string"""
|
|
73
|
+
return cls.from_dict(json.loads(json_str))
|
|
74
|
+
|
|
75
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
76
|
+
"""Return the dictionary representation of the model using alias.
|
|
77
|
+
|
|
78
|
+
This has the following differences from calling pydantic's
|
|
79
|
+
`self.model_dump(by_alias=True)`:
|
|
80
|
+
|
|
81
|
+
* `None` is only added to the output dict for nullable fields that
|
|
82
|
+
were set at model initialization. Other fields with value `None`
|
|
83
|
+
are ignored.
|
|
84
|
+
"""
|
|
85
|
+
excluded_fields: Set[str] = set([
|
|
86
|
+
])
|
|
87
|
+
|
|
88
|
+
_dict = self.model_dump(
|
|
89
|
+
by_alias=True,
|
|
90
|
+
exclude=excluded_fields,
|
|
91
|
+
exclude_none=True,
|
|
92
|
+
)
|
|
93
|
+
# override the default output from pydantic by calling `to_dict()` of object_coordinates
|
|
94
|
+
if self.object_coordinates:
|
|
95
|
+
_dict['object_coordinates'] = self.object_coordinates.to_dict()
|
|
96
|
+
# override the default output from pydantic by calling `to_dict()` of object_brightness
|
|
97
|
+
if self.object_brightness:
|
|
98
|
+
_dict['object_brightness'] = self.object_brightness.to_dict()
|
|
99
|
+
# override the default output from pydantic by calling `to_dict()` of observation_window
|
|
100
|
+
if self.observation_window:
|
|
101
|
+
_dict['observation_window'] = self.observation_window.to_dict()
|
|
102
|
+
# override the default output from pydantic by calling `to_dict()` of proposal
|
|
103
|
+
if self.proposal:
|
|
104
|
+
_dict['proposal'] = self.proposal.to_dict()
|
|
105
|
+
# override the default output from pydantic by calling `to_dict()` of proper_motion
|
|
106
|
+
if self.proper_motion:
|
|
107
|
+
_dict['proper_motion'] = self.proper_motion.to_dict()
|
|
108
|
+
# set to None if science_justification (nullable) is None
|
|
109
|
+
# and model_fields_set contains the field
|
|
110
|
+
if self.science_justification is None and "science_justification" in self.model_fields_set:
|
|
111
|
+
_dict['science_justification'] = None
|
|
112
|
+
|
|
113
|
+
# set to None if object_name (nullable) is None
|
|
114
|
+
# and model_fields_set contains the field
|
|
115
|
+
if self.object_name is None and "object_name" in self.model_fields_set:
|
|
116
|
+
_dict['object_name'] = None
|
|
117
|
+
|
|
118
|
+
# set to None if object_coordinates (nullable) is None
|
|
119
|
+
# and model_fields_set contains the field
|
|
120
|
+
if self.object_coordinates is None and "object_coordinates" in self.model_fields_set:
|
|
121
|
+
_dict['object_coordinates'] = None
|
|
122
|
+
|
|
123
|
+
# set to None if object_position_error (nullable) is None
|
|
124
|
+
# and model_fields_set contains the field
|
|
125
|
+
if self.object_position_error is None and "object_position_error" in self.model_fields_set:
|
|
126
|
+
_dict['object_position_error'] = None
|
|
127
|
+
|
|
128
|
+
# set to None if object_brightness (nullable) is None
|
|
129
|
+
# and model_fields_set contains the field
|
|
130
|
+
if self.object_brightness is None and "object_brightness" in self.model_fields_set:
|
|
131
|
+
_dict['object_brightness'] = None
|
|
132
|
+
|
|
133
|
+
# set to None if observation_window (nullable) is None
|
|
134
|
+
# and model_fields_set contains the field
|
|
135
|
+
if self.observation_window is None and "observation_window" in self.model_fields_set:
|
|
136
|
+
_dict['observation_window'] = None
|
|
137
|
+
|
|
138
|
+
# set to None if exposure_time (nullable) is None
|
|
139
|
+
# and model_fields_set contains the field
|
|
140
|
+
if self.exposure_time is None and "exposure_time" in self.model_fields_set:
|
|
141
|
+
_dict['exposure_time'] = None
|
|
142
|
+
|
|
143
|
+
# set to None if anonymize (nullable) is None
|
|
144
|
+
# and model_fields_set contains the field
|
|
145
|
+
if self.anonymize is None and "anonymize" in self.model_fields_set:
|
|
146
|
+
_dict['anonymize'] = None
|
|
147
|
+
|
|
148
|
+
# set to None if is_too (nullable) is None
|
|
149
|
+
# and model_fields_set contains the field
|
|
150
|
+
if self.is_too is None and "is_too" in self.model_fields_set:
|
|
151
|
+
_dict['is_too'] = None
|
|
152
|
+
|
|
153
|
+
# set to None if instrument_id (nullable) is None
|
|
154
|
+
# and model_fields_set contains the field
|
|
155
|
+
if self.instrument_id is None and "instrument_id" in self.model_fields_set:
|
|
156
|
+
_dict['instrument_id'] = None
|
|
157
|
+
|
|
158
|
+
# set to None if instrument_configuration (nullable) is None
|
|
159
|
+
# and model_fields_set contains the field
|
|
160
|
+
if self.instrument_configuration is None and "instrument_configuration" in self.model_fields_set:
|
|
161
|
+
_dict['instrument_configuration'] = None
|
|
162
|
+
|
|
163
|
+
# set to None if status (nullable) is None
|
|
164
|
+
# and model_fields_set contains the field
|
|
165
|
+
if self.status is None and "status" in self.model_fields_set:
|
|
166
|
+
_dict['status'] = None
|
|
167
|
+
|
|
168
|
+
# set to None if status_reason (nullable) is None
|
|
169
|
+
# and model_fields_set contains the field
|
|
170
|
+
if self.status_reason is None and "status_reason" in self.model_fields_set:
|
|
171
|
+
_dict['status_reason'] = None
|
|
172
|
+
|
|
173
|
+
# set to None if proposal (nullable) is None
|
|
174
|
+
# and model_fields_set contains the field
|
|
175
|
+
if self.proposal is None and "proposal" in self.model_fields_set:
|
|
176
|
+
_dict['proposal'] = None
|
|
177
|
+
|
|
178
|
+
# set to None if proper_motion (nullable) is None
|
|
179
|
+
# and model_fields_set contains the field
|
|
180
|
+
if self.proper_motion is None and "proper_motion" in self.model_fields_set:
|
|
181
|
+
_dict['proper_motion'] = None
|
|
182
|
+
|
|
183
|
+
return _dict
|
|
184
|
+
|
|
185
|
+
@classmethod
|
|
186
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
187
|
+
"""Create an instance of ObservationRequestUpdate from a dict"""
|
|
188
|
+
if obj is None:
|
|
189
|
+
return None
|
|
190
|
+
|
|
191
|
+
if not isinstance(obj, dict):
|
|
192
|
+
return cls.model_validate(obj)
|
|
193
|
+
|
|
194
|
+
_obj = cls.model_validate({
|
|
195
|
+
"science_justification": obj.get("science_justification"),
|
|
196
|
+
"object_name": obj.get("object_name"),
|
|
197
|
+
"object_coordinates": Coordinate.from_dict(obj["object_coordinates"]) if obj.get("object_coordinates") is not None else None,
|
|
198
|
+
"object_position_error": obj.get("object_position_error"),
|
|
199
|
+
"object_brightness": UnitValue.from_dict(obj["object_brightness"]) if obj.get("object_brightness") is not None else None,
|
|
200
|
+
"observation_window": ObservationWindow1.from_dict(obj["observation_window"]) if obj.get("observation_window") is not None else None,
|
|
201
|
+
"exposure_time": obj.get("exposure_time"),
|
|
202
|
+
"anonymize": obj.get("anonymize"),
|
|
203
|
+
"is_too": obj.get("is_too"),
|
|
204
|
+
"instrument_id": obj.get("instrument_id"),
|
|
205
|
+
"instrument_configuration": obj.get("instrument_configuration"),
|
|
206
|
+
"status": obj.get("status"),
|
|
207
|
+
"status_reason": obj.get("status_reason"),
|
|
208
|
+
"proposal": ObservingProposalCreate.from_dict(obj["proposal"]) if obj.get("proposal") is not None else None,
|
|
209
|
+
"proper_motion": ProperMotion.from_dict(obj["proper_motion"]) if obj.get("proper_motion") is not None else None
|
|
210
|
+
})
|
|
211
|
+
return _obj
|
|
212
|
+
|
|
213
|
+
|
|
@@ -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: 2.0.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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from uuid import UUID
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
27
|
+
|
|
28
|
+
class ObservationRequestVersion(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
ObservationRequestVersion
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: UUID
|
|
33
|
+
created_on: datetime
|
|
34
|
+
modified_on: Optional[datetime]
|
|
35
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "modified_on"]
|
|
36
|
+
|
|
37
|
+
model_config = ConfigDict(
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
40
|
+
validate_assignment=True,
|
|
41
|
+
protected_namespaces=(),
|
|
42
|
+
)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
def to_str(self) -> str:
|
|
46
|
+
"""Returns the string representation of the model using alias"""
|
|
47
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
48
|
+
|
|
49
|
+
def to_json(self) -> str:
|
|
50
|
+
"""Returns the JSON representation of the model using alias"""
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
52
|
+
|
|
53
|
+
@classmethod
|
|
54
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
+
"""Create an instance of ObservationRequestVersion 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
|
+
# set to None if modified_on (nullable) is None
|
|
77
|
+
# and model_fields_set contains the field
|
|
78
|
+
if self.modified_on is None and "modified_on" in self.model_fields_set:
|
|
79
|
+
_dict['modified_on'] = None
|
|
80
|
+
|
|
81
|
+
return _dict
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of ObservationRequestVersion 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
|
+
"id": obj.get("id"),
|
|
94
|
+
"created_on": obj.get("created_on"),
|
|
95
|
+
"modified_on": obj.get("modified_on")
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 2.0.2
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 2.0.2
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 2.0.2
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -0,0 +1,134 @@
|
|
|
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: 2.0.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 across.sdk.v1.models.date_range_create import DateRangeCreate
|
|
23
|
+
from across.sdk.v1.models.nullable_end_date_range import NullableEndDateRange
|
|
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
|
+
OBSERVATIONWINDOW_ANY_OF_SCHEMAS = ["DateRangeCreate", "NullableEndDateRange"]
|
|
29
|
+
|
|
30
|
+
class ObservationWindow(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
ObservationWindow
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
# data type: NullableEndDateRange
|
|
36
|
+
anyof_schema_1_validator: Optional[NullableEndDateRange] = None
|
|
37
|
+
# data type: DateRangeCreate
|
|
38
|
+
anyof_schema_2_validator: Optional[DateRangeCreate] = None
|
|
39
|
+
if TYPE_CHECKING:
|
|
40
|
+
actual_instance: Optional[Union[DateRangeCreate, NullableEndDateRange]] = None
|
|
41
|
+
else:
|
|
42
|
+
actual_instance: Any = None
|
|
43
|
+
any_of_schemas: Set[str] = { "DateRangeCreate", "NullableEndDateRange" }
|
|
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 = ObservationWindow.model_construct()
|
|
63
|
+
error_messages = []
|
|
64
|
+
# validate data type: NullableEndDateRange
|
|
65
|
+
if not isinstance(v, NullableEndDateRange):
|
|
66
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullableEndDateRange`")
|
|
67
|
+
else:
|
|
68
|
+
return v
|
|
69
|
+
|
|
70
|
+
# validate data type: DateRangeCreate
|
|
71
|
+
if not isinstance(v, DateRangeCreate):
|
|
72
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `DateRangeCreate`")
|
|
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 ObservationWindow with anyOf schemas: DateRangeCreate, NullableEndDateRange. 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[NullableEndDateRange] = None
|
|
92
|
+
try:
|
|
93
|
+
instance.actual_instance = NullableEndDateRange.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[DateRangeCreate] = None
|
|
98
|
+
try:
|
|
99
|
+
instance.actual_instance = DateRangeCreate.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 ObservationWindow with anyOf schemas: DateRangeCreate, NullableEndDateRange. 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], DateRangeCreate, NullableEndDateRange]]:
|
|
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,140 @@
|
|
|
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: 2.0.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 across.sdk.v1.models.date_range_create import DateRangeCreate
|
|
23
|
+
from across.sdk.v1.models.nullable_end_date_range import NullableEndDateRange
|
|
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
|
+
OBSERVATIONWINDOW1_ANY_OF_SCHEMAS = ["DateRangeCreate", "NullableEndDateRange"]
|
|
29
|
+
|
|
30
|
+
class ObservationWindow1(BaseModel):
|
|
31
|
+
"""
|
|
32
|
+
ObservationWindow1
|
|
33
|
+
"""
|
|
34
|
+
|
|
35
|
+
# data type: NullableEndDateRange
|
|
36
|
+
anyof_schema_1_validator: Optional[NullableEndDateRange] = None
|
|
37
|
+
# data type: DateRangeCreate
|
|
38
|
+
anyof_schema_2_validator: Optional[DateRangeCreate] = None
|
|
39
|
+
if TYPE_CHECKING:
|
|
40
|
+
actual_instance: Optional[Union[DateRangeCreate, NullableEndDateRange]] = None
|
|
41
|
+
else:
|
|
42
|
+
actual_instance: Any = None
|
|
43
|
+
any_of_schemas: Set[str] = { "DateRangeCreate", "NullableEndDateRange" }
|
|
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 = ObservationWindow1.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
# validate data type: NullableEndDateRange
|
|
68
|
+
if not isinstance(v, NullableEndDateRange):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `NullableEndDateRange`")
|
|
70
|
+
else:
|
|
71
|
+
return v
|
|
72
|
+
|
|
73
|
+
# validate data type: DateRangeCreate
|
|
74
|
+
if not isinstance(v, DateRangeCreate):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `DateRangeCreate`")
|
|
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 ObservationWindow1 with anyOf schemas: DateRangeCreate, NullableEndDateRange. 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[NullableEndDateRange] = None
|
|
98
|
+
try:
|
|
99
|
+
instance.actual_instance = NullableEndDateRange.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[DateRangeCreate] = None
|
|
104
|
+
try:
|
|
105
|
+
instance.actual_instance = DateRangeCreate.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 ObservationWindow1 with anyOf schemas: DateRangeCreate, NullableEndDateRange. 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], DateRangeCreate, NullableEndDateRange]]:
|
|
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
|
+
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
7
|
|
|
8
|
-
The version of the OpenAPI document:
|
|
8
|
+
The version of the OpenAPI document: 2.0.2
|
|
9
9
|
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
10
|
|
|
11
11
|
Do not edit the class manually.
|
|
@@ -20,18 +20,20 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from uuid import UUID
|
|
23
24
|
from across.sdk.v1.models.id_name_schema import IDNameSchema
|
|
24
25
|
from across.sdk.v1.models.nullable_date_range import NullableDateRange
|
|
25
26
|
from across.sdk.v1.models.observatory_ephemeris_type import ObservatoryEphemerisType
|
|
26
27
|
from across.sdk.v1.models.observatory_type import ObservatoryType
|
|
27
28
|
from typing import Optional, Set
|
|
28
29
|
from typing_extensions import Self
|
|
30
|
+
from pydantic_core import to_jsonable_python
|
|
29
31
|
|
|
30
32
|
class Observatory(BaseModel):
|
|
31
33
|
"""
|
|
32
34
|
A Pydantic model class representing a created observatory Notes ----- Inherits from ObservatoryBase
|
|
33
35
|
""" # noqa: E501
|
|
34
|
-
id:
|
|
36
|
+
id: UUID
|
|
35
37
|
created_on: datetime
|
|
36
38
|
name: StrictStr
|
|
37
39
|
short_name: StrictStr
|
|
@@ -43,7 +45,8 @@ class Observatory(BaseModel):
|
|
|
43
45
|
__properties: ClassVar[List[str]] = ["id", "created_on", "name", "short_name", "type", "telescopes", "ephemeris_types", "reference_url", "operational"]
|
|
44
46
|
|
|
45
47
|
model_config = ConfigDict(
|
|
46
|
-
|
|
48
|
+
validate_by_name=True,
|
|
49
|
+
validate_by_alias=True,
|
|
47
50
|
validate_assignment=True,
|
|
48
51
|
protected_namespaces=(),
|
|
49
52
|
)
|
|
@@ -55,8 +58,7 @@ class Observatory(BaseModel):
|
|
|
55
58
|
|
|
56
59
|
def to_json(self) -> str:
|
|
57
60
|
"""Returns the JSON representation of the model using alias"""
|
|
58
|
-
|
|
59
|
-
return json.dumps(self.to_dict())
|
|
61
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
60
62
|
|
|
61
63
|
@classmethod
|
|
62
64
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -85,15 +87,13 @@ class Observatory(BaseModel):
|
|
|
85
87
|
_items = []
|
|
86
88
|
if self.telescopes:
|
|
87
89
|
for _item_telescopes in self.telescopes:
|
|
88
|
-
if _item_telescopes
|
|
89
|
-
_items.append(_item_telescopes.to_dict())
|
|
90
|
+
_items.append(_item_telescopes.to_dict() if _item_telescopes is not None else None)
|
|
90
91
|
_dict['telescopes'] = _items
|
|
91
92
|
# override the default output from pydantic by calling `to_dict()` of each item in ephemeris_types (list)
|
|
92
93
|
_items = []
|
|
93
94
|
if self.ephemeris_types:
|
|
94
95
|
for _item_ephemeris_types in self.ephemeris_types:
|
|
95
|
-
if _item_ephemeris_types
|
|
96
|
-
_items.append(_item_ephemeris_types.to_dict())
|
|
96
|
+
_items.append(_item_ephemeris_types.to_dict() if _item_ephemeris_types is not None else None)
|
|
97
97
|
_dict['ephemeris_types'] = _items
|
|
98
98
|
# override the default output from pydantic by calling `to_dict()` of operational
|
|
99
99
|
if self.operational:
|