aind-metadata-service-async-client 1.1.5__py3-none-any.whl → 2.1.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.
- aind_metadata_service_async_client/__init__.py +2 -15
- aind_metadata_service_async_client/api/default_api.py +700 -175
- aind_metadata_service_async_client/api/healthcheck_api.py +2 -2
- aind_metadata_service_async_client/api_client.py +2 -2
- aind_metadata_service_async_client/configuration.py +3 -3
- aind_metadata_service_async_client/exceptions.py +1 -1
- aind_metadata_service_async_client/models/__init__.py +1 -14
- aind_metadata_service_async_client/models/health_check.py +3 -3
- aind_metadata_service_async_client/models/http_validation_error.py +1 -1
- aind_metadata_service_async_client/models/slims_workflow.py +1 -1
- aind_metadata_service_async_client/models/validation_error.py +1 -1
- aind_metadata_service_async_client/models/validation_error_loc_inner.py +1 -1
- aind_metadata_service_async_client/rest.py +1 -1
- {aind_metadata_service_async_client-1.1.5.dist-info → aind_metadata_service_async_client-2.1.0.dist-info}/METADATA +1 -1
- aind_metadata_service_async_client-2.1.0.dist-info/RECORD +20 -0
- aind_metadata_service_async_client/models/anyof_schema1_validator.py +0 -144
- aind_metadata_service_async_client/models/average_hit_rate.py +0 -144
- aind_metadata_service_async_client/models/fov_coordinate_ap.py +0 -144
- aind_metadata_service_async_client/models/fov_coordinate_ml.py +0 -112
- aind_metadata_service_async_client/models/hit_rate_trials010.py +0 -144
- aind_metadata_service_async_client/models/hit_rate_trials2040.py +0 -144
- aind_metadata_service_async_client/models/input_source.py +0 -122
- aind_metadata_service_async_client/models/job_settings.py +0 -369
- aind_metadata_service_async_client/models/job_settings_starting_lickport_position_inner.py +0 -138
- aind_metadata_service_async_client/models/output_directory.py +0 -108
- aind_metadata_service_async_client/models/total_hits.py +0 -144
- aind_metadata_service_async_client/models/trial_num.py +0 -144
- aind_metadata_service_async_client/models/user_settings_config_file.py +0 -108
- aind_metadata_service_async_client-1.1.5.dist-info/RECORD +0 -33
- {aind_metadata_service_async_client-1.1.5.dist-info → aind_metadata_service_async_client-2.1.0.dist-info}/WHEEL +0 -0
- {aind_metadata_service_async_client-1.1.5.dist-info → aind_metadata_service_async_client-2.1.0.dist-info}/top_level.txt +0 -0
|
@@ -1,112 +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.5
|
|
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, Optional
|
|
22
|
-
from aind_metadata_service_async_client.models.anyof_schema1_validator import AnyofSchema1Validator
|
|
23
|
-
from typing import Optional, Set
|
|
24
|
-
from typing_extensions import Self
|
|
25
|
-
|
|
26
|
-
class FovCoordinateMl(BaseModel):
|
|
27
|
-
"""
|
|
28
|
-
FovCoordinateMl
|
|
29
|
-
""" # noqa: E501
|
|
30
|
-
anyof_schema_1_validator: Optional[AnyofSchema1Validator] = None
|
|
31
|
-
anyof_schema_2_validator: Optional[StrictStr] = None
|
|
32
|
-
actual_instance: Optional[Any] = None
|
|
33
|
-
any_of_schemas: Optional[List[StrictStr]] = None
|
|
34
|
-
__properties: ClassVar[List[str]] = ["anyof_schema_1_validator", "anyof_schema_2_validator", "actual_instance", "any_of_schemas"]
|
|
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 FovCoordinateMl 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
|
-
# override the default output from pydantic by calling `to_dict()` of anyof_schema_1_validator
|
|
76
|
-
if self.anyof_schema_1_validator:
|
|
77
|
-
_dict['anyof_schema_1_validator'] = self.anyof_schema_1_validator.to_dict()
|
|
78
|
-
# set to None if anyof_schema_1_validator (nullable) is None
|
|
79
|
-
# and model_fields_set contains the field
|
|
80
|
-
if self.anyof_schema_1_validator is None and "anyof_schema_1_validator" in self.model_fields_set:
|
|
81
|
-
_dict['anyof_schema_1_validator'] = None
|
|
82
|
-
|
|
83
|
-
# set to None if anyof_schema_2_validator (nullable) is None
|
|
84
|
-
# and model_fields_set contains the field
|
|
85
|
-
if self.anyof_schema_2_validator is None and "anyof_schema_2_validator" in self.model_fields_set:
|
|
86
|
-
_dict['anyof_schema_2_validator'] = None
|
|
87
|
-
|
|
88
|
-
# set to None if actual_instance (nullable) is None
|
|
89
|
-
# and model_fields_set contains the field
|
|
90
|
-
if self.actual_instance is None and "actual_instance" in self.model_fields_set:
|
|
91
|
-
_dict['actual_instance'] = None
|
|
92
|
-
|
|
93
|
-
return _dict
|
|
94
|
-
|
|
95
|
-
@classmethod
|
|
96
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
97
|
-
"""Create an instance of FovCoordinateMl from a dict"""
|
|
98
|
-
if obj is None:
|
|
99
|
-
return None
|
|
100
|
-
|
|
101
|
-
if not isinstance(obj, dict):
|
|
102
|
-
return cls.model_validate(obj)
|
|
103
|
-
|
|
104
|
-
_obj = cls.model_validate({
|
|
105
|
-
"anyof_schema_1_validator": AnyofSchema1Validator.from_dict(obj["anyof_schema_1_validator"]) if obj.get("anyof_schema_1_validator") is not None else None,
|
|
106
|
-
"anyof_schema_2_validator": obj.get("anyof_schema_2_validator"),
|
|
107
|
-
"actual_instance": obj.get("actual_instance"),
|
|
108
|
-
"any_of_schemas": obj.get("any_of_schemas")
|
|
109
|
-
})
|
|
110
|
-
return _obj
|
|
111
|
-
|
|
112
|
-
|
|
@@ -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.5
|
|
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
|
-
HITRATETRIALS010_ANY_OF_SCHEMAS = ["float", "int"]
|
|
27
|
-
|
|
28
|
-
class HitRateTrials010(BaseModel):
|
|
29
|
-
"""
|
|
30
|
-
HitRateTrials010
|
|
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 = HitRateTrials010.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 HitRateTrials010 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 HitRateTrials010 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.5
|
|
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
|
-
HITRATETRIALS2040_ANY_OF_SCHEMAS = ["float", "int"]
|
|
27
|
-
|
|
28
|
-
class HitRateTrials2040(BaseModel):
|
|
29
|
-
"""
|
|
30
|
-
HitRateTrials2040
|
|
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 = HitRateTrials2040.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 HitRateTrials2040 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 HitRateTrials2040 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,122 +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.5
|
|
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, Optional
|
|
22
|
-
from typing import Optional, Set
|
|
23
|
-
from typing_extensions import Self
|
|
24
|
-
|
|
25
|
-
class InputSource(BaseModel):
|
|
26
|
-
"""
|
|
27
|
-
Location or locations of data sources to parse for metadata.
|
|
28
|
-
""" # noqa: E501
|
|
29
|
-
anyof_schema_1_validator: Optional[StrictStr] = None
|
|
30
|
-
anyof_schema_2_validator: Optional[StrictStr] = None
|
|
31
|
-
anyof_schema_3_validator: Optional[List[StrictStr]] = None
|
|
32
|
-
anyof_schema_4_validator: Optional[List[StrictStr]] = None
|
|
33
|
-
actual_instance: Optional[Any] = None
|
|
34
|
-
any_of_schemas: Optional[List[StrictStr]] = None
|
|
35
|
-
__properties: ClassVar[List[str]] = ["anyof_schema_1_validator", "anyof_schema_2_validator", "anyof_schema_3_validator", "anyof_schema_4_validator", "actual_instance", "any_of_schemas"]
|
|
36
|
-
|
|
37
|
-
model_config = ConfigDict(
|
|
38
|
-
populate_by_name=True,
|
|
39
|
-
validate_assignment=True,
|
|
40
|
-
protected_namespaces=(),
|
|
41
|
-
)
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
def to_str(self) -> str:
|
|
45
|
-
"""Returns the string representation of the model using alias"""
|
|
46
|
-
return pprint.pformat(self.model_dump(by_alias=True))
|
|
47
|
-
|
|
48
|
-
def to_json(self) -> str:
|
|
49
|
-
"""Returns the JSON representation of the model using alias"""
|
|
50
|
-
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
|
51
|
-
return json.dumps(self.to_dict())
|
|
52
|
-
|
|
53
|
-
@classmethod
|
|
54
|
-
def from_json(cls, json_str: str) -> Optional[Self]:
|
|
55
|
-
"""Create an instance of InputSource 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
|
-
# set to None if anyof_schema_1_validator (nullable) is None
|
|
77
|
-
# and model_fields_set contains the field
|
|
78
|
-
if self.anyof_schema_1_validator is None and "anyof_schema_1_validator" in self.model_fields_set:
|
|
79
|
-
_dict['anyof_schema_1_validator'] = None
|
|
80
|
-
|
|
81
|
-
# set to None if anyof_schema_2_validator (nullable) is None
|
|
82
|
-
# and model_fields_set contains the field
|
|
83
|
-
if self.anyof_schema_2_validator is None and "anyof_schema_2_validator" in self.model_fields_set:
|
|
84
|
-
_dict['anyof_schema_2_validator'] = None
|
|
85
|
-
|
|
86
|
-
# set to None if anyof_schema_3_validator (nullable) is None
|
|
87
|
-
# and model_fields_set contains the field
|
|
88
|
-
if self.anyof_schema_3_validator is None and "anyof_schema_3_validator" in self.model_fields_set:
|
|
89
|
-
_dict['anyof_schema_3_validator'] = None
|
|
90
|
-
|
|
91
|
-
# set to None if anyof_schema_4_validator (nullable) is None
|
|
92
|
-
# and model_fields_set contains the field
|
|
93
|
-
if self.anyof_schema_4_validator is None and "anyof_schema_4_validator" in self.model_fields_set:
|
|
94
|
-
_dict['anyof_schema_4_validator'] = None
|
|
95
|
-
|
|
96
|
-
# set to None if actual_instance (nullable) is None
|
|
97
|
-
# and model_fields_set contains the field
|
|
98
|
-
if self.actual_instance is None and "actual_instance" in self.model_fields_set:
|
|
99
|
-
_dict['actual_instance'] = None
|
|
100
|
-
|
|
101
|
-
return _dict
|
|
102
|
-
|
|
103
|
-
@classmethod
|
|
104
|
-
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
|
105
|
-
"""Create an instance of InputSource from a dict"""
|
|
106
|
-
if obj is None:
|
|
107
|
-
return None
|
|
108
|
-
|
|
109
|
-
if not isinstance(obj, dict):
|
|
110
|
-
return cls.model_validate(obj)
|
|
111
|
-
|
|
112
|
-
_obj = cls.model_validate({
|
|
113
|
-
"anyof_schema_1_validator": obj.get("anyof_schema_1_validator"),
|
|
114
|
-
"anyof_schema_2_validator": obj.get("anyof_schema_2_validator"),
|
|
115
|
-
"anyof_schema_3_validator": obj.get("anyof_schema_3_validator"),
|
|
116
|
-
"anyof_schema_4_validator": obj.get("anyof_schema_4_validator"),
|
|
117
|
-
"actual_instance": obj.get("actual_instance"),
|
|
118
|
-
"any_of_schemas": obj.get("any_of_schemas")
|
|
119
|
-
})
|
|
120
|
-
return _obj
|
|
121
|
-
|
|
122
|
-
|