across-server-openapi-python 1.3.0__py3-none-any.whl → 2.0.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. across/sdk/v1/__init__.py +76 -17
  2. across/sdk/v1/api/__init__.py +3 -1
  3. across/sdk/v1/api/auth_api.py +17 -286
  4. across/sdk/v1/api/broker_alert_api.py +1017 -0
  5. across/sdk/v1/api/broker_event_api.py +697 -0
  6. across/sdk/v1/api/filter_api.py +20 -20
  7. across/sdk/v1/api/group_api.py +31 -281
  8. across/sdk/v1/api/group_invite_api.py +65 -66
  9. across/sdk/v1/api/group_role_api.py +105 -106
  10. across/sdk/v1/api/instrument_api.py +20 -20
  11. across/sdk/v1/api/internal_api.py +20 -21
  12. across/sdk/v1/api/observation_api.py +762 -135
  13. across/sdk/v1/api/observation_request_api.py +2108 -0
  14. across/sdk/v1/api/observatory_api.py +24 -25
  15. across/sdk/v1/api/permission_api.py +5 -6
  16. across/sdk/v1/api/role_api.py +1 -1
  17. across/sdk/v1/api/schedule_api.py +84 -86
  18. across/sdk/v1/api/service_account_api.py +125 -126
  19. across/sdk/v1/api/telescope_api.py +26 -26
  20. across/sdk/v1/api/tle_api.py +7 -8
  21. across/sdk/v1/api/tools_api.py +55 -55
  22. across/sdk/v1/api/user_api.py +84 -333
  23. across/sdk/v1/api_client.py +111 -47
  24. across/sdk/v1/configuration.py +106 -33
  25. across/sdk/v1/exceptions.py +8 -6
  26. across/sdk/v1/models/__init__.py +36 -9
  27. across/sdk/v1/models/access_token_response.py +5 -4
  28. across/sdk/v1/models/across_server_routes_v1_group_invite_schemas_group_invite.py +106 -0
  29. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group.py +93 -0
  30. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_group_role.py +20 -15
  31. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_service_account.py +107 -0
  32. across/sdk/v1/models/across_server_routes_v1_group_role_schemas_user.py +7 -5
  33. across/sdk/v1/models/across_server_routes_v1_group_schemas_group.py +12 -12
  34. across/sdk/v1/models/across_server_routes_v1_group_schemas_user.py +8 -7
  35. across/sdk/v1/models/across_server_routes_v1_role_schemas_user.py +95 -0
  36. across/sdk/v1/models/across_server_routes_v1_user_schemas_group.py +11 -10
  37. across/sdk/v1/models/across_server_routes_v1_user_schemas_group_invite.py +8 -6
  38. across/sdk/v1/models/across_server_routes_v1_user_schemas_group_role.py +106 -0
  39. across/sdk/v1/models/across_server_routes_v1_user_schemas_user.py +14 -16
  40. across/sdk/v1/models/across_server_routes_v1_user_service_account_schemas_service_account.py +8 -7
  41. across/sdk/v1/models/bandpass.py +1 -1
  42. across/sdk/v1/models/bandpass_type.py +1 -1
  43. across/sdk/v1/models/broker_alert.py +106 -0
  44. across/sdk/v1/models/broker_alert_create.py +115 -0
  45. across/sdk/v1/models/broker_alert_data_source.py +39 -0
  46. across/sdk/v1/models/broker_alert_status.py +41 -0
  47. across/sdk/v1/models/broker_event.py +115 -0
  48. across/sdk/v1/models/broker_event_type.py +41 -0
  49. across/sdk/v1/models/constrained_date.py +8 -6
  50. across/sdk/v1/models/constraint_reason.py +5 -4
  51. across/sdk/v1/models/constraint_type.py +1 -1
  52. across/sdk/v1/models/coordinate.py +5 -4
  53. across/sdk/v1/models/date_range.py +5 -4
  54. across/sdk/v1/models/date_range_create.py +96 -0
  55. across/sdk/v1/models/depth_unit.py +1 -1
  56. across/sdk/v1/models/energy_bandpass.py +5 -4
  57. across/sdk/v1/models/energy_unit.py +1 -1
  58. across/sdk/v1/models/ephemeris_type.py +1 -1
  59. across/sdk/v1/models/filter.py +8 -6
  60. across/sdk/v1/models/frequency_bandpass.py +5 -4
  61. across/sdk/v1/models/frequency_unit.py +1 -1
  62. across/sdk/v1/models/grant_type.py +1 -1
  63. across/sdk/v1/models/ground_parameters.py +5 -4
  64. across/sdk/v1/models/group.py +5 -15
  65. across/sdk/v1/models/group_base.py +93 -0
  66. across/sdk/v1/models/group_invite.py +1 -1
  67. across/sdk/v1/models/group_invite_create.py +5 -4
  68. across/sdk/v1/models/group_invite_group_details.py +7 -5
  69. across/sdk/v1/models/group_read.py +7 -5
  70. across/sdk/v1/models/group_role.py +37 -6
  71. across/sdk/v1/models/group_role_create.py +7 -5
  72. across/sdk/v1/models/group_role_read.py +16 -9
  73. across/sdk/v1/models/http_validation_error.py +6 -6
  74. across/sdk/v1/models/id_name_schema.py +7 -5
  75. across/sdk/v1/models/instrument.py +31 -15
  76. across/sdk/v1/models/ivoa_obs_category.py +1 -1
  77. across/sdk/v1/models/ivoa_obs_tracking_type.py +1 -1
  78. across/sdk/v1/models/joint_visibility_result.py +23 -23
  79. across/sdk/v1/models/jpl_parameters.py +5 -4
  80. across/sdk/v1/models/localization.py +128 -0
  81. across/sdk/v1/models/localization_contour_base.py +95 -0
  82. across/sdk/v1/models/localization_create.py +121 -0
  83. across/sdk/v1/models/location_inner.py +1 -1
  84. across/sdk/v1/models/name_resolver.py +5 -4
  85. across/sdk/v1/models/nullable_date_range.py +5 -4
  86. across/sdk/v1/models/nullable_end_date_range.py +96 -0
  87. across/sdk/v1/models/observation.py +11 -10
  88. across/sdk/v1/models/observation_create.py +9 -8
  89. across/sdk/v1/models/observation_footprint.py +10 -9
  90. across/sdk/v1/models/observation_footprint_create.py +6 -6
  91. across/sdk/v1/models/observation_request.py +202 -0
  92. across/sdk/v1/models/observation_request_create.py +148 -0
  93. across/sdk/v1/models/observation_request_create_many.py +95 -0
  94. across/sdk/v1/models/observation_request_status.py +40 -0
  95. across/sdk/v1/models/observation_request_update.py +213 -0
  96. across/sdk/v1/models/observation_request_version.py +99 -0
  97. across/sdk/v1/models/observation_status.py +1 -1
  98. across/sdk/v1/models/observation_strategy.py +1 -1
  99. across/sdk/v1/models/observation_type.py +1 -1
  100. across/sdk/v1/models/observation_window.py +134 -0
  101. across/sdk/v1/models/observation_window1.py +140 -0
  102. across/sdk/v1/models/observatory.py +9 -9
  103. across/sdk/v1/models/observatory_ephemeris_type.py +5 -4
  104. across/sdk/v1/models/observatory_type.py +1 -1
  105. across/sdk/v1/models/observing_proposal.py +93 -0
  106. across/sdk/v1/models/observing_proposal_create.py +98 -0
  107. across/sdk/v1/models/page_broker_alert.py +116 -0
  108. across/sdk/v1/models/page_broker_event.py +116 -0
  109. across/sdk/v1/models/page_observation.py +6 -6
  110. across/sdk/v1/models/page_observation_request.py +116 -0
  111. across/sdk/v1/models/page_schedule.py +6 -6
  112. across/sdk/v1/models/parameters.py +1 -1
  113. across/sdk/v1/models/permission.py +7 -5
  114. across/sdk/v1/models/point.py +5 -4
  115. across/sdk/v1/models/proper_motion.py +93 -0
  116. across/sdk/v1/models/role.py +4 -4
  117. across/sdk/v1/models/role_base.py +7 -5
  118. across/sdk/v1/models/schedule.py +10 -9
  119. across/sdk/v1/models/schedule_cadence.py +8 -6
  120. across/sdk/v1/models/schedule_create.py +8 -7
  121. across/sdk/v1/models/schedule_create_many.py +9 -8
  122. across/sdk/v1/models/schedule_fidelity.py +1 -1
  123. across/sdk/v1/models/schedule_status.py +1 -1
  124. across/sdk/v1/models/service_account.py +1 -1
  125. across/sdk/v1/models/service_account_create.py +5 -4
  126. across/sdk/v1/models/service_account_secret.py +7 -5
  127. across/sdk/v1/models/service_account_update.py +5 -4
  128. across/sdk/v1/models/setting.py +100 -0
  129. across/sdk/v1/models/setting_type.py +39 -0
  130. across/sdk/v1/models/spice_parameters.py +5 -4
  131. across/sdk/v1/models/system_service_account.py +9 -9
  132. across/sdk/v1/models/telescope.py +9 -9
  133. across/sdk/v1/models/telescope_instrument.py +31 -15
  134. across/sdk/v1/models/tle.py +5 -4
  135. across/sdk/v1/models/tle_create.py +5 -4
  136. across/sdk/v1/models/tle_parameters.py +5 -4
  137. across/sdk/v1/models/unit_value.py +5 -4
  138. across/sdk/v1/models/user.py +47 -7
  139. across/sdk/v1/models/user_create.py +5 -4
  140. across/sdk/v1/models/user_info.py +7 -5
  141. across/sdk/v1/models/user_update.py +5 -4
  142. across/sdk/v1/models/validation_error.py +21 -12
  143. across/sdk/v1/models/validation_error_loc_inner.py +1 -1
  144. across/sdk/v1/models/visibility_result.py +14 -11
  145. across/sdk/v1/models/visibility_type.py +1 -1
  146. across/sdk/v1/models/visibility_window.py +5 -4
  147. across/sdk/v1/models/wavelength_bandpass.py +5 -4
  148. across/sdk/v1/models/wavelength_unit.py +1 -1
  149. across/sdk/v1/models/window.py +5 -4
  150. across/sdk/v1/rest.py +88 -12
  151. {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/METADATA +122 -45
  152. across_server_openapi_python-2.0.0.dist-info/RECORD +162 -0
  153. {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/WHEEL +1 -1
  154. across_server_openapi_python-1.3.0.dist-info/RECORD +0 -126
  155. {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/licenses/LICENSE +0 -0
  156. {across_server_openapi_python-1.3.0.dist-info → across_server_openapi_python-2.0.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,95 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 2.0.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict
21
+ from typing import Any, ClassVar, Dict, List
22
+ from across.sdk.v1.models.point import Point
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class LocalizationContourBase(BaseModel):
28
+ """
29
+ A Pydantic model class representing a base LocalizationContour in the ACROSS system. Parameters ---------- contour: list[Point] List of vertices mapping the localization region contours Methods --------- region_to_wkt: Convert the contour polygon to a WKT element
30
+ """ # noqa: E501
31
+ contour: List[Point]
32
+ __properties: ClassVar[List[str]] = ["contour"]
33
+
34
+ model_config = ConfigDict(
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
37
+ validate_assignment=True,
38
+ protected_namespaces=(),
39
+ )
40
+
41
+
42
+ def to_str(self) -> str:
43
+ """Returns the string representation of the model using alias"""
44
+ return pprint.pformat(self.model_dump(by_alias=True))
45
+
46
+ def to_json(self) -> str:
47
+ """Returns the JSON representation of the model using alias"""
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
+
50
+ @classmethod
51
+ def from_json(cls, json_str: str) -> Optional[Self]:
52
+ """Create an instance of LocalizationContourBase 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
+ # override the default output from pydantic by calling `to_dict()` of each item in contour (list)
74
+ _items = []
75
+ if self.contour:
76
+ for _item_contour in self.contour:
77
+ _items.append(_item_contour.to_dict() if _item_contour is not None else None)
78
+ _dict['contour'] = _items
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of LocalizationContourBase 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
+ "contour": [Point.from_dict(_item) for _item in obj["contour"]] if obj.get("contour") is not None else None
92
+ })
93
+ return _obj
94
+
95
+
@@ -0,0 +1,121 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 2.0.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
21
+ from typing import Any, ClassVar, Dict, List, Optional, Union
22
+ from across.sdk.v1.models.localization_contour_base import LocalizationContourBase
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class LocalizationCreate(BaseModel):
28
+ """
29
+ A Pydantic model class representing data required to create a Localization object in the ACROSS system. Inherits from LocalizationBase Methods ---------- to_orm: Returns an ORM Localization instance with the supplied data.
30
+ """ # noqa: E501
31
+ ra: Optional[Union[StrictFloat, StrictInt]] = None
32
+ dec: Optional[Union[StrictFloat, StrictInt]] = None
33
+ contours: Optional[List[LocalizationContourBase]] = None
34
+ probability_enclosed: Optional[Union[StrictFloat, StrictInt]] = None
35
+ __properties: ClassVar[List[str]] = ["ra", "dec", "contours", "probability_enclosed"]
36
+
37
+ model_config = ConfigDict(
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
40
+ validate_assignment=True,
41
+ protected_namespaces=(),
42
+ )
43
+
44
+
45
+ def to_str(self) -> str:
46
+ """Returns the string representation of the model using alias"""
47
+ return pprint.pformat(self.model_dump(by_alias=True))
48
+
49
+ def to_json(self) -> str:
50
+ """Returns the JSON representation of the model using alias"""
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
52
+
53
+ @classmethod
54
+ def from_json(cls, json_str: str) -> Optional[Self]:
55
+ """Create an instance of LocalizationCreate from a JSON string"""
56
+ return cls.from_dict(json.loads(json_str))
57
+
58
+ def to_dict(self) -> Dict[str, Any]:
59
+ """Return the dictionary representation of the model using alias.
60
+
61
+ This has the following differences from calling pydantic's
62
+ `self.model_dump(by_alias=True)`:
63
+
64
+ * `None` is only added to the output dict for nullable fields that
65
+ were set at model initialization. Other fields with value `None`
66
+ are ignored.
67
+ """
68
+ excluded_fields: Set[str] = set([
69
+ ])
70
+
71
+ _dict = self.model_dump(
72
+ by_alias=True,
73
+ exclude=excluded_fields,
74
+ exclude_none=True,
75
+ )
76
+ # override the default output from pydantic by calling `to_dict()` of each item in contours (list)
77
+ _items = []
78
+ if self.contours:
79
+ for _item_contours in self.contours:
80
+ _items.append(_item_contours.to_dict() if _item_contours is not None else None)
81
+ _dict['contours'] = _items
82
+ # set to None if ra (nullable) is None
83
+ # and model_fields_set contains the field
84
+ if self.ra is None and "ra" in self.model_fields_set:
85
+ _dict['ra'] = None
86
+
87
+ # set to None if dec (nullable) is None
88
+ # and model_fields_set contains the field
89
+ if self.dec is None and "dec" in self.model_fields_set:
90
+ _dict['dec'] = None
91
+
92
+ # set to None if contours (nullable) is None
93
+ # and model_fields_set contains the field
94
+ if self.contours is None and "contours" in self.model_fields_set:
95
+ _dict['contours'] = None
96
+
97
+ # set to None if probability_enclosed (nullable) is None
98
+ # and model_fields_set contains the field
99
+ if self.probability_enclosed is None and "probability_enclosed" in self.model_fields_set:
100
+ _dict['probability_enclosed'] = None
101
+
102
+ return _dict
103
+
104
+ @classmethod
105
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
106
+ """Create an instance of LocalizationCreate from a dict"""
107
+ if obj is None:
108
+ return None
109
+
110
+ if not isinstance(obj, dict):
111
+ return cls.model_validate(obj)
112
+
113
+ _obj = cls.model_validate({
114
+ "ra": obj.get("ra"),
115
+ "dec": obj.get("dec"),
116
+ "contours": [LocalizationContourBase.from_dict(_item) for _item in obj["contours"]] if obj.get("contours") is not None else None,
117
+ "probability_enclosed": obj.get("probability_enclosed")
118
+ })
119
+ return _obj
120
+
121
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -21,6 +21,7 @@ from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
21
21
  from typing import Any, ClassVar, Dict, List, Union
22
22
  from typing import Optional, Set
23
23
  from typing_extensions import Self
24
+ from pydantic_core import to_jsonable_python
24
25
 
25
26
  class NameResolver(BaseModel):
26
27
  """
@@ -32,7 +33,8 @@ class NameResolver(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["ra", "dec", "resolver"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -44,8 +46,7 @@ class NameResolver(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -22,6 +22,7 @@ from pydantic import BaseModel, ConfigDict
22
22
  from typing import Any, ClassVar, Dict, List, Optional
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
25
26
 
26
27
  class NullableDateRange(BaseModel):
27
28
  """
@@ -32,7 +33,8 @@ class NullableDateRange(BaseModel):
32
33
  __properties: ClassVar[List[str]] = ["begin", "end"]
33
34
 
34
35
  model_config = ConfigDict(
35
- populate_by_name=True,
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
36
38
  validate_assignment=True,
37
39
  protected_namespaces=(),
38
40
  )
@@ -44,8 +46,7 @@ class NullableDateRange(BaseModel):
44
46
 
45
47
  def to_json(self) -> str:
46
48
  """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
+ return json.dumps(to_jsonable_python(self.to_dict()))
49
50
 
50
51
  @classmethod
51
52
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -0,0 +1,96 @@
1
+ # coding: utf-8
2
+
3
+ """
4
+ ACROSS Server
5
+
6
+ Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
+
8
+ The version of the OpenAPI document: 2.0.2
9
+ Generated by OpenAPI Generator (https://openapi-generator.tech)
10
+
11
+ Do not edit the class manually.
12
+ """ # noqa: E501
13
+
14
+
15
+ from __future__ import annotations
16
+ import pprint
17
+ import re # noqa: F401
18
+ import json
19
+
20
+ from datetime import datetime
21
+ from pydantic import BaseModel, ConfigDict
22
+ from typing import Any, ClassVar, Dict, List, Optional
23
+ from typing import Optional, Set
24
+ from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
26
+
27
+ class NullableEndDateRange(BaseModel):
28
+ """
29
+ NullableEndDateRange
30
+ """ # noqa: E501
31
+ begin: datetime
32
+ end: Optional[datetime] = None
33
+ __properties: ClassVar[List[str]] = ["begin", "end"]
34
+
35
+ model_config = ConfigDict(
36
+ validate_by_name=True,
37
+ validate_by_alias=True,
38
+ validate_assignment=True,
39
+ protected_namespaces=(),
40
+ )
41
+
42
+
43
+ def to_str(self) -> str:
44
+ """Returns the string representation of the model using alias"""
45
+ return pprint.pformat(self.model_dump(by_alias=True))
46
+
47
+ def to_json(self) -> str:
48
+ """Returns the JSON representation of the model using alias"""
49
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
+
51
+ @classmethod
52
+ def from_json(cls, json_str: str) -> Optional[Self]:
53
+ """Create an instance of NullableEndDateRange from a JSON string"""
54
+ return cls.from_dict(json.loads(json_str))
55
+
56
+ def to_dict(self) -> Dict[str, Any]:
57
+ """Return the dictionary representation of the model using alias.
58
+
59
+ This has the following differences from calling pydantic's
60
+ `self.model_dump(by_alias=True)`:
61
+
62
+ * `None` is only added to the output dict for nullable fields that
63
+ were set at model initialization. Other fields with value `None`
64
+ are ignored.
65
+ """
66
+ excluded_fields: Set[str] = set([
67
+ ])
68
+
69
+ _dict = self.model_dump(
70
+ by_alias=True,
71
+ exclude=excluded_fields,
72
+ exclude_none=True,
73
+ )
74
+ # set to None if end (nullable) is None
75
+ # and model_fields_set contains the field
76
+ if self.end is None and "end" in self.model_fields_set:
77
+ _dict['end'] = None
78
+
79
+ return _dict
80
+
81
+ @classmethod
82
+ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
83
+ """Create an instance of NullableEndDateRange from a dict"""
84
+ if obj is None:
85
+ return None
86
+
87
+ if not isinstance(obj, dict):
88
+ return cls.model_validate(obj)
89
+
90
+ _obj = cls.model_validate({
91
+ "begin": obj.get("begin"),
92
+ "end": obj.get("end")
93
+ })
94
+ return _obj
95
+
96
+
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -20,6 +20,7 @@ import json
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from uuid import UUID
23
24
  from across.sdk.v1.models.bandpass import Bandpass
24
25
  from across.sdk.v1.models.coordinate import Coordinate
25
26
  from across.sdk.v1.models.date_range import DateRange
@@ -31,12 +32,13 @@ from across.sdk.v1.models.observation_type import ObservationType
31
32
  from across.sdk.v1.models.unit_value import UnitValue
32
33
  from typing import Optional, Set
33
34
  from typing_extensions import Self
35
+ from pydantic_core import to_jsonable_python
34
36
 
35
37
  class Observation(BaseModel):
36
38
  """
37
39
  Observation
38
40
  """ # noqa: E501
39
- instrument_id: StrictStr
41
+ instrument_id: UUID
40
42
  object_name: StrictStr
41
43
  pointing_position: Optional[Coordinate] = None
42
44
  date_range: DateRange
@@ -59,15 +61,16 @@ class Observation(BaseModel):
59
61
  category: Optional[IVOAObsCategory] = None
60
62
  priority: Optional[StrictInt] = None
61
63
  tracking_type: Optional[IVOAObsTrackingType] = None
62
- id: StrictStr
63
- schedule_id: StrictStr
64
+ id: UUID
65
+ schedule_id: UUID
64
66
  created_on: datetime
65
- created_by_id: Optional[StrictStr] = None
67
+ created_by_id: Optional[UUID] = None
66
68
  footprint: Optional[List[ObservationFootprint]] = None
67
69
  __properties: ClassVar[List[str]] = ["instrument_id", "object_name", "pointing_position", "date_range", "external_observation_id", "type", "status", "pointing_angle", "exposure_time", "reason", "description", "proposal_reference", "object_position", "depth", "bandpass", "t_resolution", "em_res_power", "o_ucd", "pol_states", "pol_xel", "category", "priority", "tracking_type", "id", "schedule_id", "created_on", "created_by_id", "footprint"]
68
70
 
69
71
  model_config = ConfigDict(
70
- populate_by_name=True,
72
+ validate_by_name=True,
73
+ validate_by_alias=True,
71
74
  validate_assignment=True,
72
75
  protected_namespaces=(),
73
76
  )
@@ -79,8 +82,7 @@ class Observation(BaseModel):
79
82
 
80
83
  def to_json(self) -> str:
81
84
  """Returns the JSON representation of the model using alias"""
82
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
83
- return json.dumps(self.to_dict())
85
+ return json.dumps(to_jsonable_python(self.to_dict()))
84
86
 
85
87
  @classmethod
86
88
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -124,8 +126,7 @@ class Observation(BaseModel):
124
126
  _items = []
125
127
  if self.footprint:
126
128
  for _item_footprint in self.footprint:
127
- if _item_footprint:
128
- _items.append(_item_footprint.to_dict())
129
+ _items.append(_item_footprint.to_dict() if _item_footprint is not None else None)
129
130
  _dict['footprint'] = _items
130
131
  # set to None if pointing_position (nullable) is None
131
132
  # and model_fields_set contains the field
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -20,6 +20,7 @@ import json
20
20
  from datetime import datetime
21
21
  from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt, StrictStr
22
22
  from typing import Any, ClassVar, Dict, List, Optional, Union
23
+ from uuid import UUID
23
24
  from across.sdk.v1.models.bandpass import Bandpass
24
25
  from across.sdk.v1.models.coordinate import Coordinate
25
26
  from across.sdk.v1.models.date_range import DateRange
@@ -31,12 +32,13 @@ from across.sdk.v1.models.observation_type import ObservationType
31
32
  from across.sdk.v1.models.unit_value import UnitValue
32
33
  from typing import Optional, Set
33
34
  from typing_extensions import Self
35
+ from pydantic_core import to_jsonable_python
34
36
 
35
37
  class ObservationCreate(BaseModel):
36
38
  """
37
39
  ObservationCreate
38
40
  """ # noqa: E501
39
- instrument_id: StrictStr
41
+ instrument_id: UUID
40
42
  object_name: StrictStr
41
43
  pointing_position: Optional[Coordinate] = None
42
44
  date_range: DateRange
@@ -60,12 +62,13 @@ class ObservationCreate(BaseModel):
60
62
  priority: Optional[StrictInt] = None
61
63
  tracking_type: Optional[IVOAObsTrackingType] = None
62
64
  created_on: Optional[datetime] = None
63
- created_by_id: Optional[StrictStr] = None
65
+ created_by_id: Optional[UUID] = None
64
66
  footprint: Optional[List[ObservationFootprintCreate]] = None
65
67
  __properties: ClassVar[List[str]] = ["instrument_id", "object_name", "pointing_position", "date_range", "external_observation_id", "type", "status", "pointing_angle", "exposure_time", "reason", "description", "proposal_reference", "object_position", "depth", "bandpass", "t_resolution", "em_res_power", "o_ucd", "pol_states", "pol_xel", "category", "priority", "tracking_type", "created_on", "created_by_id", "footprint"]
66
68
 
67
69
  model_config = ConfigDict(
68
- populate_by_name=True,
70
+ validate_by_name=True,
71
+ validate_by_alias=True,
69
72
  validate_assignment=True,
70
73
  protected_namespaces=(),
71
74
  )
@@ -77,8 +80,7 @@ class ObservationCreate(BaseModel):
77
80
 
78
81
  def to_json(self) -> str:
79
82
  """Returns the JSON representation of the model using alias"""
80
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
81
- return json.dumps(self.to_dict())
83
+ return json.dumps(to_jsonable_python(self.to_dict()))
82
84
 
83
85
  @classmethod
84
86
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -122,8 +124,7 @@ class ObservationCreate(BaseModel):
122
124
  _items = []
123
125
  if self.footprint:
124
126
  for _item_footprint in self.footprint:
125
- if _item_footprint:
126
- _items.append(_item_footprint.to_dict())
127
+ _items.append(_item_footprint.to_dict() if _item_footprint is not None else None)
127
128
  _dict['footprint'] = _items
128
129
  # set to None if pointing_position (nullable) is None
129
130
  # and model_fields_set contains the field
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -17,23 +17,26 @@ import pprint
17
17
  import re # noqa: F401
18
18
  import json
19
19
 
20
- from pydantic import BaseModel, ConfigDict, StrictStr
20
+ from pydantic import BaseModel, ConfigDict
21
21
  from typing import Any, ClassVar, Dict, List
22
+ from uuid import UUID
22
23
  from across.sdk.v1.models.point import Point
23
24
  from typing import Optional, Set
24
25
  from typing_extensions import Self
26
+ from pydantic_core import to_jsonable_python
25
27
 
26
28
  class ObservationFootprint(BaseModel):
27
29
  """
28
30
  A Pydantic model class representing a created ObservationFootprint Notes ----- Inherits from ObservationFootprintBase Methods ------- from_orm(obj: ObservationFootprintModel) -> ObservationFootprint Static method that instantiates this class from an observation footprint database record
29
31
  """ # noqa: E501
30
32
  polygon: List[Point]
31
- id: StrictStr
32
- observation_id: StrictStr
33
+ id: UUID
34
+ observation_id: UUID
33
35
  __properties: ClassVar[List[str]] = ["polygon", "id", "observation_id"]
34
36
 
35
37
  model_config = ConfigDict(
36
- populate_by_name=True,
38
+ validate_by_name=True,
39
+ validate_by_alias=True,
37
40
  validate_assignment=True,
38
41
  protected_namespaces=(),
39
42
  )
@@ -45,8 +48,7 @@ class ObservationFootprint(BaseModel):
45
48
 
46
49
  def to_json(self) -> str:
47
50
  """Returns the JSON representation of the model using alias"""
48
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
49
- return json.dumps(self.to_dict())
51
+ return json.dumps(to_jsonable_python(self.to_dict()))
50
52
 
51
53
  @classmethod
52
54
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -75,8 +77,7 @@ class ObservationFootprint(BaseModel):
75
77
  _items = []
76
78
  if self.polygon:
77
79
  for _item_polygon in self.polygon:
78
- if _item_polygon:
79
- _items.append(_item_polygon.to_dict())
80
+ _items.append(_item_polygon.to_dict() if _item_polygon is not None else None)
80
81
  _dict['polygon'] = _items
81
82
  return _dict
82
83
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  Server providing tools and utilities for various NASA missions to aid in coordination of large observation efforts.
7
7
 
8
- The version of the OpenAPI document: 1.4.0
8
+ The version of the OpenAPI document: 2.0.2
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -22,6 +22,7 @@ from typing import Any, ClassVar, Dict, List
22
22
  from across.sdk.v1.models.point import Point
23
23
  from typing import Optional, Set
24
24
  from typing_extensions import Self
25
+ from pydantic_core import to_jsonable_python
25
26
 
26
27
  class ObservationFootprintCreate(BaseModel):
27
28
  """
@@ -31,7 +32,8 @@ class ObservationFootprintCreate(BaseModel):
31
32
  __properties: ClassVar[List[str]] = ["polygon"]
32
33
 
33
34
  model_config = ConfigDict(
34
- populate_by_name=True,
35
+ validate_by_name=True,
36
+ validate_by_alias=True,
35
37
  validate_assignment=True,
36
38
  protected_namespaces=(),
37
39
  )
@@ -43,8 +45,7 @@ class ObservationFootprintCreate(BaseModel):
43
45
 
44
46
  def to_json(self) -> str:
45
47
  """Returns the JSON representation of the model using alias"""
46
- # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
47
- return json.dumps(self.to_dict())
48
+ return json.dumps(to_jsonable_python(self.to_dict()))
48
49
 
49
50
  @classmethod
50
51
  def from_json(cls, json_str: str) -> Optional[Self]:
@@ -73,8 +74,7 @@ class ObservationFootprintCreate(BaseModel):
73
74
  _items = []
74
75
  if self.polygon:
75
76
  for _item_polygon in self.polygon:
76
- if _item_polygon:
77
- _items.append(_item_polygon.to_dict())
77
+ _items.append(_item_polygon.to_dict() if _item_polygon is not None else None)
78
78
  _dict['polygon'] = _items
79
79
  return _dict
80
80