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.
- across/__init__.py +0 -0
- across/sdk/__init__.py +0 -0
- across/sdk/v1/__init__.py +251 -0
- across/sdk/v1/abstract_credential_storage.py +16 -0
- across/sdk/v1/api/__init__.py +20 -0
- across/sdk/v1/api/auth_api.py +1097 -0
- across/sdk/v1/api/filter_api.py +623 -0
- across/sdk/v1/api/group_api.py +586 -0
- across/sdk/v1/api/group_invite_api.py +1165 -0
- across/sdk/v1/api/group_role_api.py +2070 -0
- across/sdk/v1/api/instrument_api.py +633 -0
- across/sdk/v1/api/internal_api.py +571 -0
- across/sdk/v1/api/observation_api.py +940 -0
- across/sdk/v1/api/observatory_api.py +670 -0
- across/sdk/v1/api/permission_api.py +285 -0
- across/sdk/v1/api/role_api.py +552 -0
- across/sdk/v1/api/schedule_api.py +1914 -0
- across/sdk/v1/api/service_account_api.py +2353 -0
- across/sdk/v1/api/telescope_api.py +667 -0
- across/sdk/v1/api/tle_api.py +317 -0
- across/sdk/v1/api/tools_api.py +812 -0
- across/sdk/v1/api/user_api.py +2263 -0
- across/sdk/v1/api_client.py +801 -0
- across/sdk/v1/api_client_wrapper.py +239 -0
- across/sdk/v1/api_response.py +21 -0
- across/sdk/v1/configuration.py +605 -0
- across/sdk/v1/exceptions.py +216 -0
- across/sdk/v1/models/__init__.py +103 -0
- across/sdk/v1/models/access_token_response.py +89 -0
- across/sdk/v1/models/across_server_routes_v1_group_invite_schemas_group_invite.py +104 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group_role.py +124 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_service_account.py +106 -0
- across/sdk/v1/models/across_server_routes_v1_group_role_schemas_user.py +95 -0
- across/sdk/v1/models/across_server_routes_v1_group_schemas_group.py +111 -0
- across/sdk/v1/models/across_server_routes_v1_group_schemas_user.py +105 -0
- across/sdk/v1/models/across_server_routes_v1_role_schemas_user.py +96 -0
- across/sdk/v1/models/across_server_routes_v1_system_service_account_schemas_service_account.py +90 -0
- across/sdk/v1/models/across_server_routes_v1_system_service_account_schemas_service_account_secret.py +92 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group.py +101 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group_invite.py +99 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_group_role.py +99 -0
- across/sdk/v1/models/across_server_routes_v1_user_schemas_user.py +135 -0
- across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account.py +111 -0
- across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account_secret.py +118 -0
- across/sdk/v1/models/alt_az_constraint.py +130 -0
- across/sdk/v1/models/bandpass.py +149 -0
- across/sdk/v1/models/bandpass_type.py +155 -0
- across/sdk/v1/models/constrained_date.py +93 -0
- across/sdk/v1/models/constraint_reason.py +89 -0
- across/sdk/v1/models/constraint_type.py +43 -0
- across/sdk/v1/models/coordinate.py +100 -0
- across/sdk/v1/models/date_range.py +90 -0
- across/sdk/v1/models/depth_unit.py +39 -0
- across/sdk/v1/models/earth_limb_constraint.py +124 -0
- across/sdk/v1/models/energy_bandpass.py +121 -0
- across/sdk/v1/models/energy_unit.py +40 -0
- across/sdk/v1/models/ephemeris_type.py +39 -0
- across/sdk/v1/models/filter.py +135 -0
- across/sdk/v1/models/frequency_bandpass.py +121 -0
- across/sdk/v1/models/frequency_unit.py +40 -0
- across/sdk/v1/models/grant_type.py +37 -0
- across/sdk/v1/models/ground_parameters.py +91 -0
- across/sdk/v1/models/group_invite_create.py +87 -0
- across/sdk/v1/models/group_invite_group_details.py +94 -0
- across/sdk/v1/models/group_read.py +91 -0
- across/sdk/v1/models/group_role_create.py +89 -0
- across/sdk/v1/models/group_role_read.py +99 -0
- across/sdk/v1/models/http_validation_error.py +95 -0
- across/sdk/v1/models/id_name_schema.py +96 -0
- across/sdk/v1/models/instrument.py +163 -0
- across/sdk/v1/models/instrument_constraints_inner.py +237 -0
- across/sdk/v1/models/ivoa_obs_category.py +39 -0
- across/sdk/v1/models/ivoa_obs_tracking_type.py +38 -0
- across/sdk/v1/models/jpl_parameters.py +87 -0
- across/sdk/v1/models/moon_angle_constraint.py +124 -0
- across/sdk/v1/models/nullable_date_range.py +100 -0
- across/sdk/v1/models/observation.py +248 -0
- across/sdk/v1/models/observation_create.py +249 -0
- across/sdk/v1/models/observation_status.py +40 -0
- across/sdk/v1/models/observation_type.py +39 -0
- across/sdk/v1/models/observatory.py +145 -0
- across/sdk/v1/models/observatory_ephemeris_type.py +96 -0
- across/sdk/v1/models/observatory_type.py +37 -0
- across/sdk/v1/models/page_observation.py +116 -0
- across/sdk/v1/models/page_schedule.py +116 -0
- across/sdk/v1/models/parameters.py +164 -0
- across/sdk/v1/models/permission.py +89 -0
- across/sdk/v1/models/point.py +89 -0
- across/sdk/v1/models/role.py +100 -0
- across/sdk/v1/models/role_base.py +89 -0
- across/sdk/v1/models/saa_polygon_constraint.py +101 -0
- across/sdk/v1/models/schedule.py +144 -0
- across/sdk/v1/models/schedule_cadence.py +99 -0
- across/sdk/v1/models/schedule_create.py +123 -0
- across/sdk/v1/models/schedule_create_many.py +97 -0
- across/sdk/v1/models/schedule_fidelity.py +37 -0
- across/sdk/v1/models/schedule_status.py +38 -0
- across/sdk/v1/models/service_account_create.py +101 -0
- across/sdk/v1/models/service_account_secret.py +103 -0
- across/sdk/v1/models/service_account_update.py +106 -0
- across/sdk/v1/models/spice_parameters.py +89 -0
- across/sdk/v1/models/sun_angle_constraint.py +124 -0
- across/sdk/v1/models/system_service_account.py +121 -0
- across/sdk/v1/models/system_service_account_secret.py +123 -0
- across/sdk/v1/models/telescope.py +135 -0
- across/sdk/v1/models/telescope_instrument.py +163 -0
- across/sdk/v1/models/tle.py +99 -0
- across/sdk/v1/models/tle_create.py +94 -0
- across/sdk/v1/models/tle_parameters.py +89 -0
- across/sdk/v1/models/unit_value.py +94 -0
- across/sdk/v1/models/user_create.py +93 -0
- across/sdk/v1/models/user_info.py +95 -0
- across/sdk/v1/models/user_update.py +106 -0
- across/sdk/v1/models/validation_error.py +99 -0
- across/sdk/v1/models/validation_error_loc_inner.py +138 -0
- across/sdk/v1/models/visibility_result.py +97 -0
- across/sdk/v1/models/visibility_type.py +38 -0
- across/sdk/v1/models/visibility_window.py +99 -0
- across/sdk/v1/models/wavelength_bandpass.py +142 -0
- across/sdk/v1/models/wavelength_unit.py +39 -0
- across/sdk/v1/models/window.py +96 -0
- across/sdk/v1/py.typed +0 -0
- across/sdk/v1/rest.py +258 -0
- across_server_openapi_python-0.0.1.dist-info/METADATA +326 -0
- across_server_openapi_python-0.0.1.dist-info/RECORD +128 -0
- across_server_openapi_python-0.0.1.dist-info/WHEEL +5 -0
- across_server_openapi_python-0.0.1.dist-info/licenses/LICENSE +42 -0
- across_server_openapi_python-0.0.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,39 @@
|
|
|
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
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class IVOAObsCategory(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
IVOAObsCategory
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
FIXED = 'fixed'
|
|
30
|
+
COORDINATED = 'coordinated'
|
|
31
|
+
WINDOW = 'window'
|
|
32
|
+
OTHER = 'other'
|
|
33
|
+
|
|
34
|
+
@classmethod
|
|
35
|
+
def from_json(cls, json_str: str) -> Self:
|
|
36
|
+
"""Create an instance of IVOAObsCategory from a JSON string"""
|
|
37
|
+
return cls(json.loads(json_str))
|
|
38
|
+
|
|
39
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
from enum import Enum
|
|
18
|
+
from typing_extensions import Self
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class IVOAObsTrackingType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
IVOAObsTrackingType
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
SIDEREAL = 'sidereal'
|
|
30
|
+
SOLAR_MINUS_SYSTEM_MINUS_OBJECT_MINUS_TRACKING = 'solar-system-object-tracking'
|
|
31
|
+
FIXED_AZ_EL_TRANSIT = 'fixed_az_el_transit'
|
|
32
|
+
|
|
33
|
+
@classmethod
|
|
34
|
+
def from_json(cls, json_str: str) -> Self:
|
|
35
|
+
"""Create an instance of IVOAObsTrackingType from a JSON string"""
|
|
36
|
+
return cls(json.loads(json_str))
|
|
37
|
+
|
|
38
|
+
|
|
@@ -0,0 +1,87 @@
|
|
|
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, StrictInt
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class JPLParameters(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
JPLParameters
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
naif_id: StrictInt
|
|
30
|
+
__properties: ClassVar[List[str]] = ["naif_id"]
|
|
31
|
+
|
|
32
|
+
model_config = ConfigDict(
|
|
33
|
+
populate_by_name=True,
|
|
34
|
+
validate_assignment=True,
|
|
35
|
+
protected_namespaces=(),
|
|
36
|
+
)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
def to_str(self) -> str:
|
|
40
|
+
"""Returns the string representation of the model using alias"""
|
|
41
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
42
|
+
|
|
43
|
+
def to_json(self) -> str:
|
|
44
|
+
"""Returns the JSON representation of the model using alias"""
|
|
45
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
46
|
+
return json.dumps(self.to_dict())
|
|
47
|
+
|
|
48
|
+
@classmethod
|
|
49
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
50
|
+
"""Create an instance of JPLParameters from a JSON string"""
|
|
51
|
+
return cls.from_dict(json.loads(json_str))
|
|
52
|
+
|
|
53
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
54
|
+
"""Return the dictionary representation of the model using alias.
|
|
55
|
+
|
|
56
|
+
This has the following differences from calling pydantic's
|
|
57
|
+
`self.model_dump(by_alias=True)`:
|
|
58
|
+
|
|
59
|
+
* `None` is only added to the output dict for nullable fields that
|
|
60
|
+
were set at model initialization. Other fields with value `None`
|
|
61
|
+
are ignored.
|
|
62
|
+
"""
|
|
63
|
+
excluded_fields: Set[str] = set([
|
|
64
|
+
])
|
|
65
|
+
|
|
66
|
+
_dict = self.model_dump(
|
|
67
|
+
by_alias=True,
|
|
68
|
+
exclude=excluded_fields,
|
|
69
|
+
exclude_none=True,
|
|
70
|
+
)
|
|
71
|
+
return _dict
|
|
72
|
+
|
|
73
|
+
@classmethod
|
|
74
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
75
|
+
"""Create an instance of JPLParameters from a dict"""
|
|
76
|
+
if obj is None:
|
|
77
|
+
return None
|
|
78
|
+
|
|
79
|
+
if not isinstance(obj, dict):
|
|
80
|
+
return cls.model_validate(obj)
|
|
81
|
+
|
|
82
|
+
_obj = cls.model_validate({
|
|
83
|
+
"naif_id": obj.get("naif_id")
|
|
84
|
+
})
|
|
85
|
+
return _obj
|
|
86
|
+
|
|
87
|
+
|
|
@@ -0,0 +1,124 @@
|
|
|
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, Field, StrictStr, field_validator
|
|
21
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class MoonAngleConstraint(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
For a given Moon avoidance angle, is a given coordinate inside this constraint? Parameters ---------- min_angle The minimum angle from the Moon that the spacecraft can point. Methods ------- __call__(coord, ephemeris, moon_radius_angle=None) Checks if a given coordinate is inside the constraint.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
short_name: Optional[StrictStr] = 'Moon'
|
|
31
|
+
name: Optional[StrictStr] = 'Moon Angle'
|
|
32
|
+
min_angle: Optional[Union[Annotated[float, Field(le=180.0, strict=True, ge=0.0)], Annotated[int, Field(le=180, strict=True, ge=0)]]] = None
|
|
33
|
+
max_angle: Optional[Union[Annotated[float, Field(le=180.0, strict=True, ge=0.0)], Annotated[int, Field(le=180, strict=True, ge=0)]]] = None
|
|
34
|
+
__properties: ClassVar[List[str]] = ["short_name", "name", "min_angle", "max_angle"]
|
|
35
|
+
|
|
36
|
+
@field_validator('short_name')
|
|
37
|
+
def short_name_validate_enum(cls, value):
|
|
38
|
+
"""Validates the enum"""
|
|
39
|
+
if value is None:
|
|
40
|
+
return value
|
|
41
|
+
|
|
42
|
+
if value not in set(['Moon']):
|
|
43
|
+
raise ValueError("must be one of enum values ('Moon')")
|
|
44
|
+
return value
|
|
45
|
+
|
|
46
|
+
@field_validator('name')
|
|
47
|
+
def name_validate_enum(cls, value):
|
|
48
|
+
"""Validates the enum"""
|
|
49
|
+
if value is None:
|
|
50
|
+
return value
|
|
51
|
+
|
|
52
|
+
if value not in set(['Moon Angle']):
|
|
53
|
+
raise ValueError("must be one of enum values ('Moon Angle')")
|
|
54
|
+
return value
|
|
55
|
+
|
|
56
|
+
model_config = ConfigDict(
|
|
57
|
+
populate_by_name=True,
|
|
58
|
+
validate_assignment=True,
|
|
59
|
+
protected_namespaces=(),
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
def to_str(self) -> str:
|
|
64
|
+
"""Returns the string representation of the model using alias"""
|
|
65
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
66
|
+
|
|
67
|
+
def to_json(self) -> str:
|
|
68
|
+
"""Returns the JSON representation of the model using alias"""
|
|
69
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
70
|
+
return json.dumps(self.to_dict())
|
|
71
|
+
|
|
72
|
+
@classmethod
|
|
73
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
74
|
+
"""Create an instance of MoonAngleConstraint from a JSON string"""
|
|
75
|
+
return cls.from_dict(json.loads(json_str))
|
|
76
|
+
|
|
77
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
78
|
+
"""Return the dictionary representation of the model using alias.
|
|
79
|
+
|
|
80
|
+
This has the following differences from calling pydantic's
|
|
81
|
+
`self.model_dump(by_alias=True)`:
|
|
82
|
+
|
|
83
|
+
* `None` is only added to the output dict for nullable fields that
|
|
84
|
+
were set at model initialization. Other fields with value `None`
|
|
85
|
+
are ignored.
|
|
86
|
+
"""
|
|
87
|
+
excluded_fields: Set[str] = set([
|
|
88
|
+
])
|
|
89
|
+
|
|
90
|
+
_dict = self.model_dump(
|
|
91
|
+
by_alias=True,
|
|
92
|
+
exclude=excluded_fields,
|
|
93
|
+
exclude_none=True,
|
|
94
|
+
)
|
|
95
|
+
# set to None if min_angle (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.min_angle is None and "min_angle" in self.model_fields_set:
|
|
98
|
+
_dict['min_angle'] = None
|
|
99
|
+
|
|
100
|
+
# set to None if max_angle (nullable) is None
|
|
101
|
+
# and model_fields_set contains the field
|
|
102
|
+
if self.max_angle is None and "max_angle" in self.model_fields_set:
|
|
103
|
+
_dict['max_angle'] = None
|
|
104
|
+
|
|
105
|
+
return _dict
|
|
106
|
+
|
|
107
|
+
@classmethod
|
|
108
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
109
|
+
"""Create an instance of MoonAngleConstraint from a dict"""
|
|
110
|
+
if obj is None:
|
|
111
|
+
return None
|
|
112
|
+
|
|
113
|
+
if not isinstance(obj, dict):
|
|
114
|
+
return cls.model_validate(obj)
|
|
115
|
+
|
|
116
|
+
_obj = cls.model_validate({
|
|
117
|
+
"short_name": obj.get("short_name") if obj.get("short_name") is not None else 'Moon',
|
|
118
|
+
"name": obj.get("name") if obj.get("name") is not None else 'Moon Angle',
|
|
119
|
+
"min_angle": obj.get("min_angle"),
|
|
120
|
+
"max_angle": obj.get("max_angle")
|
|
121
|
+
})
|
|
122
|
+
return _obj
|
|
123
|
+
|
|
124
|
+
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class NullableDateRange(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
NullableDateRange
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
begin: Optional[datetime]
|
|
31
|
+
end: Optional[datetime]
|
|
32
|
+
__properties: ClassVar[List[str]] = ["begin", "end"]
|
|
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 NullableDateRange 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 begin (nullable) is None
|
|
74
|
+
# and model_fields_set contains the field
|
|
75
|
+
if self.begin is None and "begin" in self.model_fields_set:
|
|
76
|
+
_dict['begin'] = None
|
|
77
|
+
|
|
78
|
+
# set to None if end (nullable) is None
|
|
79
|
+
# and model_fields_set contains the field
|
|
80
|
+
if self.end is None and "end" in self.model_fields_set:
|
|
81
|
+
_dict['end'] = None
|
|
82
|
+
|
|
83
|
+
return _dict
|
|
84
|
+
|
|
85
|
+
@classmethod
|
|
86
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
87
|
+
"""Create an instance of NullableDateRange from a dict"""
|
|
88
|
+
if obj is None:
|
|
89
|
+
return None
|
|
90
|
+
|
|
91
|
+
if not isinstance(obj, dict):
|
|
92
|
+
return cls.model_validate(obj)
|
|
93
|
+
|
|
94
|
+
_obj = cls.model_validate({
|
|
95
|
+
"begin": obj.get("begin"),
|
|
96
|
+
"end": obj.get("end")
|
|
97
|
+
})
|
|
98
|
+
return _obj
|
|
99
|
+
|
|
100
|
+
|
|
@@ -0,0 +1,248 @@
|
|
|
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, StrictFloat, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional, Union
|
|
23
|
+
from across.sdk.v1.models.bandpass import Bandpass
|
|
24
|
+
from across.sdk.v1.models.coordinate import Coordinate
|
|
25
|
+
from across.sdk.v1.models.date_range import DateRange
|
|
26
|
+
from across.sdk.v1.models.ivoa_obs_category import IVOAObsCategory
|
|
27
|
+
from across.sdk.v1.models.ivoa_obs_tracking_type import IVOAObsTrackingType
|
|
28
|
+
from across.sdk.v1.models.observation_status import ObservationStatus
|
|
29
|
+
from across.sdk.v1.models.observation_type import ObservationType
|
|
30
|
+
from across.sdk.v1.models.unit_value import UnitValue
|
|
31
|
+
from typing import Optional, Set
|
|
32
|
+
from typing_extensions import Self
|
|
33
|
+
|
|
34
|
+
class Observation(BaseModel):
|
|
35
|
+
"""
|
|
36
|
+
Observation
|
|
37
|
+
""" # noqa: E501
|
|
38
|
+
instrument_id: StrictStr
|
|
39
|
+
object_name: StrictStr
|
|
40
|
+
pointing_position: Optional[Coordinate] = None
|
|
41
|
+
date_range: DateRange
|
|
42
|
+
external_observation_id: StrictStr
|
|
43
|
+
type: ObservationType
|
|
44
|
+
status: ObservationStatus
|
|
45
|
+
pointing_angle: Optional[Union[StrictFloat, StrictInt]] = None
|
|
46
|
+
exposure_time: Optional[Union[StrictFloat, StrictInt]] = None
|
|
47
|
+
reason: Optional[StrictStr] = None
|
|
48
|
+
description: Optional[StrictStr] = None
|
|
49
|
+
proposal_reference: Optional[StrictStr] = None
|
|
50
|
+
object_position: Optional[Coordinate] = None
|
|
51
|
+
depth: Optional[UnitValue] = None
|
|
52
|
+
bandpass: Bandpass
|
|
53
|
+
t_resolution: Optional[Union[StrictFloat, StrictInt]] = None
|
|
54
|
+
em_res_power: Optional[Union[StrictFloat, StrictInt]] = None
|
|
55
|
+
o_ucd: Optional[StrictStr] = None
|
|
56
|
+
pol_states: Optional[StrictStr] = None
|
|
57
|
+
pol_xel: Optional[StrictStr] = None
|
|
58
|
+
category: Optional[IVOAObsCategory] = None
|
|
59
|
+
priority: Optional[StrictInt] = None
|
|
60
|
+
tracking_type: Optional[IVOAObsTrackingType] = None
|
|
61
|
+
id: StrictStr
|
|
62
|
+
schedule_id: StrictStr
|
|
63
|
+
created_on: datetime
|
|
64
|
+
created_by_id: Optional[StrictStr] = None
|
|
65
|
+
__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"]
|
|
66
|
+
|
|
67
|
+
model_config = ConfigDict(
|
|
68
|
+
populate_by_name=True,
|
|
69
|
+
validate_assignment=True,
|
|
70
|
+
protected_namespaces=(),
|
|
71
|
+
)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def to_str(self) -> str:
|
|
75
|
+
"""Returns the string representation of the model using alias"""
|
|
76
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
77
|
+
|
|
78
|
+
def to_json(self) -> str:
|
|
79
|
+
"""Returns the JSON representation of the model using alias"""
|
|
80
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
81
|
+
return json.dumps(self.to_dict())
|
|
82
|
+
|
|
83
|
+
@classmethod
|
|
84
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
85
|
+
"""Create an instance of Observation from a JSON string"""
|
|
86
|
+
return cls.from_dict(json.loads(json_str))
|
|
87
|
+
|
|
88
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
89
|
+
"""Return the dictionary representation of the model using alias.
|
|
90
|
+
|
|
91
|
+
This has the following differences from calling pydantic's
|
|
92
|
+
`self.model_dump(by_alias=True)`:
|
|
93
|
+
|
|
94
|
+
* `None` is only added to the output dict for nullable fields that
|
|
95
|
+
were set at model initialization. Other fields with value `None`
|
|
96
|
+
are ignored.
|
|
97
|
+
"""
|
|
98
|
+
excluded_fields: Set[str] = set([
|
|
99
|
+
])
|
|
100
|
+
|
|
101
|
+
_dict = self.model_dump(
|
|
102
|
+
by_alias=True,
|
|
103
|
+
exclude=excluded_fields,
|
|
104
|
+
exclude_none=True,
|
|
105
|
+
)
|
|
106
|
+
# override the default output from pydantic by calling `to_dict()` of pointing_position
|
|
107
|
+
if self.pointing_position:
|
|
108
|
+
_dict['pointing_position'] = self.pointing_position.to_dict()
|
|
109
|
+
# override the default output from pydantic by calling `to_dict()` of date_range
|
|
110
|
+
if self.date_range:
|
|
111
|
+
_dict['date_range'] = self.date_range.to_dict()
|
|
112
|
+
# override the default output from pydantic by calling `to_dict()` of object_position
|
|
113
|
+
if self.object_position:
|
|
114
|
+
_dict['object_position'] = self.object_position.to_dict()
|
|
115
|
+
# override the default output from pydantic by calling `to_dict()` of depth
|
|
116
|
+
if self.depth:
|
|
117
|
+
_dict['depth'] = self.depth.to_dict()
|
|
118
|
+
# override the default output from pydantic by calling `to_dict()` of bandpass
|
|
119
|
+
if self.bandpass:
|
|
120
|
+
_dict['bandpass'] = self.bandpass.to_dict()
|
|
121
|
+
# set to None if pointing_position (nullable) is None
|
|
122
|
+
# and model_fields_set contains the field
|
|
123
|
+
if self.pointing_position is None and "pointing_position" in self.model_fields_set:
|
|
124
|
+
_dict['pointing_position'] = None
|
|
125
|
+
|
|
126
|
+
# set to None if pointing_angle (nullable) is None
|
|
127
|
+
# and model_fields_set contains the field
|
|
128
|
+
if self.pointing_angle is None and "pointing_angle" in self.model_fields_set:
|
|
129
|
+
_dict['pointing_angle'] = None
|
|
130
|
+
|
|
131
|
+
# set to None if exposure_time (nullable) is None
|
|
132
|
+
# and model_fields_set contains the field
|
|
133
|
+
if self.exposure_time is None and "exposure_time" in self.model_fields_set:
|
|
134
|
+
_dict['exposure_time'] = None
|
|
135
|
+
|
|
136
|
+
# set to None if reason (nullable) is None
|
|
137
|
+
# and model_fields_set contains the field
|
|
138
|
+
if self.reason is None and "reason" in self.model_fields_set:
|
|
139
|
+
_dict['reason'] = None
|
|
140
|
+
|
|
141
|
+
# set to None if description (nullable) is None
|
|
142
|
+
# and model_fields_set contains the field
|
|
143
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
144
|
+
_dict['description'] = None
|
|
145
|
+
|
|
146
|
+
# set to None if proposal_reference (nullable) is None
|
|
147
|
+
# and model_fields_set contains the field
|
|
148
|
+
if self.proposal_reference is None and "proposal_reference" in self.model_fields_set:
|
|
149
|
+
_dict['proposal_reference'] = None
|
|
150
|
+
|
|
151
|
+
# set to None if object_position (nullable) is None
|
|
152
|
+
# and model_fields_set contains the field
|
|
153
|
+
if self.object_position is None and "object_position" in self.model_fields_set:
|
|
154
|
+
_dict['object_position'] = None
|
|
155
|
+
|
|
156
|
+
# set to None if depth (nullable) is None
|
|
157
|
+
# and model_fields_set contains the field
|
|
158
|
+
if self.depth is None and "depth" in self.model_fields_set:
|
|
159
|
+
_dict['depth'] = None
|
|
160
|
+
|
|
161
|
+
# set to None if t_resolution (nullable) is None
|
|
162
|
+
# and model_fields_set contains the field
|
|
163
|
+
if self.t_resolution is None and "t_resolution" in self.model_fields_set:
|
|
164
|
+
_dict['t_resolution'] = None
|
|
165
|
+
|
|
166
|
+
# set to None if em_res_power (nullable) is None
|
|
167
|
+
# and model_fields_set contains the field
|
|
168
|
+
if self.em_res_power is None and "em_res_power" in self.model_fields_set:
|
|
169
|
+
_dict['em_res_power'] = None
|
|
170
|
+
|
|
171
|
+
# set to None if o_ucd (nullable) is None
|
|
172
|
+
# and model_fields_set contains the field
|
|
173
|
+
if self.o_ucd is None and "o_ucd" in self.model_fields_set:
|
|
174
|
+
_dict['o_ucd'] = None
|
|
175
|
+
|
|
176
|
+
# set to None if pol_states (nullable) is None
|
|
177
|
+
# and model_fields_set contains the field
|
|
178
|
+
if self.pol_states is None and "pol_states" in self.model_fields_set:
|
|
179
|
+
_dict['pol_states'] = None
|
|
180
|
+
|
|
181
|
+
# set to None if pol_xel (nullable) is None
|
|
182
|
+
# and model_fields_set contains the field
|
|
183
|
+
if self.pol_xel is None and "pol_xel" in self.model_fields_set:
|
|
184
|
+
_dict['pol_xel'] = None
|
|
185
|
+
|
|
186
|
+
# set to None if category (nullable) is None
|
|
187
|
+
# and model_fields_set contains the field
|
|
188
|
+
if self.category is None and "category" in self.model_fields_set:
|
|
189
|
+
_dict['category'] = None
|
|
190
|
+
|
|
191
|
+
# set to None if priority (nullable) is None
|
|
192
|
+
# and model_fields_set contains the field
|
|
193
|
+
if self.priority is None and "priority" in self.model_fields_set:
|
|
194
|
+
_dict['priority'] = None
|
|
195
|
+
|
|
196
|
+
# set to None if tracking_type (nullable) is None
|
|
197
|
+
# and model_fields_set contains the field
|
|
198
|
+
if self.tracking_type is None and "tracking_type" in self.model_fields_set:
|
|
199
|
+
_dict['tracking_type'] = None
|
|
200
|
+
|
|
201
|
+
# set to None if created_by_id (nullable) is None
|
|
202
|
+
# and model_fields_set contains the field
|
|
203
|
+
if self.created_by_id is None and "created_by_id" in self.model_fields_set:
|
|
204
|
+
_dict['created_by_id'] = None
|
|
205
|
+
|
|
206
|
+
return _dict
|
|
207
|
+
|
|
208
|
+
@classmethod
|
|
209
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
210
|
+
"""Create an instance of Observation from a dict"""
|
|
211
|
+
if obj is None:
|
|
212
|
+
return None
|
|
213
|
+
|
|
214
|
+
if not isinstance(obj, dict):
|
|
215
|
+
return cls.model_validate(obj)
|
|
216
|
+
|
|
217
|
+
_obj = cls.model_validate({
|
|
218
|
+
"instrument_id": obj.get("instrument_id"),
|
|
219
|
+
"object_name": obj.get("object_name"),
|
|
220
|
+
"pointing_position": Coordinate.from_dict(obj["pointing_position"]) if obj.get("pointing_position") is not None else None,
|
|
221
|
+
"date_range": DateRange.from_dict(obj["date_range"]) if obj.get("date_range") is not None else None,
|
|
222
|
+
"external_observation_id": obj.get("external_observation_id"),
|
|
223
|
+
"type": obj.get("type"),
|
|
224
|
+
"status": obj.get("status"),
|
|
225
|
+
"pointing_angle": obj.get("pointing_angle"),
|
|
226
|
+
"exposure_time": obj.get("exposure_time"),
|
|
227
|
+
"reason": obj.get("reason"),
|
|
228
|
+
"description": obj.get("description"),
|
|
229
|
+
"proposal_reference": obj.get("proposal_reference"),
|
|
230
|
+
"object_position": Coordinate.from_dict(obj["object_position"]) if obj.get("object_position") is not None else None,
|
|
231
|
+
"depth": UnitValue.from_dict(obj["depth"]) if obj.get("depth") is not None else None,
|
|
232
|
+
"bandpass": Bandpass.from_dict(obj["bandpass"]) if obj.get("bandpass") is not None else None,
|
|
233
|
+
"t_resolution": obj.get("t_resolution"),
|
|
234
|
+
"em_res_power": obj.get("em_res_power"),
|
|
235
|
+
"o_ucd": obj.get("o_ucd"),
|
|
236
|
+
"pol_states": obj.get("pol_states"),
|
|
237
|
+
"pol_xel": obj.get("pol_xel"),
|
|
238
|
+
"category": obj.get("category"),
|
|
239
|
+
"priority": obj.get("priority"),
|
|
240
|
+
"tracking_type": obj.get("tracking_type"),
|
|
241
|
+
"id": obj.get("id"),
|
|
242
|
+
"schedule_id": obj.get("schedule_id"),
|
|
243
|
+
"created_on": obj.get("created_on"),
|
|
244
|
+
"created_by_id": obj.get("created_by_id")
|
|
245
|
+
})
|
|
246
|
+
return _obj
|
|
247
|
+
|
|
248
|
+
|