aind-metadata-service-async-client 1.1.4__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.

Potentially problematic release.


This version of aind-metadata-service-async-client might be problematic. Click here for more details.

Files changed (31) hide show
  1. aind_metadata_service_async_client/__init__.py +2 -15
  2. aind_metadata_service_async_client/api/default_api.py +437 -175
  3. aind_metadata_service_async_client/api/healthcheck_api.py +2 -2
  4. aind_metadata_service_async_client/api_client.py +2 -2
  5. aind_metadata_service_async_client/configuration.py +3 -3
  6. aind_metadata_service_async_client/exceptions.py +1 -1
  7. aind_metadata_service_async_client/models/__init__.py +1 -14
  8. aind_metadata_service_async_client/models/health_check.py +3 -3
  9. aind_metadata_service_async_client/models/http_validation_error.py +1 -1
  10. aind_metadata_service_async_client/models/slims_workflow.py +1 -1
  11. aind_metadata_service_async_client/models/validation_error.py +1 -1
  12. aind_metadata_service_async_client/models/validation_error_loc_inner.py +1 -1
  13. aind_metadata_service_async_client/rest.py +1 -1
  14. {aind_metadata_service_async_client-1.1.4.dist-info → aind_metadata_service_async_client-2.0.0.dist-info}/METADATA +1 -1
  15. aind_metadata_service_async_client-2.0.0.dist-info/RECORD +20 -0
  16. aind_metadata_service_async_client/models/anyof_schema1_validator.py +0 -144
  17. aind_metadata_service_async_client/models/average_hit_rate.py +0 -144
  18. aind_metadata_service_async_client/models/fov_coordinate_ap.py +0 -144
  19. aind_metadata_service_async_client/models/fov_coordinate_ml.py +0 -112
  20. aind_metadata_service_async_client/models/hit_rate_trials010.py +0 -144
  21. aind_metadata_service_async_client/models/hit_rate_trials2040.py +0 -144
  22. aind_metadata_service_async_client/models/input_source.py +0 -122
  23. aind_metadata_service_async_client/models/job_settings.py +0 -369
  24. aind_metadata_service_async_client/models/job_settings_starting_lickport_position_inner.py +0 -138
  25. aind_metadata_service_async_client/models/output_directory.py +0 -108
  26. aind_metadata_service_async_client/models/total_hits.py +0 -144
  27. aind_metadata_service_async_client/models/trial_num.py +0 -144
  28. aind_metadata_service_async_client/models/user_settings_config_file.py +0 -108
  29. aind_metadata_service_async_client-1.1.4.dist-info/RECORD +0 -33
  30. {aind_metadata_service_async_client-1.1.4.dist-info → aind_metadata_service_async_client-2.0.0.dist-info}/WHEEL +0 -0
  31. {aind_metadata_service_async_client-1.1.4.dist-info → aind_metadata_service_async_client-2.0.0.dist-info}/top_level.txt +0 -0
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -265,7 +265,7 @@ class HealthcheckApi:
265
265
 
