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,130 @@
|
|
|
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, StrictFloat, StrictInt, 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 AltAzConstraint(BaseModel):
|
|
27
|
+
"""
|
|
28
|
+
For a given Alt/Az constraint, is a given coordinate inside this constraint? Constraint is both defined by a polygon exclusion region and a minimum and maximum altitude. By default the minimum and maximum altitude values are 0 and 90 degrees respectively. Polygon restriction regions can be combined with minimum and maximum altitude restrictions. Parameters ---------- polygon The polygon defining the exclusion region. min The minimum altitude in degrees. max The maximum altitude in degrees.
|
|
29
|
+
""" # noqa: E501
|
|
30
|
+
short_name: Optional[StrictStr] = 'AltAz'
|
|
31
|
+
name: Optional[StrictStr] = 'Altitude/Azimuth Avoidance'
|
|
32
|
+
polygon: List[List[Union[StrictFloat, StrictInt]]]
|
|
33
|
+
altitude_min: Optional[Union[Annotated[float, Field(le=90.0, strict=True, ge=0.0)], Annotated[int, Field(le=90, strict=True, ge=0)]]] = None
|
|
34
|
+
altitude_max: Optional[Union[Annotated[float, Field(le=90.0, strict=True, ge=0.0)], Annotated[int, Field(le=90, strict=True, ge=0)]]] = None
|
|
35
|
+
azimuth_min: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = None
|
|
36
|
+
azimuth_max: Optional[Union[Annotated[float, Field(strict=True, ge=0.0)], Annotated[int, Field(strict=True, ge=0)]]] = None
|
|
37
|
+
__properties: ClassVar[List[str]] = ["short_name", "name", "polygon", "altitude_min", "altitude_max", "azimuth_min", "azimuth_max"]
|
|
38
|
+
|
|
39
|
+
@field_validator('name')
|
|
40
|
+
def name_validate_enum(cls, value):
|
|
41
|
+
"""Validates the enum"""
|
|
42
|
+
if value is None:
|
|
43
|
+
return value
|
|
44
|
+
|
|
45
|
+
if value not in set(['Altitude/Azimuth Avoidance']):
|
|
46
|
+
raise ValueError("must be one of enum values ('Altitude/Azimuth Avoidance')")
|
|
47
|
+
return value
|
|
48
|
+
|
|
49
|
+
model_config = ConfigDict(
|
|
50
|
+
populate_by_name=True,
|
|
51
|
+
validate_assignment=True,
|
|
52
|
+
protected_namespaces=(),
|
|
53
|
+
)
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def to_str(self) -> str:
|
|
57
|
+
"""Returns the string representation of the model using alias"""
|
|
58
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
59
|
+
|
|
60
|
+
def to_json(self) -> str:
|
|
61
|
+
"""Returns the JSON representation of the model using alias"""
|
|
62
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
63
|
+
return json.dumps(self.to_dict())
|
|
64
|
+
|
|
65
|
+
@classmethod
|
|
66
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
67
|
+
"""Create an instance of AltAzConstraint from a JSON string"""
|
|
68
|
+
return cls.from_dict(json.loads(json_str))
|
|
69
|
+
|
|
70
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
71
|
+
"""Return the dictionary representation of the model using alias.
|
|
72
|
+
|
|
73
|
+
This has the following differences from calling pydantic's
|
|
74
|
+
`self.model_dump(by_alias=True)`:
|
|
75
|
+
|
|
76
|
+
* `None` is only added to the output dict for nullable fields that
|
|
77
|
+
were set at model initialization. Other fields with value `None`
|
|
78
|
+
are ignored.
|
|
79
|
+
"""
|
|
80
|
+
excluded_fields: Set[str] = set([
|
|
81
|
+
])
|
|
82
|
+
|
|
83
|
+
_dict = self.model_dump(
|
|
84
|
+
by_alias=True,
|
|
85
|
+
exclude=excluded_fields,
|
|
86
|
+
exclude_none=True,
|
|
87
|
+
)
|
|
88
|
+
# set to None if altitude_min (nullable) is None
|
|
89
|
+
# and model_fields_set contains the field
|
|
90
|
+
if self.altitude_min is None and "altitude_min" in self.model_fields_set:
|
|
91
|
+
_dict['altitude_min'] = None
|
|
92
|
+
|
|
93
|
+
# set to None if altitude_max (nullable) is None
|
|
94
|
+
# and model_fields_set contains the field
|
|
95
|
+
if self.altitude_max is None and "altitude_max" in self.model_fields_set:
|
|
96
|
+
_dict['altitude_max'] = None
|
|
97
|
+
|
|
98
|
+
# set to None if azimuth_min (nullable) is None
|
|
99
|
+
# and model_fields_set contains the field
|
|
100
|
+
if self.azimuth_min is None and "azimuth_min" in self.model_fields_set:
|
|
101
|
+
_dict['azimuth_min'] = None
|
|
102
|
+
|
|
103
|
+
# set to None if azimuth_max (nullable) is None
|
|
104
|
+
# and model_fields_set contains the field
|
|
105
|
+
if self.azimuth_max is None and "azimuth_max" in self.model_fields_set:
|
|
106
|
+
_dict['azimuth_max'] = None
|
|
107
|
+
|
|
108
|
+
return _dict
|
|
109
|
+
|
|
110
|
+
@classmethod
|
|
111
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
112
|
+
"""Create an instance of AltAzConstraint from a dict"""
|
|
113
|
+
if obj is None:
|
|
114
|
+
return None
|
|
115
|
+
|
|
116
|
+
if not isinstance(obj, dict):
|
|
117
|
+
return cls.model_validate(obj)
|
|
118
|
+
|
|
119
|
+
_obj = cls.model_validate({
|
|
120
|
+
"short_name": obj.get("short_name") if obj.get("short_name") is not None else 'AltAz',
|
|
121
|
+
"name": obj.get("name") if obj.get("name") is not None else 'Altitude/Azimuth Avoidance',
|
|
122
|
+
"polygon": obj.get("polygon"),
|
|
123
|
+
"altitude_min": obj.get("altitude_min"),
|
|
124
|
+
"altitude_max": obj.get("altitude_max"),
|
|
125
|
+
"azimuth_min": obj.get("azimuth_min"),
|
|
126
|
+
"azimuth_max": obj.get("azimuth_max")
|
|
127
|
+
})
|
|
128
|
+
return _obj
|
|
129
|
+
|
|
130
|
+
|
|
@@ -0,0 +1,149 @@
|
|
|
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
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from across.sdk.v1.models.energy_bandpass import EnergyBandpass
|
|
23
|
+
from across.sdk.v1.models.frequency_bandpass import FrequencyBandpass
|
|
24
|
+
from across.sdk.v1.models.wavelength_bandpass import WavelengthBandpass
|
|
25
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
26
|
+
from typing_extensions import Literal, Self
|
|
27
|
+
from pydantic import Field
|
|
28
|
+
|
|
29
|
+
BANDPASS_ANY_OF_SCHEMAS = ["EnergyBandpass", "FrequencyBandpass", "WavelengthBandpass"]
|
|
30
|
+
|
|
31
|
+
class Bandpass(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
Bandpass
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
# data type: EnergyBandpass
|
|
37
|
+
anyof_schema_1_validator: Optional[EnergyBandpass] = None
|
|
38
|
+
# data type: FrequencyBandpass
|
|
39
|
+
anyof_schema_2_validator: Optional[FrequencyBandpass] = None
|
|
40
|
+
# data type: WavelengthBandpass
|
|
41
|
+
anyof_schema_3_validator: Optional[WavelengthBandpass] = None
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
actual_instance: Optional[Union[EnergyBandpass, FrequencyBandpass, WavelengthBandpass]] = None
|
|
44
|
+
else:
|
|
45
|
+
actual_instance: Any = None
|
|
46
|
+
any_of_schemas: Set[str] = { "EnergyBandpass", "FrequencyBandpass", "WavelengthBandpass" }
|
|
47
|
+
|
|
48
|
+
model_config = {
|
|
49
|
+
"validate_assignment": True,
|
|
50
|
+
"protected_namespaces": (),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
59
|
+
super().__init__(actual_instance=args[0])
|
|
60
|
+
else:
|
|
61
|
+
super().__init__(**kwargs)
|
|
62
|
+
|
|
63
|
+
@field_validator('actual_instance')
|
|
64
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
65
|
+
instance = Bandpass.model_construct()
|
|
66
|
+
error_messages = []
|
|
67
|
+
# validate data type: EnergyBandpass
|
|
68
|
+
if not isinstance(v, EnergyBandpass):
|
|
69
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `EnergyBandpass`")
|
|
70
|
+
else:
|
|
71
|
+
return v
|
|
72
|
+
|
|
73
|
+
# validate data type: FrequencyBandpass
|
|
74
|
+
if not isinstance(v, FrequencyBandpass):
|
|
75
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FrequencyBandpass`")
|
|
76
|
+
else:
|
|
77
|
+
return v
|
|
78
|
+
|
|
79
|
+
# validate data type: WavelengthBandpass
|
|
80
|
+
if not isinstance(v, WavelengthBandpass):
|
|
81
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `WavelengthBandpass`")
|
|
82
|
+
else:
|
|
83
|
+
return v
|
|
84
|
+
|
|
85
|
+
if error_messages:
|
|
86
|
+
# no match
|
|
87
|
+
raise ValueError("No match found when setting the actual_instance in Bandpass with anyOf schemas: EnergyBandpass, FrequencyBandpass, WavelengthBandpass. Details: " + ", ".join(error_messages))
|
|
88
|
+
else:
|
|
89
|
+
return v
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
93
|
+
return cls.from_json(json.dumps(obj))
|
|
94
|
+
|
|
95
|
+
@classmethod
|
|
96
|
+
def from_json(cls, json_str: str) -> Self:
|
|
97
|
+
"""Returns the object represented by the json string"""
|
|
98
|
+
instance = cls.model_construct()
|
|
99
|
+
error_messages = []
|
|
100
|
+
# anyof_schema_1_validator: Optional[EnergyBandpass] = None
|
|
101
|
+
try:
|
|
102
|
+
instance.actual_instance = EnergyBandpass.from_json(json_str)
|
|
103
|
+
return instance
|
|
104
|
+
except (ValidationError, ValueError) as e:
|
|
105
|
+
error_messages.append(str(e))
|
|
106
|
+
# anyof_schema_2_validator: Optional[FrequencyBandpass] = None
|
|
107
|
+
try:
|
|
108
|
+
instance.actual_instance = FrequencyBandpass.from_json(json_str)
|
|
109
|
+
return instance
|
|
110
|
+
except (ValidationError, ValueError) as e:
|
|
111
|
+
error_messages.append(str(e))
|
|
112
|
+
# anyof_schema_3_validator: Optional[WavelengthBandpass] = None
|
|
113
|
+
try:
|
|
114
|
+
instance.actual_instance = WavelengthBandpass.from_json(json_str)
|
|
115
|
+
return instance
|
|
116
|
+
except (ValidationError, ValueError) as e:
|
|
117
|
+
error_messages.append(str(e))
|
|
118
|
+
|
|
119
|
+
if error_messages:
|
|
120
|
+
# no match
|
|
121
|
+
raise ValueError("No match found when deserializing the JSON string into Bandpass with anyOf schemas: EnergyBandpass, FrequencyBandpass, WavelengthBandpass. Details: " + ", ".join(error_messages))
|
|
122
|
+
else:
|
|
123
|
+
return instance
|
|
124
|
+
|
|
125
|
+
def to_json(self) -> str:
|
|
126
|
+
"""Returns the JSON representation of the actual instance"""
|
|
127
|
+
if self.actual_instance is None:
|
|
128
|
+
return "null"
|
|
129
|
+
|
|
130
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
131
|
+
return self.actual_instance.to_json()
|
|
132
|
+
else:
|
|
133
|
+
return json.dumps(self.actual_instance)
|
|
134
|
+
|
|
135
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], EnergyBandpass, FrequencyBandpass, WavelengthBandpass]]:
|
|
136
|
+
"""Returns the dict representation of the actual instance"""
|
|
137
|
+
if self.actual_instance is None:
|
|
138
|
+
return None
|
|
139
|
+
|
|
140
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
141
|
+
return self.actual_instance.to_dict()
|
|
142
|
+
else:
|
|
143
|
+
return self.actual_instance
|
|
144
|
+
|
|
145
|
+
def to_str(self) -> str:
|
|
146
|
+
"""Returns the string representation of the actual instance"""
|
|
147
|
+
return pprint.pformat(self.model_dump())
|
|
148
|
+
|
|
149
|
+
|
|
@@ -0,0 +1,155 @@
|
|
|
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
|
+
from inspect import getfullargspec
|
|
17
|
+
import json
|
|
18
|
+
import pprint
|
|
19
|
+
import re # noqa: F401
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator
|
|
21
|
+
from typing import Optional
|
|
22
|
+
from across.sdk.v1.models.energy_unit import EnergyUnit
|
|
23
|
+
from across.sdk.v1.models.frequency_unit import FrequencyUnit
|
|
24
|
+
from across.sdk.v1.models.wavelength_unit import WavelengthUnit
|
|
25
|
+
from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
|
|
26
|
+
from typing_extensions import Literal, Self
|
|
27
|
+
from pydantic import Field
|
|
28
|
+
|
|
29
|
+
BANDPASSTYPE_ANY_OF_SCHEMAS = ["EnergyUnit", "FrequencyUnit", "WavelengthUnit"]
|
|
30
|
+
|
|
31
|
+
class BandpassType(BaseModel):
|
|
32
|
+
"""
|
|
33
|
+
BandpassType
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
# data type: WavelengthUnit
|
|
37
|
+
anyof_schema_1_validator: Optional[WavelengthUnit] = None
|
|
38
|
+
# data type: EnergyUnit
|
|
39
|
+
anyof_schema_2_validator: Optional[EnergyUnit] = None
|
|
40
|
+
# data type: FrequencyUnit
|
|
41
|
+
anyof_schema_3_validator: Optional[FrequencyUnit] = None
|
|
42
|
+
if TYPE_CHECKING:
|
|
43
|
+
actual_instance: Optional[Union[EnergyUnit, FrequencyUnit, WavelengthUnit]] = None
|
|
44
|
+
else:
|
|
45
|
+
actual_instance: Any = None
|
|
46
|
+
any_of_schemas: Set[str] = { "EnergyUnit", "FrequencyUnit", "WavelengthUnit" }
|
|
47
|
+
|
|
48
|
+
model_config = {
|
|
49
|
+
"validate_assignment": True,
|
|
50
|
+
"protected_namespaces": (),
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
def __init__(self, *args, **kwargs) -> None:
|
|
54
|
+
if args:
|
|
55
|
+
if len(args) > 1:
|
|
56
|
+
raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
|
|
57
|
+
if kwargs:
|
|
58
|
+
raise ValueError("If a position argument is used, keyword arguments cannot be used.")
|
|
59
|
+
super().__init__(actual_instance=args[0])
|
|
60
|
+
else:
|
|
61
|
+
super().__init__(**kwargs)
|
|
62
|
+
|
|
63
|
+
@field_validator('actual_instance')
|
|
64
|
+
def actual_instance_must_validate_anyof(cls, v):
|
|
65
|
+
if v is None:
|
|
66
|
+
return v
|
|
67
|
+
|
|
68
|
+
instance = BandpassType.model_construct()
|
|
69
|
+
error_messages = []
|
|
70
|
+
# validate data type: WavelengthUnit
|
|
71
|
+
if not isinstance(v, WavelengthUnit):
|
|
72
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `WavelengthUnit`")
|
|
73
|
+
else:
|
|
74
|
+
return v
|
|
75
|
+
|
|
76
|
+
# validate data type: EnergyUnit
|
|
77
|
+
if not isinstance(v, EnergyUnit):
|
|
78
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `EnergyUnit`")
|
|
79
|
+
else:
|
|
80
|
+
return v
|
|
81
|
+
|
|
82
|
+
# validate data type: FrequencyUnit
|
|
83
|
+
if not isinstance(v, FrequencyUnit):
|
|
84
|
+
error_messages.append(f"Error! Input type `{type(v)}` is not `FrequencyUnit`")
|
|
85
|
+
else:
|
|
86
|
+
return v
|
|
87
|
+
|
|
88
|
+
if error_messages:
|
|
89
|
+
# no match
|
|
90
|
+
raise ValueError("No match found when setting the actual_instance in BandpassType with anyOf schemas: EnergyUnit, FrequencyUnit, WavelengthUnit. Details: " + ", ".join(error_messages))
|
|
91
|
+
else:
|
|
92
|
+
return v
|
|
93
|
+
|
|
94
|
+
@classmethod
|
|
95
|
+
def from_dict(cls, obj: Dict[str, Any]) -> Self:
|
|
96
|
+
return cls.from_json(json.dumps(obj))
|
|
97
|
+
|
|
98
|
+
@classmethod
|
|
99
|
+
def from_json(cls, json_str: str) -> Self:
|
|
100
|
+
"""Returns the object represented by the json string"""
|
|
101
|
+
instance = cls.model_construct()
|
|
102
|
+
if json_str is None:
|
|
103
|
+
return instance
|
|
104
|
+
|
|
105
|
+
error_messages = []
|
|
106
|
+
# anyof_schema_1_validator: Optional[WavelengthUnit] = None
|
|
107
|
+
try:
|
|
108
|
+
instance.actual_instance = WavelengthUnit.from_json(json_str)
|
|
109
|
+
return instance
|
|
110
|
+
except (ValidationError, ValueError) as e:
|
|
111
|
+
error_messages.append(str(e))
|
|
112
|
+
# anyof_schema_2_validator: Optional[EnergyUnit] = None
|
|
113
|
+
try:
|
|
114
|
+
instance.actual_instance = EnergyUnit.from_json(json_str)
|
|
115
|
+
return instance
|
|
116
|
+
except (ValidationError, ValueError) as e:
|
|
117
|
+
error_messages.append(str(e))
|
|
118
|
+
# anyof_schema_3_validator: Optional[FrequencyUnit] = None
|
|
119
|
+
try:
|
|
120
|
+
instance.actual_instance = FrequencyUnit.from_json(json_str)
|
|
121
|
+
return instance
|
|
122
|
+
except (ValidationError, ValueError) as e:
|
|
123
|
+
error_messages.append(str(e))
|
|
124
|
+
|
|
125
|
+
if error_messages:
|
|
126
|
+
# no match
|
|
127
|
+
raise ValueError("No match found when deserializing the JSON string into BandpassType with anyOf schemas: EnergyUnit, FrequencyUnit, WavelengthUnit. Details: " + ", ".join(error_messages))
|
|
128
|
+
else:
|
|
129
|
+
return instance
|
|
130
|
+
|
|
131
|
+
def to_json(self) -> str:
|
|
132
|
+
"""Returns the JSON representation of the actual instance"""
|
|
133
|
+
if self.actual_instance is None:
|
|
134
|
+
return "null"
|
|
135
|
+
|
|
136
|
+
if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
|
|
137
|
+
return self.actual_instance.to_json()
|
|
138
|
+
else:
|
|
139
|
+
return json.dumps(self.actual_instance)
|
|
140
|
+
|
|
141
|
+
def to_dict(self) -> Optional[Union[Dict[str, Any], EnergyUnit, FrequencyUnit, WavelengthUnit]]:
|
|
142
|
+
"""Returns the dict representation of the actual instance"""
|
|
143
|
+
if self.actual_instance is None:
|
|
144
|
+
return None
|
|
145
|
+
|
|
146
|
+
if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
|
|
147
|
+
return self.actual_instance.to_dict()
|
|
148
|
+
else:
|
|
149
|
+
return self.actual_instance
|
|
150
|
+
|
|
151
|
+
def to_str(self) -> str:
|
|
152
|
+
"""Returns the string representation of the actual instance"""
|
|
153
|
+
return pprint.pformat(self.model_dump())
|
|
154
|
+
|
|
155
|
+
|
|
@@ -0,0 +1,93 @@
|
|
|
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
|
|
23
|
+
from across.sdk.v1.models.constraint_type import ConstraintType
|
|
24
|
+
from typing import Optional, Set
|
|
25
|
+
from typing_extensions import Self
|
|
26
|
+
|
|
27
|
+
class ConstrainedDate(BaseModel):
|
|
28
|
+
"""
|
|
29
|
+
Represents a constrained date.
|
|
30
|
+
""" # noqa: E501
|
|
31
|
+
datetime: datetime
|
|
32
|
+
constraint: ConstraintType
|
|
33
|
+
observatory_id: StrictStr
|
|
34
|
+
__properties: ClassVar[List[str]] = ["datetime", "constraint", "observatory_id"]
|
|
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 ConstrainedDate 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 ConstrainedDate 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
|
+
"datetime": obj.get("datetime"),
|
|
88
|
+
"constraint": obj.get("constraint"),
|
|
89
|
+
"observatory_id": obj.get("observatory_id")
|
|
90
|
+
})
|
|
91
|
+
return _obj
|
|
92
|
+
|
|
93
|
+
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
"""
|
|
4
|
+
ACROSS Server
|
|
5
|
+
|
|
6
|
+
Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
|
|
7
|
+
|
|
8
|
+
The version of the OpenAPI document: 0.3.2
|
|
9
|
+
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
|
10
|
+
|
|
11
|
+
Do not edit the class manually.
|
|
12
|
+
""" # noqa: E501
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
from __future__ import annotations
|
|
16
|
+
import pprint
|
|
17
|
+
import re # noqa: F401
|
|
18
|
+
import json
|
|
19
|
+
|
|
20
|
+
from pydantic import BaseModel, ConfigDict, StrictStr
|
|
21
|
+
from typing import Any, ClassVar, Dict, List
|
|
22
|
+
from typing import Optional, Set
|
|
23
|
+
from typing_extensions import Self
|
|
24
|
+
|
|
25
|
+
class ConstraintReason(BaseModel):
|
|
26
|
+
"""
|
|
27
|
+
Represents the reasons for constraints.
|
|
28
|
+
""" # noqa: E501
|
|
29
|
+
start_reason: StrictStr
|
|
30
|
+
end_reason: StrictStr
|
|
31
|
+
__properties: ClassVar[List[str]] = ["start_reason", "end_reason"]
|
|
32
|
+
|
|
33
|
+
model_config = ConfigDict(
|
|
34
|
+
populate_by_name=True,
|
|
35
|
+
validate_assignment=True,
|
|
36
|
+
protected_namespaces=(),
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def to_str(self) -> str:
|
|
41
|
+
"""Returns the string representation of the model using alias"""
|
|
42
|
+
return pprint.pformat(self.model_dump(by_alias=True))
|
|
43
|
+
|
|
44
|
+
def to_json(self) -> str:
|
|
45
|
+
"""Returns the JSON representation of the model using alias"""
|
|
46
|
+
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
47
|
+
return json.dumps(self.to_dict())
|
|
48
|
+
|
|
49
|
+
@classmethod
|
|
50
|
+
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
51
|
+
"""Create an instance of ConstraintReason from a JSON string"""
|
|
52
|
+
return cls.from_dict(json.loads(json_str))
|
|
53
|
+
|
|
54
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
55
|
+
"""Return the dictionary representation of the model using alias.
|
|
56
|
+
|
|
57
|
+
This has the following differences from calling pydantic's
|
|
58
|
+
`self.model_dump(by_alias=True)`:
|
|
59
|
+
|
|
60
|
+
* `None` is only added to the output dict for nullable fields that
|
|
61
|
+
were set at model initialization. Other fields with value `None`
|
|
62
|
+
are ignored.
|
|
63
|
+
"""
|
|
64
|
+
excluded_fields: Set[str] = set([
|
|
65
|
+
])
|
|
66
|
+
|
|
67
|
+
_dict = self.model_dump(
|
|
68
|
+
by_alias=True,
|
|
69
|
+
exclude=excluded_fields,
|
|
70
|
+
exclude_none=True,
|
|
71
|
+
)
|
|
72
|
+
return _dict
|
|
73
|
+
|
|
74
|
+
@classmethod
|
|
75
|
+
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
76
|
+
"""Create an instance of ConstraintReason from a dict"""
|
|
77
|
+
if obj is None:
|
|
78
|
+
return None
|
|
79
|
+
|
|
80
|
+
if not isinstance(obj, dict):
|
|
81
|
+
return cls.model_validate(obj)
|
|
82
|
+
|
|
83
|
+
_obj = cls.model_validate({
|
|
84
|
+
"start_reason": obj.get("start_reason"),
|
|
85
|
+
"end_reason": obj.get("end_reason")
|
|
86
|
+
})
|
|
87
|
+
return _obj
|
|
88
|
+
|
|
89
|
+
|
|
@@ -0,0 +1,43 @@
|
|
|
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 ConstraintType(str, Enum):
|
|
22
|
+
"""
|
|
23
|
+
Represents a constraint.
|
|
24
|
+
"""
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
allowed enum values
|
|
28
|
+
"""
|
|
29
|
+
SUN_ANGLE = 'Sun Angle'
|
|
30
|
+
MOON_ANGLE = 'Moon Angle'
|
|
31
|
+
EARTH_LIMB = 'Earth Limb'
|
|
32
|
+
WINDOW = 'Window'
|
|
33
|
+
UNKNOWN = 'Unknown'
|
|
34
|
+
SOUTH_ATLANTIC_ANOMALY = 'South Atlantic Anomaly'
|
|
35
|
+
ALTITUDE_SLASH_AZIMUTH_AVOIDANCE = 'Altitude/Azimuth Avoidance'
|
|
36
|
+
TEST_CONSTRAINT = 'Test Constraint'
|
|
37
|
+
|
|
38
|
+
@classmethod
|
|
39
|
+
def from_json(cls, json_str: str) -> Self:
|
|
40
|
+
"""Create an instance of ConstraintType from a JSON string"""
|
|
41
|
+
return cls(json.loads(json_str))
|
|
42
|
+
|
|
43
|
+
|