across-server-openapi-python 1.4.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 +48 -19
- across/sdk/v1/api/__init__.py +1 -1
- across/sdk/v1/api/auth_api.py +17 -286
- across/sdk/v1/api/broker_alert_api.py +36 -36
- across/sdk/v1/api/broker_event_api.py +20 -20
- across/sdk/v1/api/filter_api.py +20 -20
- across/sdk/v1/api/group_api.py +25 -275
- across/sdk/v1/api/group_invite_api.py +65 -66
- across/sdk/v1/api/group_role_api.py +111 -112
- across/sdk/v1/api/instrument_api.py +20 -20
- across/sdk/v1/api/internal_api.py +19 -20
- across/sdk/v1/api/observation_api.py +106 -109
- 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/schedule_api.py +84 -86
- across/sdk/v1/api/service_account_api.py +121 -122
- 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 +100 -349
- 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 +24 -10
- 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 +7 -5
- 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_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 +8 -7
- 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 +8 -6
- across/sdk/v1/models/broker_alert_create.py +6 -6
- across/sdk/v1/models/broker_alert_data_source.py +1 -1
- across/sdk/v1/models/broker_alert_status.py +1 -1
- across/sdk/v1/models/broker_event.py +9 -9
- across/sdk/v1/models/broker_event_type.py +1 -1
- 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_base.py +7 -5
- 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_create.py +7 -5
- across/sdk/v1/models/group_role_read.py +8 -7
- 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 +11 -10
- across/sdk/v1/models/localization_contour_base.py +6 -6
- across/sdk/v1/models/localization_create.py +6 -6
- 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 +6 -6
- across/sdk/v1/models/page_broker_event.py +6 -6
- 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_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_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_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.4.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/METADATA +103 -45
- across_server_openapi_python-2.0.0.dist-info/RECORD +162 -0
- {across_server_openapi_python-1.4.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/WHEEL +1 -1
- across_server_openapi_python-1.4.0.dist-info/RECORD +0 -143
- {across_server_openapi_python-1.4.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/licenses/LICENSE +0 -0
- {across_server_openapi_python-1.4.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/top_level.txt +0 -0
|
@@ -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: 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 typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
26
|
+
|
|
27
|
+
class NullableEndDateRange(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
NullableEndDateRange
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
begin: datetime
|
|
32
|
+
end: Optional[datetime] = None
|
|
33
|
+
__properties: ClassVar[List[str]] = ["begin", "end"]
|
|
34
|
+
|
|
35
|
+
model_config = ConfigDict(
|
|
36
|
+
validate_by_name=True,
|
|
37
|
+
validate_by_alias=True,
|
|
38
|
+
validate_assignment=True,
|
|
39
|
+
protected_namespaces=(),
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def to_str(self) -> str:
|
|
44
|
+
"""Returns the string representation of the model using alias"""
|
|
45
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
46
|
+
|
|
47
|
+
def to_json(self) -> str:
|
|
48
|
+
"""Returns the JSON representation of the model using alias"""
|
|
49
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
|
+
|
|
51
|
+
@classmethod
|
|
52
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
53
|
+
"""Create an instance of NullableEndDateRange 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
|
+
# set to None if end (nullable) is None
|
|
75
|
+
# and model_fields_set contains the field
|
|
76
|
+
if self.end is None and "end" in self.model_fields_set:
|
|
77
|
+
_dict['end'] = None
|
|
78
|
+
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of NullableEndDateRange 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
|
+
"begin": obj.get("begin"),
|
|
92
|
+
"end": obj.get("end")
|
|
93
|
+
})
|
|
94
|
+
return _obj
|
|
95
|
+
|
|
96
|
+
|
|
@@ -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,6 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from uuid import UUID
|
|
23
24
|
from across.sdk.v1.models.bandpass import Bandpass
|
|
24
25
|
from across.sdk.v1.models.coordinate import Coordinate
|
|
25
26
|
from across.sdk.v1.models.date_range import DateRange
|
|
@@ -31,12 +32,13 @@ from across.sdk.v1.models.observation_type import ObservationType
|
|
|
31
32
|
from across.sdk.v1.models.unit_value import UnitValue
|
|
32
33
|
from typing import Optional, Set
|
|
33
34
|
from typing_extensions import Self
|
|
35
|
+
from pydantic_core import to_jsonable_python
|
|
34
36
|
|
|
35
37
|
class Observation(BaseModel):
|
|
36
38
|
"""
|
|
37
39
|
Observation
|
|
38
40
|
""" # noqa: E501
|
|
39
|
-
instrument_id:
|
|
41
|
+
instrument_id: UUID
|
|
40
42
|
object_name: StrictStr
|
|
41
43
|
pointing_position: Optional[Coordinate] = None
|
|
42
44
|
date_range: DateRange
|
|
@@ -59,15 +61,16 @@ class Observation(BaseModel):
|
|
|
59
61
|
category: Optional[IVOAObsCategory] = None
|
|
60
62
|
priority: Optional[StrictInt] = None
|
|
61
63
|
tracking_type: Optional[IVOAObsTrackingType] = None
|
|
62
|
-
id:
|
|
63
|
-
schedule_id:
|
|
64
|
+
id: UUID
|
|
65
|
+
schedule_id: UUID
|
|
64
66
|
created_on: datetime
|
|
65
|
-
created_by_id: Optional[
|
|
67
|
+
created_by_id: Optional[UUID] = None
|
|
66
68
|
footprint: Optional[List[ObservationFootprint]] = None
|
|
67
69
|
__properties: ClassVar[List[str]] = ["instrument_id", "object_name", "pointing_position", "date_range", "external_observation_id", "type", "status", "pointing_angle", "exposure_time", "reason", "description", "proposal_reference", "object_position", "depth", "bandpass", "t_resolution", "em_res_power", "o_ucd", "pol_states", "pol_xel", "category", "priority", "tracking_type", "id", "schedule_id", "created_on", "created_by_id", "footprint"]
|
|
68
70
|
|
|
69
71
|
model_config = ConfigDict(
|
|
70
|
-
|
|
72
|
+
validate_by_name=True,
|
|
73
|
+
validate_by_alias=True,
|
|
71
74
|
validate_assignment=True,
|
|
72
75
|
protected_namespaces=(),
|
|
73
76
|
)
|
|
@@ -79,8 +82,7 @@ class Observation(BaseModel):
|
|
|
79
82
|
|
|
80
83
|
def to_json(self) -> str:
|
|
81
84
|
"""Returns the JSON representation of the model using alias"""
|
|
82
|
-
|
|
83
|
-
return json.dumps(self.to_dict())
|
|
85
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
84
86
|
|
|
85
87
|
@classmethod
|
|
86
88
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -124,8 +126,7 @@ class Observation(BaseModel):
|
|
|
124
126
|
_items = []
|
|
125
127
|
if self.footprint:
|
|
126
128
|
for _item_footprint in self.footprint:
|
|
127
|
-
if _item_footprint
|
|
128
|
-
_items.append(_item_footprint.to_dict())
|
|
129
|
+
_items.append(_item_footprint.to_dict() if _item_footprint is not None else None)
|
|
129
130
|
_dict['footprint'] = _items
|
|
130
131
|
# set to None if pointing_position (nullable) is None
|
|
131
132
|
# and model_fields_set contains the field
|
|
@@ -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,6 +20,7 @@ import json
|
|
|
20
20
|
from datetime import datetime
|
|
21
21
|
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
|
|
22
22
|
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from uuid import UUID
|
|
23
24
|
from across.sdk.v1.models.bandpass import Bandpass
|
|
24
25
|
from across.sdk.v1.models.coordinate import Coordinate
|
|
25
26
|
from across.sdk.v1.models.date_range import DateRange
|
|
@@ -31,12 +32,13 @@ from across.sdk.v1.models.observation_type import ObservationType
|
|
|
31
32
|
from across.sdk.v1.models.unit_value import UnitValue
|
|
32
33
|
from typing import Optional, Set
|
|
33
34
|
from typing_extensions import Self
|
|
35
|
+
from pydantic_core import to_jsonable_python
|
|
34
36
|
|
|
35
37
|
class ObservationCreate(BaseModel):
|
|
36
38
|
"""
|
|
37
39
|
ObservationCreate
|
|
38
40
|
""" # noqa: E501
|
|
39
|
-
instrument_id:
|
|
41
|
+
instrument_id: UUID
|
|
40
42
|
object_name: StrictStr
|
|
41
43
|
pointing_position: Optional[Coordinate] = None
|
|
42
44
|
date_range: DateRange
|
|
@@ -60,12 +62,13 @@ class ObservationCreate(BaseModel):
|
|
|
60
62
|
priority: Optional[StrictInt] = None
|
|
61
63
|
tracking_type: Optional[IVOAObsTrackingType] = None
|
|
62
64
|
created_on: Optional[datetime] = None
|
|
63
|
-
created_by_id: Optional[
|
|
65
|
+
created_by_id: Optional[UUID] = None
|
|
64
66
|
footprint: Optional[List[ObservationFootprintCreate]] = None
|
|
65
67
|
__properties: ClassVar[List[str]] = ["instrument_id", "object_name", "pointing_position", "date_range", "external_observation_id", "type", "status", "pointing_angle", "exposure_time", "reason", "description", "proposal_reference", "object_position", "depth", "bandpass", "t_resolution", "em_res_power", "o_ucd", "pol_states", "pol_xel", "category", "priority", "tracking_type", "created_on", "created_by_id", "footprint"]
|
|
66
68
|
|
|
67
69
|
model_config = ConfigDict(
|
|
68
|
-
|
|
70
|
+
validate_by_name=True,
|
|
71
|
+
validate_by_alias=True,
|
|
69
72
|
validate_assignment=True,
|
|
70
73
|
protected_namespaces=(),
|
|
71
74
|
)
|
|
@@ -77,8 +80,7 @@ class ObservationCreate(BaseModel):
|
|
|
77
80
|
|
|
78
81
|
def to_json(self) -> str:
|
|
79
82
|
"""Returns the JSON representation of the model using alias"""
|
|
80
|
-
|
|
81
|
-
return json.dumps(self.to_dict())
|
|
83
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
82
84
|
|
|
83
85
|
@classmethod
|
|
84
86
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -122,8 +124,7 @@ class ObservationCreate(BaseModel):
|
|
|
122
124
|
_items = []
|
|
123
125
|
if self.footprint:
|
|
124
126
|
for _item_footprint in self.footprint:
|
|
125
|
-
if _item_footprint
|
|
126
|
-
_items.append(_item_footprint.to_dict())
|
|
127
|
+
_items.append(_item_footprint.to_dict() if _item_footprint is not None else None)
|
|
127
128
|
_dict['footprint'] = _items
|
|
128
129
|
# set to None if pointing_position (nullable) is None
|
|
129
130
|
# and model_fields_set contains the field
|
|
@@ -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.
|
|
@@ -17,23 +17,26 @@ import pprint
|
|
|
17
17
|
import re # noqa: F401
|
|
18
18
|
import json
|
|
19
19
|
|
|
20
|
-
from pydantic import BaseModel, ConfigDict
|
|
20
|
+
from pydantic import BaseModel, ConfigDict
|
|
21
21
|
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from uuid import UUID
|
|
22
23
|
from across.sdk.v1.models.point import Point
|
|
23
24
|
from typing import Optional, Set
|
|
24
25
|
from typing_extensions import Self
|
|
26
|
+
from pydantic_core import to_jsonable_python
|
|
25
27
|
|
|
26
28
|
class ObservationFootprint(BaseModel):
|
|
27
29
|
"""
|
|
28
30
|
A Pydantic model class representing a created ObservationFootprint Notes ----- Inherits from ObservationFootprintBase Methods ------- from_orm(obj: ObservationFootprintModel) -> ObservationFootprint Static method that instantiates this class from an observation footprint database record
|
|
29
31
|
""" # noqa: E501
|
|
30
32
|
polygon: List[Point]
|
|
31
|
-
id:
|
|
32
|
-
observation_id:
|
|
33
|
+
id: UUID
|
|
34
|
+
observation_id: UUID
|
|
33
35
|
__properties: ClassVar[List[str]] = ["polygon", "id", "observation_id"]
|
|
34
36
|
|
|
35
37
|
model_config = ConfigDict(
|
|
36
|
-
|
|
38
|
+
validate_by_name=True,
|
|
39
|
+
validate_by_alias=True,
|
|
37
40
|
validate_assignment=True,
|
|
38
41
|
protected_namespaces=(),
|
|
39
42
|
)
|
|
@@ -45,8 +48,7 @@ class ObservationFootprint(BaseModel):
|
|
|
45
48
|
|
|
46
49
|
def to_json(self) -> str:
|
|
47
50
|
"""Returns the JSON representation of the model using alias"""
|
|
48
|
-
|
|
49
|
-
return json.dumps(self.to_dict())
|
|
51
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
50
52
|
|
|
51
53
|
@classmethod
|
|
52
54
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -75,8 +77,7 @@ class ObservationFootprint(BaseModel):
|
|
|
75
77
|
_items = []
|
|
76
78
|
if self.polygon:
|
|
77
79
|
for _item_polygon in self.polygon:
|
|
78
|
-
if _item_polygon
|
|
79
|
-
_items.append(_item_polygon.to_dict())
|
|
80
|
+
_items.append(_item_polygon.to_dict() if _item_polygon is not None else None)
|
|
80
81
|
_dict['polygon'] = _items
|
|
81
82
|
return _dict
|
|
82
83
|
|
|
@@ -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.
|
|
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
|
|
|
22
22
|
from across.sdk.v1.models.point import Point
|
|
23
23
|
from typing import Optional, Set
|
|
24
24
|
from typing_extensions import Self
|
|
25
|
+
from pydantic_core import to_jsonable_python
|
|
25
26
|
|
|
26
27
|
class ObservationFootprintCreate(BaseModel):
|
|
27
28
|
"""
|
|
@@ -31,7 +32,8 @@ class ObservationFootprintCreate(BaseModel):
|
|
|
31
32
|
__properties: ClassVar[List[str]] = ["polygon"]
|
|
32
33
|
|
|
33
34
|
model_config = ConfigDict(
|
|
34
|
-
|
|
35
|
+
validate_by_name=True,
|
|
36
|
+
validate_by_alias=True,
|
|
35
37
|
validate_assignment=True,
|
|
36
38
|
protected_namespaces=(),
|
|
37
39
|
)
|
|
@@ -43,8 +45,7 @@ class ObservationFootprintCreate(BaseModel):
|
|
|
43
45
|
|
|
44
46
|
def to_json(self) -> str:
|
|
45
47
|
"""Returns the JSON representation of the model using alias"""
|
|
46
|
-
|
|
47
|
-
return json.dumps(self.to_dict())
|
|
48
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
48
49
|
|
|
49
50
|
@classmethod
|
|
50
51
|
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
@@ -73,8 +74,7 @@ class ObservationFootprintCreate(BaseModel):
|
|
|
73
74
|
_items = []
|
|
74
75
|
if self.polygon:
|
|
75
76
|
for _item_polygon in self.polygon:
|
|
76
|
-
if _item_polygon
|
|
77
|
-
_items.append(_item_polygon.to_dict())
|
|
77
|
+
_items.append(_item_polygon.to_dict() if _item_polygon is not None else None)
|
|
78
78
|
_dict['polygon'] = _items
|
|
79
79
|
return _dict
|
|
80
80
|
|
|
@@ -0,0 +1,202 @@
|
|
|
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, StrictBool, StrictFloat, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from uuid import UUID
|
|
24
|
+
from across.sdk.v1.models.coordinate import Coordinate
|
|
25
|
+
from across.sdk.v1.models.observation_request_status import ObservationRequestStatus
|
|
26
|
+
from across.sdk.v1.models.observation_request_version import ObservationRequestVersion
|
|
27
|
+
from across.sdk.v1.models.observation_window import ObservationWindow
|
|
28
|
+
from across.sdk.v1.models.observing_proposal import ObservingProposal
|
|
29
|
+
from across.sdk.v1.models.proper_motion import ProperMotion
|
|
30
|
+
from across.sdk.v1.models.unit_value import UnitValue
|
|
31
|
+
from typing import Optional, Set
|
|
32
|
+
from typing_extensions import Self
|
|
33
|
+
from pydantic_core import to_jsonable_python
|
|
34
|
+
|
|
35
|
+
class ObservationRequest(BaseModel):
|
|
36
|
+
"""
|
|
37
|
+
ObservationRequest
|
|
38
|
+
""" # noqa: E501
|
|
39
|
+
science_justification: StrictStr
|
|
40
|
+
object_name: StrictStr
|
|
41
|
+
object_coordinates: Coordinate
|
|
42
|
+
object_position_error: Optional[Union[StrictFloat, StrictInt]] = None
|
|
43
|
+
object_brightness: UnitValue
|
|
44
|
+
observation_window: ObservationWindow
|
|
45
|
+
exposure_time: Union[StrictFloat, StrictInt]
|
|
46
|
+
anonymize: StrictBool
|
|
47
|
+
is_too: StrictBool
|
|
48
|
+
instrument_id: UUID
|
|
49
|
+
instrument_configuration: Optional[Dict[str, Any]] = None
|
|
50
|
+
proper_motion: ProperMotion
|
|
51
|
+
id: UUID
|
|
52
|
+
parent_id: UUID
|
|
53
|
+
status: ObservationRequestStatus
|
|
54
|
+
status_reason: Optional[StrictStr]
|
|
55
|
+
proposal: Optional[ObservingProposal] = None
|
|
56
|
+
versions: Optional[List[ObservationRequestVersion]] = None
|
|
57
|
+
created_on: datetime
|
|
58
|
+
created_by_id: Optional[UUID]
|
|
59
|
+
modified_on: Optional[datetime]
|
|
60
|
+
modified_by_id: Optional[UUID]
|
|
61
|
+
submitted_by: Optional[StrictStr]
|
|
62
|
+
__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", "proper_motion", "id", "parent_id", "status", "status_reason", "proposal", "versions", "created_on", "created_by_id", "modified_on", "modified_by_id", "submitted_by"]
|
|
63
|
+
|
|
64
|
+
model_config = ConfigDict(
|
|
65
|
+
validate_by_name=True,
|
|
66
|
+
validate_by_alias=True,
|
|
67
|
+
validate_assignment=True,
|
|
68
|
+
protected_namespaces=(),
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
def to_str(self) -> str:
|
|
73
|
+
"""Returns the string representation of the model using alias"""
|
|
74
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
75
|
+
|
|
76
|
+
def to_json(self) -> str:
|
|
77
|
+
"""Returns the JSON representation of the model using alias"""
|
|
78
|
+
return json.dumps(to_jsonable_python(self.to_dict()))
|
|
79
|
+
|
|
80
|
+
@classmethod
|
|
81
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
82
|
+
"""Create an instance of ObservationRequest from a JSON string"""
|
|
83
|
+
return cls.from_dict(json.loads(json_str))
|
|
84
|
+
|
|
85
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
86
|
+
"""Return the dictionary representation of the model using alias.
|
|
87
|
+
|
|
88
|
+
This has the following differences from calling pydantic's
|
|
89
|
+
`self.model_dump(by_alias=True)`:
|
|
90
|
+
|
|
91
|
+
* `None` is only added to the output dict for nullable fields that
|
|
92
|
+
were set at model initialization. Other fields with value `None`
|
|
93
|
+
are ignored.
|
|
94
|
+
"""
|
|
95
|
+
excluded_fields: Set[str] = set([
|
|
96
|
+
])
|
|
97
|
+
|
|
98
|
+
_dict = self.model_dump(
|
|
99
|
+
by_alias=True,
|
|
100
|
+
exclude=excluded_fields,
|
|
101
|
+
exclude_none=True,
|
|
102
|
+
)
|
|
103
|
+
# override the default output from pydantic by calling `to_dict()` of object_coordinates
|
|
104
|
+
if self.object_coordinates:
|
|
105
|
+
_dict['object_coordinates'] = self.object_coordinates.to_dict()
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of object_brightness
|
|
107
|
+
if self.object_brightness:
|
|
108
|
+
_dict['object_brightness'] = self.object_brightness.to_dict()
|
|
109
|
+
# override the default output from pydantic by calling `to_dict()` of observation_window
|
|
110
|
+
if self.observation_window:
|
|
111
|
+
_dict['observation_window'] = self.observation_window.to_dict()
|
|
112
|
+
# override the default output from pydantic by calling `to_dict()` of proper_motion
|
|
113
|
+
if self.proper_motion:
|
|
114
|
+
_dict['proper_motion'] = self.proper_motion.to_dict()
|
|
115
|
+
# override the default output from pydantic by calling `to_dict()` of proposal
|
|
116
|
+
if self.proposal:
|
|
117
|
+
_dict['proposal'] = self.proposal.to_dict()
|
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of each item in versions (list)
|
|
119
|
+
_items = []
|
|
120
|
+
if self.versions:
|
|
121
|
+
for _item_versions in self.versions:
|
|
122
|
+
_items.append(_item_versions.to_dict() if _item_versions is not None else None)
|
|
123
|
+
_dict['versions'] = _items
|
|
124
|
+
# set to None if object_position_error (nullable) is None
|
|
125
|
+
# and model_fields_set contains the field
|
|
126
|
+
if self.object_position_error is None and "object_position_error" in self.model_fields_set:
|
|
127
|
+
_dict['object_position_error'] = None
|
|
128
|
+
|
|
129
|
+
# set to None if instrument_configuration (nullable) is None
|
|
130
|
+
# and model_fields_set contains the field
|
|
131
|
+
if self.instrument_configuration is None and "instrument_configuration" in self.model_fields_set:
|
|
132
|
+
_dict['instrument_configuration'] = None
|
|
133
|
+
|
|
134
|
+
# set to None if status_reason (nullable) is None
|
|
135
|
+
# and model_fields_set contains the field
|
|
136
|
+
if self.status_reason is None and "status_reason" in self.model_fields_set:
|
|
137
|
+
_dict['status_reason'] = None
|
|
138
|
+
|
|
139
|
+
# set to None if proposal (nullable) is None
|
|
140
|
+
# and model_fields_set contains the field
|
|
141
|
+
if self.proposal is None and "proposal" in self.model_fields_set:
|
|
142
|
+
_dict['proposal'] = None
|
|
143
|
+
|
|
144
|
+
# set to None if created_by_id (nullable) is None
|
|
145
|
+
# and model_fields_set contains the field
|
|
146
|
+
if self.created_by_id is None and "created_by_id" in self.model_fields_set:
|
|
147
|
+
_dict['created_by_id'] = None
|
|
148
|
+
|
|
149
|
+
# set to None if modified_on (nullable) is None
|
|
150
|
+
# and model_fields_set contains the field
|
|
151
|
+
if self.modified_on is None and "modified_on" in self.model_fields_set:
|
|
152
|
+
_dict['modified_on'] = None
|
|
153
|
+
|
|
154
|
+
# set to None if modified_by_id (nullable) is None
|
|
155
|
+
# and model_fields_set contains the field
|
|
156
|
+
if self.modified_by_id is None and "modified_by_id" in self.model_fields_set:
|
|
157
|
+
_dict['modified_by_id'] = None
|
|
158
|
+
|
|
159
|
+
# set to None if submitted_by (nullable) is None
|
|
160
|
+
# and model_fields_set contains the field
|
|
161
|
+
if self.submitted_by is None and "submitted_by" in self.model_fields_set:
|
|
162
|
+
_dict['submitted_by'] = None
|
|
163
|
+
|
|
164
|
+
return _dict
|
|
165
|
+
|
|
166
|
+
@classmethod
|
|
167
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
168
|
+
"""Create an instance of ObservationRequest from a dict"""
|
|
169
|
+
if obj is None:
|
|
170
|
+
return None
|
|
171
|
+
|
|
172
|
+
if not isinstance(obj, dict):
|
|
173
|
+
return cls.model_validate(obj)
|
|
174
|
+
|
|
175
|
+
_obj = cls.model_validate({
|
|
176
|
+
"science_justification": obj.get("science_justification"),
|
|
177
|
+
"object_name": obj.get("object_name"),
|
|
178
|
+
"object_coordinates": Coordinate.from_dict(obj["object_coordinates"]) if obj.get("object_coordinates") is not None else None,
|
|
179
|
+
"object_position_error": obj.get("object_position_error"),
|
|
180
|
+
"object_brightness": UnitValue.from_dict(obj["object_brightness"]) if obj.get("object_brightness") is not None else None,
|
|
181
|
+
"observation_window": ObservationWindow.from_dict(obj["observation_window"]) if obj.get("observation_window") is not None else None,
|
|
182
|
+
"exposure_time": obj.get("exposure_time"),
|
|
183
|
+
"anonymize": obj.get("anonymize"),
|
|
184
|
+
"is_too": obj.get("is_too"),
|
|
185
|
+
"instrument_id": obj.get("instrument_id"),
|
|
186
|
+
"instrument_configuration": obj.get("instrument_configuration"),
|
|
187
|
+
"proper_motion": ProperMotion.from_dict(obj["proper_motion"]) if obj.get("proper_motion") is not None else None,
|
|
188
|
+
"id": obj.get("id"),
|
|
189
|
+
"parent_id": obj.get("parent_id"),
|
|
190
|
+
"status": obj.get("status"),
|
|
191
|
+
"status_reason": obj.get("status_reason"),
|
|
192
|
+
"proposal": ObservingProposal.from_dict(obj["proposal"]) if obj.get("proposal") is not None else None,
|
|
193
|
+
"versions": [ObservationRequestVersion.from_dict(_item) for _item in obj["versions"]] if obj.get("versions") is not None else None,
|
|
194
|
+
"created_on": obj.get("created_on"),
|
|
195
|
+
"created_by_id": obj.get("created_by_id"),
|
|
196
|
+
"modified_on": obj.get("modified_on"),
|
|
197
|
+
"modified_by_id": obj.get("modified_by_id"),
|
|
198
|
+
"submitted_by": obj.get("submitted_by")
|
|
199
|
+
})
|
|
200
|
+
return _obj
|
|
201
|
+
|
|
202
|
+
|