266
266
  return self.api_client.param_serialize(
267
267
  method='GET',
268
- resource_path='/healthcheck',
268
+ resource_path='/api/v2/healthcheck',
269
269
  path_params=_path_params,
270
270
  query_params=_query_params,
271
271
  header_params=_header_params,
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -90,7 +90,7 @@ class ApiClient:
90
90
  self.default_headers[header_name] = header_value
91
91
  self.cookie = cookie
92
92
  # Set default User-Agent.
93
- self.user_agent = 'OpenAPI-Generator/1.1.4/python'
93
+ self.user_agent = 'OpenAPI-Generator/2.0.0/python'
94
94
  self.client_side_validation = configuration.client_side_validation
95
95
 
96
96
  async def __aenter__(self):
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -496,8 +496,8 @@ class Configuration:
496
496
  return "Python SDK Debug Report:\n"\
497
497
  "OS: {env}\n"\
498
498
  "Python Version: {pyversion}\n"\
499
- "Version of the API: 1.1.4\n"\
500
- "SDK Package Version: 1.1.4".\
499
+ "Version of the API: 2.0.0\n"\
500
+ "SDK Package Version: 2.0.0".\
501
501
  format(env=sys.platform, pyversion=sys.version)
502
502
 
503
503
  def get_host_settings(self) -> List[HostSetting]:
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -6,7 +6,7 @@
6
6
 
7
7
  ## aind-metadata-service Service to pull data from example backend.
8
8
 
9
- The version of the OpenAPI document: 1.1.4
9
+ The version of the OpenAPI document: 2.0.0
10
10
  Generated by OpenAPI Generator (https://openapi-generator.tech)
11
11
 
12
12
  Do not edit the class manually.
@@ -14,21 +14,8 @@
14
14
 
15
15
 
16
16
  # import models into model package
17
- from aind_metadata_service_async_client.models.anyof_schema1_validator import AnyofSchema1Validator
18
- from aind_metadata_service_async_client.models.average_hit_rate import AverageHitRate
19
- from aind_metadata_service_async_client.models.fov_coordinate_ap import FovCoordinateAp
20
- from aind_metadata_service_async_client.models.fov_coordinate_ml import FovCoordinateMl
21
17
  from aind_metadata_service_async_client.models.http_validation_error import HTTPValidationError
22
18
  from aind_metadata_service_async_client.models.health_check import HealthCheck
23
- from aind_metadata_service_async_client.models.hit_rate_trials010 import HitRateTrials010
24
- from aind_metadata_service_async_client.models.hit_rate_trials2040 import HitRateTrials2040
25
- from aind_metadata_service_async_client.models.input_source import InputSource
26
- from aind_metadata_service_async_client.models.job_settings import JobSettings
27
- from aind_metadata_service_async_client.models.job_settings_starting_lickport_position_inner import JobSettingsStartingLickportPositionInner
28
- from aind_metadata_service_async_client.models.output_directory import OutputDirectory
29
19
  from aind_metadata_service_async_client.models.slims_workflow import SlimsWorkflow
30
- from aind_metadata_service_async_client.models.total_hits import TotalHits
31
- from aind_metadata_service_async_client.models.trial_num import TrialNum
32
- from aind_metadata_service_async_client.models.user_settings_config_file import UserSettingsConfigFile
33
20
  from aind_metadata_service_async_client.models.validation_error import ValidationError
34
21
  from aind_metadata_service_async_client.models.validation_error_loc_inner import ValidationErrorLocInner
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -27,7 +27,7 @@ class HealthCheck(BaseModel):
27
27
  Response model to validate and return when performing a health check.
28
28
  """ # noqa: E501
29
29
  status: Optional[StrictStr] = 'OK'
30
- service_version: Optional[StrictStr] = '1.1.4'
30
+ service_version: Optional[StrictStr] = '2.0.0'
31
31
  __properties: ClassVar[List[str]] = ["status", "service_version"]
32
32
 
33
33
  @field_validator('status')
@@ -92,7 +92,7 @@ class HealthCheck(BaseModel):
92
92
 
93
93
  _obj = cls.model_validate({
94
94
  "status": obj.get("status") if obj.get("status") is not None else 'OK',
95
- "service_version": obj.get("service_version") if obj.get("service_version") is not None else '1.1.4'
95
+ "service_version": obj.get("service_version") if obj.get("service_version") is not None else '2.0.0'
96
96
  })
97
97
  return _obj
98
98
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
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
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
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
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
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
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
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
  ## aind-metadata-service Service to pull data from example backend.
7
7
 
8
- The version of the OpenAPI document: 1.1.4
8
+ The version of the OpenAPI document: 2.0.0
9
9
  Generated by OpenAPI Generator (https://openapi-generator.tech)
10
10
 
11
11
  Do not edit the class manually.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: aind-metadata-service-async-client
3
- Version: 1.1.4
3
+ Version: 2.0.0
4
4
  Summary: aind-metadata-service
5
5
  Home-page:
6
6
  Author: OpenAPI Generator community
@@ -0,0 +1,20 @@
1
+ aind_metadata_service_async_client/__init__.py,sha256=mBvjFH_6gKTutuFQgWnY16g_MneSik8wymLLKKZkuw0,1677
2
+ aind_metadata_service_async_client/api_client.py,sha256=bXOvb6TKMc4baxI21mVyaZAqXeaYVo4omIHIesAkrf8,27680
3
+ aind_metadata_service_async_client/api_response.py,sha256=eMxw1mpmJcoGZ3gs9z6jM4oYoZ10Gjk333s9sKxGv7s,652
4
+ aind_metadata_service_async_client/configuration.py,sha256=vlWoSiSQ4GnbqP1l_gSPcKYK3HfbOeIgeucL4LTOxJY,17633
5
+ aind_metadata_service_async_client/exceptions.py,sha256=oXGuICvlFT83Cgb6SN9SKchj9OTfjVZR52KOl36jGz8,6450
6
+ aind_metadata_service_async_client/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
+ aind_metadata_service_async_client/rest.py,sha256=SEFpPTriEpxZOAq22WjHU5CMp6M8F5tOyHw624mNa6g,7291
8
+ aind_metadata_service_async_client/api/__init__.py,sha256=d96ze7sPL5kXXzyh_qEhQY8xwPQP7HlPQzA_hU2u4Ck,204
9
+ aind_metadata_service_async_client/api/default_api.py,sha256=gS14yBMb6g_-hmJ6CwQ461ADBP_AQKkIf2K-gimQ8zU,155518
10
+ aind_metadata_service_async_client/api/healthcheck_api.py,sha256=EYoyf07ciqlXNvqHAUQ1h3LyfFMHx9PhSuSxzkAjBgY,10649
11
+ aind_metadata_service_async_client/models/__init__.py,sha256=5214P2kSiiQRSyuIjhRHnQFK2BHCEXNpXQXHw6ZRiKg,797
12
+ aind_metadata_service_async_client/models/health_check.py,sha256=aFLmc5Nvi4Saq5ejdKWzc2xlwgsO1Q2Hx0Ya654DVc8,3059
13
+ aind_metadata_service_async_client/models/http_validation_error.py,sha256=uM492j3jIB_13xX9x83qLOma_j_8BqgOjVspNhuruA4,3003
14
+ aind_metadata_service_async_client/models/slims_workflow.py,sha256=I5LnKzTyYEKdrtmr-z8f1d7_-32MMCrrz0m2FyS53-g,914
15
+ aind_metadata_service_async_client/models/validation_error.py,sha256=6yVLKpx_SiHaVmfjNkNTy_fBxHY4VojHtuQHqXZgxOQ,3095
16
+ aind_metadata_service_async_client/models/validation_error_loc_inner.py,sha256=e5aNAHIp72Acbhd3IlGf959XoDIef2C0fkm4_T0D2_c,4864
17
+ aind_metadata_service_async_client-2.0.0.dist-info/METADATA,sha256=N_BQnNEwOjYLid6BfqckD4WOMTGwvB7hFHTJUvc2m4g,732
18
+ aind_metadata_service_async_client-2.0.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
19
+ aind_metadata_service_async_client-2.0.0.dist-info/top_level.txt,sha256=qZsXHVGh-0uni82lQ-rEHhHR5xE4vTvVjd5Km-m4GJE,35
20
+ aind_metadata_service_async_client-2.0.0.dist-info/RECORD,,
@@ -1,144 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- aind-metadata-service
5
-
6
- ## aind-metadata-service Service to pull data from example backend.
7
-
8
- The version of the OpenAPI document: 1.1.4
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, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
21
- from typing import Optional, Union
22
- from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
- from typing_extensions import Literal, Self
24
- from pydantic import Field
25
-
26
- ANYOFSCHEMA1VALIDATOR_ANY_OF_SCHEMAS = ["float", "int"]
27
-
28
- class AnyofSchema1Validator(BaseModel):
29
- """
30
- AnyofSchema1Validator
31
- """
32
-
33
- # data type: float
34
- anyof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None
35
- # data type: int
36
- anyof_schema_2_validator: Optional[StrictInt] = None
37
- if TYPE_CHECKING:
38
- actual_instance: Optional[Union[float, int]] = None
39
- else:
40
- actual_instance: Any = None
41
- any_of_schemas: Set[str] = { "float", "int" }
42
-
43
- model_config = {
44
- "validate_assignment": True,
45
- "protected_namespaces": (),
46
- }
47
-
48
- def __init__(self, *args, **kwargs) -> None:
49
- if args:
50
- if len(args) > 1:
51
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
- if kwargs:
53
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
- super().__init__(actual_instance=args[0])
55
- else:
56
- super().__init__(**kwargs)
57
-
58
- @field_validator('actual_instance')
59
- def actual_instance_must_validate_anyof(cls, v):
60
- if v is None:
61
- return v
62
-
63
- instance = AnyofSchema1Validator.model_construct()
64
- error_messages = []
65
- # validate data type: float
66
- try:
67
- instance.anyof_schema_1_validator = v
68
- return v
69
- except (ValidationError, ValueError) as e:
70
- error_messages.append(str(e))
71
- # validate data type: int
72
- try:
73
- instance.anyof_schema_2_validator = v
74
- return v
75
- except (ValidationError, ValueError) as e:
76
- error_messages.append(str(e))
77
- if error_messages:
78
- # no match
79
- raise ValueError("No match found when setting the actual_instance in AnyofSchema1Validator with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
80
- else:
81
- return v
82
-
83
- @classmethod
84
- def from_dict(cls, obj: Dict[str, Any]) -> Self:
85
- return cls.from_json(json.dumps(obj))
86
-
87
- @classmethod
88
- def from_json(cls, json_str: str) -> Self:
89
- """Returns the object represented by the json string"""
90
- instance = cls.model_construct()
91
- if json_str is None:
92
- return instance
93
-
94
- error_messages = []
95
- # deserialize data into float
96
- try:
97
- # validation
98
- instance.anyof_schema_1_validator = json.loads(json_str)
99
- # assign value to actual_instance
100
- instance.actual_instance = instance.anyof_schema_1_validator
101
- return instance
102
- except (ValidationError, ValueError) as e:
103
- error_messages.append(str(e))
104
- # deserialize data into int
105
- try:
106
- # validation
107
- instance.anyof_schema_2_validator = json.loads(json_str)
108
- # assign value to actual_instance
109
- instance.actual_instance = instance.anyof_schema_2_validator
110
- return instance
111
- except (ValidationError, ValueError) as e:
112
- error_messages.append(str(e))
113
-
114
- if error_messages:
115
- # no match
116
- raise ValueError("No match found when deserializing the JSON string into AnyofSchema1Validator with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
117
- else:
118
- return instance
119
-
120
- def to_json(self) -> str:
121
- """Returns the JSON representation of the actual instance"""
122
- if self.actual_instance is None:
123
- return "null"
124
-
125
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
126
- return self.actual_instance.to_json()
127
- else:
128
- return json.dumps(self.actual_instance)
129
-
130
- def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]:
131
- """Returns the dict representation of the actual instance"""
132
- if self.actual_instance is None:
133
- return None
134
-
135
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
136
- return self.actual_instance.to_dict()
137
- else:
138
- return self.actual_instance
139
-
140
- def to_str(self) -> str:
141
- """Returns the string representation of the actual instance"""
142
- return pprint.pformat(self.model_dump())
143
-
144
-
@@ -1,144 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- aind-metadata-service
5
-
6
- ## aind-metadata-service Service to pull data from example backend.
7
-
8
- The version of the OpenAPI document: 1.1.4
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, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
21
- from typing import Optional, Union
22
- from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
- from typing_extensions import Literal, Self
24
- from pydantic import Field
25
-
26
- AVERAGEHITRATE_ANY_OF_SCHEMAS = ["float", "int"]
27
-
28
- class AverageHitRate(BaseModel):
29
- """
30
- AverageHitRate
31
- """
32
-
33
- # data type: float
34
- anyof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None
35
- # data type: int
36
- anyof_schema_2_validator: Optional[StrictInt] = None
37
- if TYPE_CHECKING:
38
- actual_instance: Optional[Union[float, int]] = None
39
- else:
40
- actual_instance: Any = None
41
- any_of_schemas: Set[str] = { "float", "int" }
42
-
43
- model_config = {
44
- "validate_assignment": True,
45
- "protected_namespaces": (),
46
- }
47
-
48
- def __init__(self, *args, **kwargs) -> None:
49
- if args:
50
- if len(args) > 1:
51
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
- if kwargs:
53
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
- super().__init__(actual_instance=args[0])
55
- else:
56
- super().__init__(**kwargs)
57
-
58
- @field_validator('actual_instance')
59
- def actual_instance_must_validate_anyof(cls, v):
60
- if v is None:
61
- return v
62
-
63
- instance = AverageHitRate.model_construct()
64
- error_messages = []
65
- # validate data type: float
66
- try:
67
- instance.anyof_schema_1_validator = v
68
- return v
69
- except (ValidationError, ValueError) as e:
70
- error_messages.append(str(e))
71
- # validate data type: int
72
- try:
73
- instance.anyof_schema_2_validator = v
74
- return v
75
- except (ValidationError, ValueError) as e:
76
- error_messages.append(str(e))
77
- if error_messages:
78
- # no match
79
- raise ValueError("No match found when setting the actual_instance in AverageHitRate with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
80
- else:
81
- return v
82
-
83
- @classmethod
84
- def from_dict(cls, obj: Dict[str, Any]) -> Self:
85
- return cls.from_json(json.dumps(obj))
86
-
87
- @classmethod
88
- def from_json(cls, json_str: str) -> Self:
89
- """Returns the object represented by the json string"""
90
- instance = cls.model_construct()
91
- if json_str is None:
92
- return instance
93
-
94
- error_messages = []
95
- # deserialize data into float
96
- try:
97
- # validation
98
- instance.anyof_schema_1_validator = json.loads(json_str)
99
- # assign value to actual_instance
100
- instance.actual_instance = instance.anyof_schema_1_validator
101
- return instance
102
- except (ValidationError, ValueError) as e:
103
- error_messages.append(str(e))
104
- # deserialize data into int
105
- try:
106
- # validation
107
- instance.anyof_schema_2_validator = json.loads(json_str)
108
- # assign value to actual_instance
109
- instance.actual_instance = instance.anyof_schema_2_validator
110
- return instance
111
- except (ValidationError, ValueError) as e:
112
- error_messages.append(str(e))
113
-
114
- if error_messages:
115
- # no match
116
- raise ValueError("No match found when deserializing the JSON string into AverageHitRate with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
117
- else:
118
- return instance
119
-
120
- def to_json(self) -> str:
121
- """Returns the JSON representation of the actual instance"""
122
- if self.actual_instance is None:
123
- return "null"
124
-
125
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
126
- return self.actual_instance.to_json()
127
- else:
128
- return json.dumps(self.actual_instance)
129
-
130
- def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]:
131
- """Returns the dict representation of the actual instance"""
132
- if self.actual_instance is None:
133
- return None
134
-
135
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
136
- return self.actual_instance.to_dict()
137
- else:
138
- return self.actual_instance
139
-
140
- def to_str(self) -> str:
141
- """Returns the string representation of the actual instance"""
142
- return pprint.pformat(self.model_dump())
143
-
144
-
@@ -1,144 +0,0 @@
1
- # coding: utf-8
2
-
3
- """
4
- aind-metadata-service
5
-
6
- ## aind-metadata-service Service to pull data from example backend.
7
-
8
- The version of the OpenAPI document: 1.1.4
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, StrictFloat, StrictInt, StrictStr, ValidationError, field_validator
21
- from typing import Optional, Union
22
- from typing import Union, Any, List, Set, TYPE_CHECKING, Optional, Dict
23
- from typing_extensions import Literal, Self
24
- from pydantic import Field
25
-
26
- FOVCOORDINATEAP_ANY_OF_SCHEMAS = ["float", "int"]
27
-
28
- class FovCoordinateAp(BaseModel):
29
- """
30
- FovCoordinateAp
31
- """
32
-
33
- # data type: float
34
- anyof_schema_1_validator: Optional[Union[StrictFloat, StrictInt]] = None
35
- # data type: int
36
- anyof_schema_2_validator: Optional[StrictInt] = None
37
- if TYPE_CHECKING:
38
- actual_instance: Optional[Union[float, int]] = None
39
- else:
40
- actual_instance: Any = None
41
- any_of_schemas: Set[str] = { "float", "int" }
42
-
43
- model_config = {
44
- "validate_assignment": True,
45
- "protected_namespaces": (),
46
- }
47
-
48
- def __init__(self, *args, **kwargs) -> None:
49
- if args:
50
- if len(args) > 1:
51
- raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`")
52
- if kwargs:
53
- raise ValueError("If a position argument is used, keyword arguments cannot be used.")
54
- super().__init__(actual_instance=args[0])
55
- else:
56
- super().__init__(**kwargs)
57
-
58
- @field_validator('actual_instance')
59
- def actual_instance_must_validate_anyof(cls, v):
60
- if v is None:
61
- return v
62
-
63
- instance = FovCoordinateAp.model_construct()
64
- error_messages = []
65
- # validate data type: float
66
- try:
67
- instance.anyof_schema_1_validator = v
68
- return v
69
- except (ValidationError, ValueError) as e:
70
- error_messages.append(str(e))
71
- # validate data type: int
72
- try:
73
- instance.anyof_schema_2_validator = v
74
- return v
75
- except (ValidationError, ValueError) as e:
76
- error_messages.append(str(e))
77
- if error_messages:
78
- # no match
79
- raise ValueError("No match found when setting the actual_instance in FovCoordinateAp with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
80
- else:
81
- return v
82
-
83
- @classmethod
84
- def from_dict(cls, obj: Dict[str, Any]) -> Self:
85
- return cls.from_json(json.dumps(obj))
86
-
87
- @classmethod
88
- def from_json(cls, json_str: str) -> Self:
89
- """Returns the object represented by the json string"""
90
- instance = cls.model_construct()
91
- if json_str is None:
92
- return instance
93
-
94
- error_messages = []
95
- # deserialize data into float
96
- try:
97
- # validation
98
- instance.anyof_schema_1_validator = json.loads(json_str)
99
- # assign value to actual_instance
100
- instance.actual_instance = instance.anyof_schema_1_validator
101
- return instance
102
- except (ValidationError, ValueError) as e:
103
- error_messages.append(str(e))
104
- # deserialize data into int
105
- try:
106
- # validation
107
- instance.anyof_schema_2_validator = json.loads(json_str)
108
- # assign value to actual_instance
109
- instance.actual_instance = instance.anyof_schema_2_validator
110
- return instance
111
- except (ValidationError, ValueError) as e:
112
- error_messages.append(str(e))
113
-
114
- if error_messages:
115
- # no match
116
- raise ValueError("No match found when deserializing the JSON string into FovCoordinateAp with anyOf schemas: float, int. Details: " + ", ".join(error_messages))
117
- else:
118
- return instance
119
-
120
- def to_json(self) -> str:
121
- """Returns the JSON representation of the actual instance"""
122
- if self.actual_instance is None:
123
- return "null"
124
-
125
- if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json):
126
- return self.actual_instance.to_json()
127
- else:
128
- return json.dumps(self.actual_instance)
129
-
130
- def to_dict(self) -> Optional[Union[Dict[str, Any], float, int]]:
131
- """Returns the dict representation of the actual instance"""
132
- if self.actual_instance is None:
133
- return None
134
-
135
- if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict):
136
- return self.actual_instance.to_dict()
137
- else:
138
- return self.actual_instance
139
-
140
- def to_str(self) -> str:
141
- """Returns the string representation of the actual instance"""
142
- return pprint.pformat(self.model_dump())
143
-
144
-