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,123 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
FastAPI
|
|
5
|
+
|
|
6
|
+
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.2.1
|
|
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, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from across.sdk.v1.models.group_role_read import GroupRoleRead
|
|
24
|
+
from across.sdk.v1.models.role_base import RoleBase
|
|
25
|
+
from typing import Optional, Set
|
|
26
|
+
from typing_extensions import Self
|
|
27
|
+
|
|
28
|
+
class SystemServiceAccountSecret(BaseModel):
|
|
29
|
+
"""
|
|
30
|
+
SystemServiceAccountSecret
|
|
31
|
+
""" # noqa: E501
|
|
32
|
+
id: StrictStr
|
|
33
|
+
name: StrictStr
|
|
34
|
+
description: Optional[StrictStr] = None
|
|
35
|
+
expiration: datetime
|
|
36
|
+
expiration_duration: StrictInt
|
|
37
|
+
roles: List[RoleBase]
|
|
38
|
+
group_roles: List[GroupRoleRead]
|
|
39
|
+
secret_key: StrictStr
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "name", "description", "expiration", "expiration_duration", "roles", "group_roles", "secret_key"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of SystemServiceAccountSecret from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in roles (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.roles:
|
|
84
|
+
for _item_roles in self.roles:
|
|
85
|
+
if _item_roles:
|
|
86
|
+
_items.append(_item_roles.to_dict())
|
|
87
|
+
_dict['roles'] = _items
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each item in group_roles (list)
|
|
89
|
+
_items = []
|
|
90
|
+
if self.group_roles:
|
|
91
|
+
for _item_group_roles in self.group_roles:
|
|
92
|
+
if _item_group_roles:
|
|
93
|
+
_items.append(_item_group_roles.to_dict())
|
|
94
|
+
_dict['group_roles'] = _items
|
|
95
|
+
# set to None if description (nullable) is None
|
|
96
|
+
# and model_fields_set contains the field
|
|
97
|
+
if self.description is None and "description" in self.model_fields_set:
|
|
98
|
+
_dict['description'] = None
|
|
99
|
+
|
|
100
|
+
return _dict
|
|
101
|
+
|
|
102
|
+
@classmethod
|
|
103
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
104
|
+
"""Create an instance of SystemServiceAccountSecret from a dict"""
|
|
105
|
+
if obj is None:
|
|
106
|
+
return None
|
|
107
|
+
|
|
108
|
+
if not isinstance(obj, dict):
|
|
109
|
+
return cls.model_validate(obj)
|
|
110
|
+
|
|
111
|
+
_obj = cls.model_validate({
|
|
112
|
+
"id": obj.get("id"),
|
|
113
|
+
"name": obj.get("name"),
|
|
114
|
+
"description": obj.get("description"),
|
|
115
|
+
"expiration": obj.get("expiration"),
|
|
116
|
+
"expiration_duration": obj.get("expiration_duration"),
|
|
117
|
+
"roles": [RoleBase.from_dict(_item) for _item in obj["roles"]] if obj.get("roles") is not None else None,
|
|
118
|
+
"group_roles": [GroupRoleRead.from_dict(_item) for _item in obj["group_roles"]] if obj.get("group_roles") is not None else None,
|
|
119
|
+
"secret_key": obj.get("secret_key")
|
|
120
|
+
})
|
|
121
|
+
return _obj
|
|
122
|
+
|
|
123
|
+
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ACROSS Server
|
|
5
|
+
|
|
6
|
+
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.3.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from across.sdk.v1.models.id_name_schema import IDNameSchema
|
|
24
|
+
from across.sdk.v1.models.schedule_cadence import ScheduleCadence
|
|
25
|
+
from across.sdk.v1.models.telescope_instrument import TelescopeInstrument
|
|
26
|
+
from typing import Optional, Set
|
|
27
|
+
from typing_extensions import Self
|
|
28
|
+
|
|
29
|
+
class Telescope(BaseModel):
|
|
30
|
+
"""
|
|
31
|
+
A Pydantic model class representing a created telescope Notes ----- Inherits from TelescopeBase Methods ------- from_orm(telescope: TelescopeModel) -> Telescope Static method that instantiates this class from a telescope database record
|
|
32
|
+
""" # noqa: E501
|
|
33
|
+
id: StrictStr
|
|
34
|
+
created_on: datetime
|
|
35
|
+
name: StrictStr
|
|
36
|
+
short_name: StrictStr
|
|
37
|
+
schedule_cadences: Optional[List[ScheduleCadence]] = None
|
|
38
|
+
observatory: Optional[IDNameSchema] = None
|
|
39
|
+
instruments: Optional[List[TelescopeInstrument]] = None
|
|
40
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "name", "short_name", "schedule_cadences", "observatory", "instruments"]
|
|
41
|
+
|
|
42
|
+
model_config = ConfigDict(
|
|
43
|
+
populate_by_name=True,
|
|
44
|
+
validate_assignment=True,
|
|
45
|
+
protected_namespaces=(),
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
def to_str(self) -> str:
|
|
50
|
+
"""Returns the string representation of the model using alias"""
|
|
51
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
52
|
+
|
|
53
|
+
def to_json(self) -> str:
|
|
54
|
+
"""Returns the JSON representation of the model using alias"""
|
|
55
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
56
|
+
return json.dumps(self.to_dict())
|
|
57
|
+
|
|
58
|
+
@classmethod
|
|
59
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
60
|
+
"""Create an instance of Telescope from a JSON string"""
|
|
61
|
+
return cls.from_dict(json.loads(json_str))
|
|
62
|
+
|
|
63
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
64
|
+
"""Return the dictionary representation of the model using alias.
|
|
65
|
+
|
|
66
|
+
This has the following differences from calling pydantic's
|
|
67
|
+
`self.model_dump(by_alias=True)`:
|
|
68
|
+
|
|
69
|
+
* `None` is only added to the output dict for nullable fields that
|
|
70
|
+
were set at model initialization. Other fields with value `None`
|
|
71
|
+
are ignored.
|
|
72
|
+
"""
|
|
73
|
+
excluded_fields: Set[str] = set([
|
|
74
|
+
])
|
|
75
|
+
|
|
76
|
+
_dict = self.model_dump(
|
|
77
|
+
by_alias=True,
|
|
78
|
+
exclude=excluded_fields,
|
|
79
|
+
exclude_none=True,
|
|
80
|
+
)
|
|
81
|
+
# override the default output from pydantic by calling `to_dict()` of each item in schedule_cadences (list)
|
|
82
|
+
_items = []
|
|
83
|
+
if self.schedule_cadences:
|
|
84
|
+
for _item_schedule_cadences in self.schedule_cadences:
|
|
85
|
+
if _item_schedule_cadences:
|
|
86
|
+
_items.append(_item_schedule_cadences.to_dict())
|
|
87
|
+
_dict['schedule_cadences'] = _items
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of observatory
|
|
89
|
+
if self.observatory:
|
|
90
|
+
_dict['observatory'] = self.observatory.to_dict()
|
|
91
|
+
# override the default output from pydantic by calling `to_dict()` of each item in instruments (list)
|
|
92
|
+
_items = []
|
|
93
|
+
if self.instruments:
|
|
94
|
+
for _item_instruments in self.instruments:
|
|
95
|
+
if _item_instruments:
|
|
96
|
+
_items.append(_item_instruments.to_dict())
|
|
97
|
+
_dict['instruments'] = _items
|
|
98
|
+
# set to None if schedule_cadences (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.schedule_cadences is None and "schedule_cadences" in self.model_fields_set:
|
|
101
|
+
_dict['schedule_cadences'] = None
|
|
102
|
+
|
|
103
|
+
# set to None if observatory (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.observatory is None and "observatory" in self.model_fields_set:
|
|
106
|
+
_dict['observatory'] = None
|
|
107
|
+
|
|
108
|
+
# set to None if instruments (nullable) is None
|
|
109
|
+
# and model_fields_set contains the field
|
|
110
|
+
if self.instruments is None and "instruments" in self.model_fields_set:
|
|
111
|
+
_dict['instruments'] = None
|
|
112
|
+
|
|
113
|
+
return _dict
|
|
114
|
+
|
|
115
|
+
@classmethod
|
|
116
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
117
|
+
"""Create an instance of Telescope from a dict"""
|
|
118
|
+
if obj is None:
|
|
119
|
+
return None
|
|
120
|
+
|
|
121
|
+
if not isinstance(obj, dict):
|
|
122
|
+
return cls.model_validate(obj)
|
|
123
|
+
|
|
124
|
+
_obj = cls.model_validate({
|
|
125
|
+
"id": obj.get("id"),
|
|
126
|
+
"created_on": obj.get("created_on"),
|
|
127
|
+
"name": obj.get("name"),
|
|
128
|
+
"short_name": obj.get("short_name"),
|
|
129
|
+
"schedule_cadences": [ScheduleCadence.from_dict(_item) for _item in obj["schedule_cadences"]] if obj.get("schedule_cadences") is not None else None,
|
|
130
|
+
"observatory": IDNameSchema.from_dict(obj["observatory"]) if obj.get("observatory") is not None else None,
|
|
131
|
+
"instruments": [TelescopeInstrument.from_dict(_item) for _item in obj["instruments"]] if obj.get("instruments") is not None else None
|
|
132
|
+
})
|
|
133
|
+
return _obj
|
|
134
|
+
|
|
135
|
+
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ACROSS Server
|
|
5
|
+
|
|
6
|
+
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.3.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List, Optional
|
|
23
|
+
from across.sdk.v1.models.filter import Filter
|
|
24
|
+
from across.sdk.v1.models.id_name_schema import IDNameSchema
|
|
25
|
+
from across.sdk.v1.models.instrument_constraints_inner import InstrumentConstraintsInner
|
|
26
|
+
from across.sdk.v1.models.point import Point
|
|
27
|
+
from across.sdk.v1.models.visibility_type import VisibilityType
|
|
28
|
+
from typing import Optional, Set
|
|
29
|
+
from typing_extensions import Self
|
|
30
|
+
|
|
31
|
+
class TelescopeInstrument(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
A Pydantic model class representing a created Instrument for the Telescope Endpoint Notes ----- Inherits from InstrumentBase Methods ------- from_orm(instrument: InstrumentModel, include_footprints: bool, include_filters: bool) -> Instrument Static method that instantiates this class from a Instrument database record
|
|
34
|
+
""" # noqa: E501
|
|
35
|
+
id: StrictStr
|
|
36
|
+
created_on: datetime
|
|
37
|
+
name: StrictStr
|
|
38
|
+
short_name: StrictStr
|
|
39
|
+
telescope: Optional[IDNameSchema] = None
|
|
40
|
+
footprints: Optional[List[List[Point]]] = None
|
|
41
|
+
filters: Optional[List[Filter]] = None
|
|
42
|
+
constraints: Optional[List[InstrumentConstraintsInner]] = None
|
|
43
|
+
visibility_type: Optional[VisibilityType] = None
|
|
44
|
+
__properties: ClassVar[List[str]] = ["id", "created_on", "name", "short_name", "telescope", "footprints", "filters", "constraints", "visibility_type"]
|
|
45
|
+
|
|
46
|
+
model_config = ConfigDict(
|
|
47
|
+
populate_by_name=True,
|
|
48
|
+
validate_assignment=True,
|
|
49
|
+
protected_namespaces=(),
|
|
50
|
+
)
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def to_str(self) -> str:
|
|
54
|
+
"""Returns the string representation of the model using alias"""
|
|
55
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
56
|
+
|
|
57
|
+
def to_json(self) -> str:
|
|
58
|
+
"""Returns the JSON representation of the model using alias"""
|
|
59
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
60
|
+
return json.dumps(self.to_dict())
|
|
61
|
+
|
|
62
|
+
@classmethod
|
|
63
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
64
|
+
"""Create an instance of TelescopeInstrument from a JSON string"""
|
|
65
|
+
return cls.from_dict(json.loads(json_str))
|
|
66
|
+
|
|
67
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
68
|
+
"""Return the dictionary representation of the model using alias.
|
|
69
|
+
|
|
70
|
+
This has the following differences from calling pydantic's
|
|
71
|
+
`self.model_dump(by_alias=True)`:
|
|
72
|
+
|
|
73
|
+
* `None` is only added to the output dict for nullable fields that
|
|
74
|
+
were set at model initialization. Other fields with value `None`
|
|
75
|
+
are ignored.
|
|
76
|
+
"""
|
|
77
|
+
excluded_fields: Set[str] = set([
|
|
78
|
+
])
|
|
79
|
+
|
|
80
|
+
_dict = self.model_dump(
|
|
81
|
+
by_alias=True,
|
|
82
|
+
exclude=excluded_fields,
|
|
83
|
+
exclude_none=True,
|
|
84
|
+
)
|
|
85
|
+
# override the default output from pydantic by calling `to_dict()` of telescope
|
|
86
|
+
if self.telescope:
|
|
87
|
+
_dict['telescope'] = self.telescope.to_dict()
|
|
88
|
+
# override the default output from pydantic by calling `to_dict()` of each item in footprints (list of list)
|
|
89
|
+
_items = []
|
|
90
|
+
if self.footprints:
|
|
91
|
+
for _item_footprints in self.footprints:
|
|
92
|
+
if _item_footprints:
|
|
93
|
+
_items.append(
|
|
94
|
+
[_inner_item.to_dict() for _inner_item in _item_footprints if _inner_item is not None]
|
|
95
|
+
)
|
|
96
|
+
_dict['footprints'] = _items
|
|
97
|
+
# override the default output from pydantic by calling `to_dict()` of each item in filters (list)
|
|
98
|
+
_items = []
|
|
99
|
+
if self.filters:
|
|
100
|
+
for _item_filters in self.filters:
|
|
101
|
+
if _item_filters:
|
|
102
|
+
_items.append(_item_filters.to_dict())
|
|
103
|
+
_dict['filters'] = _items
|
|
104
|
+
# override the default output from pydantic by calling `to_dict()` of each item in constraints (list)
|
|
105
|
+
_items = []
|
|
106
|
+
if self.constraints:
|
|
107
|
+
for _item_constraints in self.constraints:
|
|
108
|
+
if _item_constraints:
|
|
109
|
+
_items.append(_item_constraints.to_dict())
|
|
110
|
+
_dict['constraints'] = _items
|
|
111
|
+
# set to None if telescope (nullable) is None
|
|
112
|
+
# and model_fields_set contains the field
|
|
113
|
+
if self.telescope is None and "telescope" in self.model_fields_set:
|
|
114
|
+
_dict['telescope'] = None
|
|
115
|
+
|
|
116
|
+
# set to None if footprints (nullable) is None
|
|
117
|
+
# and model_fields_set contains the field
|
|
118
|
+
if self.footprints is None and "footprints" in self.model_fields_set:
|
|
119
|
+
_dict['footprints'] = None
|
|
120
|
+
|
|
121
|
+
# set to None if filters (nullable) is None
|
|
122
|
+
# and model_fields_set contains the field
|
|
123
|
+
if self.filters is None and "filters" in self.model_fields_set:
|
|
124
|
+
_dict['filters'] = None
|
|
125
|
+
|
|
126
|
+
# set to None if constraints (nullable) is None
|
|
127
|
+
# and model_fields_set contains the field
|
|
128
|
+
if self.constraints is None and "constraints" in self.model_fields_set:
|
|
129
|
+
_dict['constraints'] = None
|
|
130
|
+
|
|
131
|
+
# set to None if visibility_type (nullable) is None
|
|
132
|
+
# and model_fields_set contains the field
|
|
133
|
+
if self.visibility_type is None and "visibility_type" in self.model_fields_set:
|
|
134
|
+
_dict['visibility_type'] = None
|
|
135
|
+
|
|
136
|
+
return _dict
|
|
137
|
+
|
|
138
|
+
@classmethod
|
|
139
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
140
|
+
"""Create an instance of TelescopeInstrument from a dict"""
|
|
141
|
+
if obj is None:
|
|
142
|
+
return None
|
|
143
|
+
|
|
144
|
+
if not isinstance(obj, dict):
|
|
145
|
+
return cls.model_validate(obj)
|
|
146
|
+
|
|
147
|
+
_obj = cls.model_validate({
|
|
148
|
+
"id": obj.get("id"),
|
|
149
|
+
"created_on": obj.get("created_on"),
|
|
150
|
+
"name": obj.get("name"),
|
|
151
|
+
"short_name": obj.get("short_name"),
|
|
152
|
+
"telescope": IDNameSchema.from_dict(obj["telescope"]) if obj.get("telescope") is not None else None,
|
|
153
|
+
"footprints": [
|
|
154
|
+
[Point.from_dict(_inner_item) for _inner_item in _item]
|
|
155
|
+
for _item in obj["footprints"]
|
|
156
|
+
] if obj.get("footprints") is not None else None,
|
|
157
|
+
"filters": [Filter.from_dict(_item) for _item in obj["filters"]] if obj.get("filters") is not None else None,
|
|
158
|
+
"constraints": [InstrumentConstraintsInner.from_dict(_item) for _item in obj["constraints"]] if obj.get("constraints") is not None else None,
|
|
159
|
+
"visibility_type": obj.get("visibility_type")
|
|
160
|
+
})
|
|
161
|
+
return _obj
|
|
162
|
+
|
|
163
|
+
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ACROSS Server
|
|
5
|
+
|
|
6
|
+
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.3.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from datetime import datetime
|
|
21
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
|
22
|
+
from typing import Any, ClassVar, Dict, List
|
|
23
|
+
from typing_extensions import Annotated
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class TLE(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
TLE
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
norad_id: StrictInt
|
|
32
|
+
satellite_name: StrictStr
|
|
33
|
+
tle1: Annotated[str, Field(min_length=69, strict=True, max_length=69)]
|
|
34
|
+
tle2: Annotated[str, Field(min_length=69, strict=True, max_length=69)]
|
|
35
|
+
epoch: datetime = Field(description="Calculate the Epoch of the TLE file. See https://celestrak.org/columns/v04n03/#FAQ04 for more information on how the year / epoch encoding works. Returns ------- The calculated epoch of the TLE.")
|
|
36
|
+
__properties: ClassVar[List[str]] = ["norad_id", "satellite_name", "tle1", "tle2", "epoch"]
|
|
37
|
+
|
|
38
|
+
model_config = ConfigDict(
|
|
39
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
52
|
+
return json.dumps(self.to_dict())
|
|
53
|
+
|
|
54
|
+
@classmethod
|
|
55
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
56
|
+
"""Create an instance of TLE from a JSON string"""
|
|
57
|
+
return cls.from_dict(json.loads(json_str))
|
|
58
|
+
|
|
59
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
60
|
+
"""Return the dictionary representation of the model using alias.
|
|
61
|
+
|
|
62
|
+
This has the following differences from calling pydantic's
|
|
63
|
+
`self.model_dump(by_alias=True)`:
|
|
64
|
+
|
|
65
|
+
* `None` is only added to the output dict for nullable fields that
|
|
66
|
+
were set at model initialization. Other fields with value `None`
|
|
67
|
+
are ignored.
|
|
68
|
+
* OpenAPI `readOnly` fields are excluded.
|
|
69
|
+
"""
|
|
70
|
+
excluded_fields: Set[str] = set([
|
|
71
|
+
"epoch",
|
|
72
|
+
])
|
|
73
|
+
|
|
74
|
+
_dict = self.model_dump(
|
|
75
|
+
by_alias=True,
|
|
76
|
+
exclude=excluded_fields,
|
|
77
|
+
exclude_none=True,
|
|
78
|
+
)
|
|
79
|
+
return _dict
|
|
80
|
+
|
|
81
|
+
@classmethod
|
|
82
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
83
|
+
"""Create an instance of TLE 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
|
+
"norad_id": obj.get("norad_id"),
|
|
92
|
+
"satellite_name": obj.get("satellite_name"),
|
|
93
|
+
"tle1": obj.get("tle1"),
|
|
94
|
+
"tle2": obj.get("tle2"),
|
|
95
|
+
"epoch": obj.get("epoch")
|
|
96
|
+
})
|
|
97
|
+
return _obj
|
|
98
|
+
|
|
99
|
+
|
|
@@ -0,0 +1,94 @@
|
|
|
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, StrictInt, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing_extensions import Annotated
|
|
23
|
+
from typing import Optional, Set
|
|
24
|
+
from typing_extensions import Self
|
|
25
|
+
|
|
26
|
+
class TLECreate(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
TLECreate
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
norad_id: StrictInt
|
|
31
|
+
satellite_name: StrictStr
|
|
32
|
+
tle1: Annotated[str, Field(min_length=69, strict=True, max_length=69)]
|
|
33
|
+
tle2: Annotated[str, Field(min_length=69, strict=True, max_length=69)]
|
|
34
|
+
__properties: ClassVar[List[str]] = ["norad_id", "satellite_name", "tle1", "tle2"]
|
|
35
|
+
|
|
36
|
+
model_config = ConfigDict(
|
|
37
|
+
populate_by_name=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
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
50
|
+
return json.dumps(self.to_dict())
|
|
51
|
+
|
|
52
|
+
@classmethod
|
|
53
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
54
|
+
"""Create an instance of TLECreate from a JSON string"""
|
|
55
|
+
return cls.from_dict(json.loads(json_str))
|
|
56
|
+
|
|
57
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
58
|
+
"""Return the dictionary representation of the model using alias.
|
|
59
|
+
|
|
60
|
+
This has the following differences from calling pydantic's
|
|
61
|
+
`self.model_dump(by_alias=True)`:
|
|
62
|
+
|
|
63
|
+
* `None` is only added to the output dict for nullable fields that
|
|
64
|
+
were set at model initialization. Other fields with value `None`
|
|
65
|
+
are ignored.
|
|
66
|
+
"""
|
|
67
|
+
excluded_fields: Set[str] = set([
|
|
68
|
+
])
|
|
69
|
+
|
|
70
|
+
_dict = self.model_dump(
|
|
71
|
+
by_alias=True,
|
|
72
|
+
exclude=excluded_fields,
|
|
73
|
+
exclude_none=True,
|
|
74
|
+
)
|
|
75
|
+
return _dict
|
|
76
|
+
|
|
77
|
+
@classmethod
|
|
78
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
79
|
+
"""Create an instance of TLECreate from a dict"""
|
|
80
|
+
if obj is None:
|
|
81
|
+
return None
|
|
82
|
+
|
|
83
|
+
if not isinstance(obj, dict):
|
|
84
|
+
return cls.model_validate(obj)
|
|
85
|
+
|
|
86
|
+
_obj = cls.model_validate({
|
|
87
|
+
"norad_id": obj.get("norad_id"),
|
|
88
|
+
"satellite_name": obj.get("satellite_name"),
|
|
89
|
+
"tle1": obj.get("tle1"),
|
|
90
|
+
"tle2": obj.get("tle2")
|
|
91
|
+
})
|
|
92
|
+
return _obj
|
|
93
|
+
|
|
94
|
+
|