generated new pydantic models for DFG data
This commit is contained in:
@@ -0,0 +1,157 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Institutes API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from openapi_client.models.dfg_institute_institute import DFGInstituteInstitute
|
||||
from openapi_client.models.dfg_institute_projects_inner import DFGInstituteProjectsInner
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGInstitute(BaseModel):
|
||||
"""
|
||||
DFGInstitute
|
||||
""" # noqa: E501
|
||||
address_city: Optional[StrictStr] = None
|
||||
address_country_de: Optional[StrictStr] = None
|
||||
address_country_en: Optional[StrictStr] = None
|
||||
address_hidden: Optional[StrictBool] = None
|
||||
address_postal_code_city: Optional[StrictStr] = None
|
||||
address_street: Optional[StrictStr] = None
|
||||
aku_id: Optional[StrictInt] = None
|
||||
fetched_at: Optional[datetime] = None
|
||||
id: Optional[StrictInt] = None
|
||||
institute: Optional[DFGInstituteInstitute] = None
|
||||
institute_category_key: Optional[StrictStr] = None
|
||||
institute_category_label_de: Optional[StrictStr] = None
|
||||
institute_category_label_en: Optional[StrictStr] = None
|
||||
institute_id: Optional[StrictInt] = None
|
||||
institute_name_de: Optional[StrictStr] = None
|
||||
institute_name_en: Optional[StrictStr] = None
|
||||
institute_postal_address: Optional[StrictStr] = None
|
||||
institute_type_key: Optional[StrictStr] = None
|
||||
institute_type_label_de: Optional[StrictStr] = None
|
||||
institute_type_label_en: Optional[StrictStr] = None
|
||||
is_dissolved: Optional[StrictBool] = None
|
||||
is_research_device: Optional[StrictBool] = None
|
||||
link: Optional[StrictStr] = None
|
||||
page_url: Optional[StrictStr] = None
|
||||
project_types_order: Optional[StrictStr] = None
|
||||
projects: Optional[List[DFGInstituteProjectsInner]] = None
|
||||
root_id: Optional[StrictInt] = None
|
||||
root_name_de: Optional[StrictStr] = None
|
||||
root_name_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["address_city", "address_country_de", "address_country_en", "address_hidden", "address_postal_code_city", "address_street", "aku_id", "fetched_at", "id", "institute", "institute_category_key", "institute_category_label_de", "institute_category_label_en", "institute_id", "institute_name_de", "institute_name_en", "institute_postal_address", "institute_type_key", "institute_type_label_de", "institute_type_label_en", "is_dissolved", "is_research_device", "link", "page_url", "project_types_order", "projects", "root_id", "root_name_de", "root_name_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstitute from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of institute
|
||||
if self.institute:
|
||||
_dict['institute'] = self.institute.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in projects (list)
|
||||
_items = []
|
||||
if self.projects:
|
||||
for _item_projects in self.projects:
|
||||
if _item_projects:
|
||||
_items.append(_item_projects.to_dict())
|
||||
_dict['projects'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstitute from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"address_city": obj.get("address_city"),
|
||||
"address_country_de": obj.get("address_country_de"),
|
||||
"address_country_en": obj.get("address_country_en"),
|
||||
"address_hidden": obj.get("address_hidden"),
|
||||
"address_postal_code_city": obj.get("address_postal_code_city"),
|
||||
"address_street": obj.get("address_street"),
|
||||
"aku_id": obj.get("aku_id"),
|
||||
"fetched_at": obj.get("fetched_at"),
|
||||
"id": obj.get("id"),
|
||||
"institute": DFGInstituteInstitute.from_dict(obj["institute"]) if obj.get("institute") is not None else None,
|
||||
"institute_category_key": obj.get("institute_category_key"),
|
||||
"institute_category_label_de": obj.get("institute_category_label_de"),
|
||||
"institute_category_label_en": obj.get("institute_category_label_en"),
|
||||
"institute_id": obj.get("institute_id"),
|
||||
"institute_name_de": obj.get("institute_name_de"),
|
||||
"institute_name_en": obj.get("institute_name_en"),
|
||||
"institute_postal_address": obj.get("institute_postal_address"),
|
||||
"institute_type_key": obj.get("institute_type_key"),
|
||||
"institute_type_label_de": obj.get("institute_type_label_de"),
|
||||
"institute_type_label_en": obj.get("institute_type_label_en"),
|
||||
"is_dissolved": obj.get("is_dissolved"),
|
||||
"is_research_device": obj.get("is_research_device"),
|
||||
"link": obj.get("link"),
|
||||
"page_url": obj.get("page_url"),
|
||||
"project_types_order": obj.get("project_types_order"),
|
||||
"projects": [DFGInstituteProjectsInner.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None,
|
||||
"root_id": obj.get("root_id"),
|
||||
"root_name_de": obj.get("root_name_de"),
|
||||
"root_name_en": obj.get("root_name_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Institutes API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGInstituteInstitute(BaseModel):
|
||||
"""
|
||||
DFGInstituteInstitute
|
||||
""" # noqa: E501
|
||||
address_city: Optional[StrictStr] = None
|
||||
address_country_de: Optional[StrictStr] = None
|
||||
address_country_en: Optional[StrictStr] = None
|
||||
address_hidden: Optional[StrictBool] = None
|
||||
address_postal_code_city: Optional[StrictStr] = None
|
||||
address_street: Optional[StrictStr] = None
|
||||
aku_id: Optional[StrictInt] = None
|
||||
institute_category_key: Optional[StrictStr] = None
|
||||
institute_category_label_de: Optional[StrictStr] = None
|
||||
institute_category_label_en: Optional[StrictStr] = None
|
||||
institute_id: Optional[StrictInt] = None
|
||||
institute_name_de: Optional[StrictStr] = None
|
||||
institute_name_en: Optional[StrictStr] = None
|
||||
institute_postal_address: Optional[StrictStr] = None
|
||||
institute_type_key: Optional[StrictStr] = None
|
||||
institute_type_label_de: Optional[StrictStr] = None
|
||||
institute_type_label_en: Optional[StrictStr] = None
|
||||
is_dissolved: Optional[StrictBool] = None
|
||||
is_research_device: Optional[StrictBool] = None
|
||||
root_id: Optional[StrictInt] = None
|
||||
root_name_de: Optional[StrictStr] = None
|
||||
root_name_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["address_city", "address_country_de", "address_country_en", "address_hidden", "address_postal_code_city", "address_street", "aku_id", "institute_category_key", "institute_category_label_de", "institute_category_label_en", "institute_id", "institute_name_de", "institute_name_en", "institute_postal_address", "institute_type_key", "institute_type_label_de", "institute_type_label_en", "is_dissolved", "is_research_device", "root_id", "root_name_de", "root_name_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstituteInstitute from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstituteInstitute from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"address_city": obj.get("address_city"),
|
||||
"address_country_de": obj.get("address_country_de"),
|
||||
"address_country_en": obj.get("address_country_en"),
|
||||
"address_hidden": obj.get("address_hidden"),
|
||||
"address_postal_code_city": obj.get("address_postal_code_city"),
|
||||
"address_street": obj.get("address_street"),
|
||||
"aku_id": obj.get("aku_id"),
|
||||
"institute_category_key": obj.get("institute_category_key"),
|
||||
"institute_category_label_de": obj.get("institute_category_label_de"),
|
||||
"institute_category_label_en": obj.get("institute_category_label_en"),
|
||||
"institute_id": obj.get("institute_id"),
|
||||
"institute_name_de": obj.get("institute_name_de"),
|
||||
"institute_name_en": obj.get("institute_name_en"),
|
||||
"institute_postal_address": obj.get("institute_postal_address"),
|
||||
"institute_type_key": obj.get("institute_type_key"),
|
||||
"institute_type_label_de": obj.get("institute_type_label_de"),
|
||||
"institute_type_label_en": obj.get("institute_type_label_en"),
|
||||
"is_dissolved": obj.get("is_dissolved"),
|
||||
"is_research_device": obj.get("is_research_device"),
|
||||
"root_id": obj.get("root_id"),
|
||||
"root_name_de": obj.get("root_name_de"),
|
||||
"root_name_en": obj.get("root_name_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Institutes API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGInstituteProjectsInner(BaseModel):
|
||||
"""
|
||||
DFGInstituteProjectsInner
|
||||
""" # noqa: E501
|
||||
funding_end: Optional[StrictInt] = None
|
||||
funding_period_de: Optional[StrictStr] = None
|
||||
funding_period_en: Optional[StrictStr] = None
|
||||
funding_start: Optional[StrictInt] = None
|
||||
funding_type_de: Optional[StrictStr] = None
|
||||
funding_type_en: Optional[StrictStr] = None
|
||||
funding_type_key: Optional[StrictStr] = None
|
||||
funding_type_sort: Optional[StrictStr] = None
|
||||
institute_ref_id: Optional[StrictInt] = None
|
||||
is_transfer_project: Optional[StrictBool] = None
|
||||
project_id: Optional[StrictInt] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
sort_year: Optional[StrictStr] = None
|
||||
status_de: Optional[StrictStr] = None
|
||||
status_en: Optional[StrictStr] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["funding_end", "funding_period_de", "funding_period_en", "funding_start", "funding_type_de", "funding_type_en", "funding_type_key", "funding_type_sort", "institute_ref_id", "is_transfer_project", "project_id", "sort_criteria", "sort_year", "status_de", "status_en", "title_de", "title_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstituteProjectsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGInstituteProjectsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"funding_end": obj.get("funding_end"),
|
||||
"funding_period_de": obj.get("funding_period_de"),
|
||||
"funding_period_en": obj.get("funding_period_en"),
|
||||
"funding_start": obj.get("funding_start"),
|
||||
"funding_type_de": obj.get("funding_type_de"),
|
||||
"funding_type_en": obj.get("funding_type_en"),
|
||||
"funding_type_key": obj.get("funding_type_key"),
|
||||
"funding_type_sort": obj.get("funding_type_sort"),
|
||||
"institute_ref_id": obj.get("institute_ref_id"),
|
||||
"is_transfer_project": obj.get("is_transfer_project"),
|
||||
"project_id": obj.get("project_id"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"sort_year": obj.get("sort_year"),
|
||||
"status_de": obj.get("status_de"),
|
||||
"status_en": obj.get("status_en"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Persons API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from openapi_client.models.dfg_person_awards_inner import DFGPersonAwardsInner
|
||||
from openapi_client.models.dfg_person_person import DFGPersonPerson
|
||||
from openapi_client.models.dfg_person_projects_inner import DFGPersonProjectsInner
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGPerson(BaseModel):
|
||||
"""
|
||||
DFGPerson
|
||||
""" # noqa: E501
|
||||
address_country_de: Optional[StrictStr] = None
|
||||
address_country_en: Optional[StrictStr] = None
|
||||
address_hidden: Optional[StrictBool] = None
|
||||
address_postal_code_city: Optional[StrictStr] = None
|
||||
address_street: Optional[StrictStr] = None
|
||||
aku_id: Optional[StrictInt] = None
|
||||
award_types_order: Optional[StrictStr] = None
|
||||
awards: Optional[List[DFGPersonAwardsInner]] = None
|
||||
fetched_at: Optional[datetime] = None
|
||||
full_name: Optional[StrictStr] = None
|
||||
id: Optional[StrictInt] = None
|
||||
institute_id: Optional[StrictInt] = None
|
||||
institute_name_de: Optional[StrictStr] = None
|
||||
institute_name_en: Optional[StrictStr] = None
|
||||
institute_postal_address: Optional[StrictStr] = None
|
||||
is_deceased: Optional[StrictBool] = None
|
||||
link: Optional[StrictStr] = None
|
||||
orcid_id: Optional[StrictStr] = None
|
||||
page_url: Optional[StrictStr] = None
|
||||
person: Optional[DFGPersonPerson] = None
|
||||
person_id: Optional[StrictInt] = None
|
||||
project_types_order: Optional[StrictStr] = None
|
||||
projects: Optional[List[DFGPersonProjectsInner]] = None
|
||||
root_id: Optional[StrictInt] = None
|
||||
root_name_de: Optional[StrictStr] = None
|
||||
root_name_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["address_country_de", "address_country_en", "address_hidden", "address_postal_code_city", "address_street", "aku_id", "award_types_order", "awards", "fetched_at", "full_name", "id", "institute_id", "institute_name_de", "institute_name_en", "institute_postal_address", "is_deceased", "link", "orcid_id", "page_url", "person", "person_id", "project_types_order", "projects", "root_id", "root_name_de", "root_name_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGPerson from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in awards (list)
|
||||
_items = []
|
||||
if self.awards:
|
||||
for _item_awards in self.awards:
|
||||
if _item_awards:
|
||||
_items.append(_item_awards.to_dict())
|
||||
_dict['awards'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of person
|
||||
if self.person:
|
||||
_dict['person'] = self.person.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in projects (list)
|
||||
_items = []
|
||||
if self.projects:
|
||||
for _item_projects in self.projects:
|
||||
if _item_projects:
|
||||
_items.append(_item_projects.to_dict())
|
||||
_dict['projects'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGPerson from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"address_country_de": obj.get("address_country_de"),
|
||||
"address_country_en": obj.get("address_country_en"),
|
||||
"address_hidden": obj.get("address_hidden"),
|
||||
"address_postal_code_city": obj.get("address_postal_code_city"),
|
||||
"address_street": obj.get("address_street"),
|
||||
"aku_id": obj.get("aku_id"),
|
||||
"award_types_order": obj.get("award_types_order"),
|
||||
"awards": [DFGPersonAwardsInner.from_dict(_item) for _item in obj["awards"]] if obj.get("awards") is not None else None,
|
||||
"fetched_at": obj.get("fetched_at"),
|
||||
"full_name": obj.get("full_name"),
|
||||
"id": obj.get("id"),
|
||||
"institute_id": obj.get("institute_id"),
|
||||
"institute_name_de": obj.get("institute_name_de"),
|
||||
"institute_name_en": obj.get("institute_name_en"),
|
||||
"institute_postal_address": obj.get("institute_postal_address"),
|
||||
"is_deceased": obj.get("is_deceased"),
|
||||
"link": obj.get("link"),
|
||||
"orcid_id": obj.get("orcid_id"),
|
||||
"page_url": obj.get("page_url"),
|
||||
"person": DFGPersonPerson.from_dict(obj["person"]) if obj.get("person") is not None else None,
|
||||
"person_id": obj.get("person_id"),
|
||||
"project_types_order": obj.get("project_types_order"),
|
||||
"projects": [DFGPersonProjectsInner.from_dict(_item) for _item in obj["projects"]] if obj.get("projects") is not None else None,
|
||||
"root_id": obj.get("root_id"),
|
||||
"root_name_de": obj.get("root_name_de"),
|
||||
"root_name_en": obj.get("root_name_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Persons API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGPersonAwardsInner(BaseModel):
|
||||
"""
|
||||
DFGPersonAwardsInner
|
||||
""" # noqa: E501
|
||||
award_group_key: Optional[StrictStr] = None
|
||||
award_id: Optional[StrictInt] = None
|
||||
award_key: Optional[StrictStr] = None
|
||||
award_label_de: Optional[StrictStr] = None
|
||||
award_label_en: Optional[StrictStr] = None
|
||||
person_ref_id: Optional[StrictInt] = None
|
||||
pseudo_project_id: Optional[StrictInt] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
text_de: Optional[StrictStr] = None
|
||||
text_en: Optional[StrictStr] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
url_de: Optional[StrictStr] = None
|
||||
url_en: Optional[StrictStr] = None
|
||||
year: Optional[StrictInt] = None
|
||||
__properties: ClassVar[List[str]] = ["award_group_key", "award_id", "award_key", "award_label_de", "award_label_en", "person_ref_id", "pseudo_project_id", "sort_criteria", "text_de", "text_en", "title_de", "title_en", "url_de", "url_en", "year"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonAwardsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonAwardsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"award_group_key": obj.get("award_group_key"),
|
||||
"award_id": obj.get("award_id"),
|
||||
"award_key": obj.get("award_key"),
|
||||
"award_label_de": obj.get("award_label_de"),
|
||||
"award_label_en": obj.get("award_label_en"),
|
||||
"person_ref_id": obj.get("person_ref_id"),
|
||||
"pseudo_project_id": obj.get("pseudo_project_id"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"text_de": obj.get("text_de"),
|
||||
"text_en": obj.get("text_en"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en"),
|
||||
"url_de": obj.get("url_de"),
|
||||
"url_en": obj.get("url_en"),
|
||||
"year": obj.get("year")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Persons API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGPersonPerson(BaseModel):
|
||||
"""
|
||||
DFGPersonPerson
|
||||
""" # noqa: E501
|
||||
address_country_de: Optional[StrictStr] = None
|
||||
address_country_en: Optional[StrictStr] = None
|
||||
address_hidden: Optional[StrictBool] = None
|
||||
address_postal_code_city: Optional[StrictStr] = None
|
||||
address_street: Optional[StrictStr] = None
|
||||
aku_id: Optional[StrictInt] = None
|
||||
full_name: Optional[StrictStr] = None
|
||||
institute_id: Optional[StrictInt] = None
|
||||
institute_name_de: Optional[StrictStr] = None
|
||||
institute_name_en: Optional[StrictStr] = None
|
||||
institute_postal_address: Optional[StrictStr] = None
|
||||
is_deceased: Optional[StrictBool] = None
|
||||
orcid_id: Optional[StrictStr] = None
|
||||
person_id: Optional[StrictInt] = None
|
||||
root_id: Optional[StrictInt] = None
|
||||
root_name_de: Optional[StrictStr] = None
|
||||
root_name_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["address_country_de", "address_country_en", "address_hidden", "address_postal_code_city", "address_street", "aku_id", "full_name", "institute_id", "institute_name_de", "institute_name_en", "institute_postal_address", "is_deceased", "orcid_id", "person_id", "root_id", "root_name_de", "root_name_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonPerson from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonPerson from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"address_country_de": obj.get("address_country_de"),
|
||||
"address_country_en": obj.get("address_country_en"),
|
||||
"address_hidden": obj.get("address_hidden"),
|
||||
"address_postal_code_city": obj.get("address_postal_code_city"),
|
||||
"address_street": obj.get("address_street"),
|
||||
"aku_id": obj.get("aku_id"),
|
||||
"full_name": obj.get("full_name"),
|
||||
"institute_id": obj.get("institute_id"),
|
||||
"institute_name_de": obj.get("institute_name_de"),
|
||||
"institute_name_en": obj.get("institute_name_en"),
|
||||
"institute_postal_address": obj.get("institute_postal_address"),
|
||||
"is_deceased": obj.get("is_deceased"),
|
||||
"orcid_id": obj.get("orcid_id"),
|
||||
"person_id": obj.get("person_id"),
|
||||
"root_id": obj.get("root_id"),
|
||||
"root_name_de": obj.get("root_name_de"),
|
||||
"root_name_en": obj.get("root_name_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Persons API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGPersonProjectsInner(BaseModel):
|
||||
"""
|
||||
DFGPersonProjectsInner
|
||||
""" # noqa: E501
|
||||
funding_end: Optional[StrictInt] = None
|
||||
funding_period_de: Optional[StrictStr] = None
|
||||
funding_period_en: Optional[StrictStr] = None
|
||||
funding_start: Optional[StrictInt] = None
|
||||
funding_type_de: Optional[StrictStr] = None
|
||||
funding_type_en: Optional[StrictStr] = None
|
||||
funding_type_key: Optional[StrictStr] = None
|
||||
participants_de: Optional[StrictStr] = None
|
||||
participants_en: Optional[StrictStr] = None
|
||||
person_ref_id: Optional[StrictInt] = None
|
||||
project_id: Optional[StrictInt] = None
|
||||
role_key: Optional[StrictStr] = None
|
||||
role_label_de: Optional[StrictStr] = None
|
||||
role_label_en: Optional[StrictStr] = None
|
||||
role_sort: Optional[StrictStr] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
sort_year: Optional[StrictStr] = None
|
||||
status_de: Optional[StrictStr] = None
|
||||
status_en: Optional[StrictStr] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["funding_end", "funding_period_de", "funding_period_en", "funding_start", "funding_type_de", "funding_type_en", "funding_type_key", "participants_de", "participants_en", "person_ref_id", "project_id", "role_key", "role_label_de", "role_label_en", "role_sort", "sort_criteria", "sort_year", "status_de", "status_en", "title_de", "title_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonProjectsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGPersonProjectsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"funding_end": obj.get("funding_end"),
|
||||
"funding_period_de": obj.get("funding_period_de"),
|
||||
"funding_period_en": obj.get("funding_period_en"),
|
||||
"funding_start": obj.get("funding_start"),
|
||||
"funding_type_de": obj.get("funding_type_de"),
|
||||
"funding_type_en": obj.get("funding_type_en"),
|
||||
"funding_type_key": obj.get("funding_type_key"),
|
||||
"participants_de": obj.get("participants_de"),
|
||||
"participants_en": obj.get("participants_en"),
|
||||
"person_ref_id": obj.get("person_ref_id"),
|
||||
"project_id": obj.get("project_id"),
|
||||
"role_key": obj.get("role_key"),
|
||||
"role_label_de": obj.get("role_label_de"),
|
||||
"role_label_en": obj.get("role_label_en"),
|
||||
"role_sort": obj.get("role_sort"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"sort_year": obj.get("sort_year"),
|
||||
"status_de": obj.get("status_de"),
|
||||
"status_en": obj.get("status_en"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,224 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from openapi_client.models.dfg_project_fachgebiete_inner import DFGProjectFachgebieteInner
|
||||
from openapi_client.models.dfg_project_institutions_inner import DFGProjectInstitutionsInner
|
||||
from openapi_client.models.dfg_project_persons_inner import DFGProjectPersonsInner
|
||||
from openapi_client.models.dfg_project_project import DFGProjectProject
|
||||
from openapi_client.models.dfg_project_publications_inner import DFGProjectPublicationsInner
|
||||
from openapi_client.models.dfg_project_subprojects_inner import DFGProjectSubprojectsInner
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProject(BaseModel):
|
||||
"""
|
||||
DFGProject
|
||||
""" # noqa: E501
|
||||
abstract_de: Optional[StrictStr] = None
|
||||
abstract_en: Optional[StrictStr] = None
|
||||
equipment_group: Optional[StrictStr] = None
|
||||
equipment_name: Optional[StrictStr] = None
|
||||
external_link: Optional[StrictStr] = None
|
||||
fachgebiete: Optional[List[DFGProjectFachgebieteInner]] = None
|
||||
fetched_at: Optional[datetime] = None
|
||||
final_report_abstract_de: Optional[StrictStr] = None
|
||||
final_report_abstract_en: Optional[StrictStr] = None
|
||||
funding_end: Optional[StrictInt] = None
|
||||
funding_period_de: Optional[StrictStr] = None
|
||||
funding_period_en: Optional[StrictStr] = None
|
||||
funding_start: Optional[StrictInt] = None
|
||||
funding_type_de: Optional[StrictStr] = None
|
||||
funding_type_en: Optional[StrictStr] = None
|
||||
funding_type_key: Optional[StrictStr] = None
|
||||
funding_type_sort: Optional[StrictStr] = None
|
||||
id: Optional[StrictInt] = None
|
||||
institution_roles_order: Optional[StrictStr] = None
|
||||
institutions: Optional[List[DFGProjectInstitutionsInner]] = None
|
||||
international_relation_de: Optional[StrictStr] = None
|
||||
international_relation_en: Optional[StrictStr] = None
|
||||
is_transfer_project: Optional[StrictBool] = None
|
||||
link: Optional[StrictStr] = None
|
||||
page_url: Optional[StrictStr] = None
|
||||
parent_project_id: Optional[StrictInt] = None
|
||||
parent_title_de: Optional[StrictStr] = None
|
||||
parent_title_en: Optional[StrictStr] = None
|
||||
person_roles_order: Optional[StrictStr] = None
|
||||
persons: Optional[List[DFGProjectPersonsInner]] = None
|
||||
project: Optional[DFGProjectProject] = None
|
||||
project_id: Optional[StrictInt] = None
|
||||
project_identifier_de: Optional[StrictStr] = None
|
||||
project_identifier_en: Optional[StrictStr] = None
|
||||
publications: Optional[List[DFGProjectPublicationsInner]] = None
|
||||
subject_area_de: Optional[StrictStr] = None
|
||||
subject_area_en: Optional[StrictStr] = None
|
||||
subject_classifications: Optional[DFGProjectFachgebieteInner] = None
|
||||
subproject_order: Optional[StrictStr] = None
|
||||
subprojects: Optional[List[DFGProjectSubprojectsInner]] = None
|
||||
template_type: Optional[StrictStr] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
website_html_de: Optional[StrictStr] = None
|
||||
website_html_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["abstract_de", "abstract_en", "equipment_group", "equipment_name", "external_link", "fachgebiete", "fetched_at", "final_report_abstract_de", "final_report_abstract_en", "funding_end", "funding_period_de", "funding_period_en", "funding_start", "funding_type_de", "funding_type_en", "funding_type_key", "funding_type_sort", "id", "institution_roles_order", "institutions", "international_relation_de", "international_relation_en", "is_transfer_project", "link", "page_url", "parent_project_id", "parent_title_de", "parent_title_en", "person_roles_order", "persons", "project", "project_id", "project_identifier_de", "project_identifier_en", "publications", "subject_area_de", "subject_area_en", "subject_classifications", "subproject_order", "subprojects", "template_type", "title_de", "title_en", "website_html_de", "website_html_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProject from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in fachgebiete (list)
|
||||
_items = []
|
||||
if self.fachgebiete:
|
||||
for _item_fachgebiete in self.fachgebiete:
|
||||
if _item_fachgebiete:
|
||||
_items.append(_item_fachgebiete.to_dict())
|
||||
_dict['fachgebiete'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in institutions (list)
|
||||
_items = []
|
||||
if self.institutions:
|
||||
for _item_institutions in self.institutions:
|
||||
if _item_institutions:
|
||||
_items.append(_item_institutions.to_dict())
|
||||
_dict['institutions'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in persons (list)
|
||||
_items = []
|
||||
if self.persons:
|
||||
for _item_persons in self.persons:
|
||||
if _item_persons:
|
||||
_items.append(_item_persons.to_dict())
|
||||
_dict['persons'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of project
|
||||
if self.project:
|
||||
_dict['project'] = self.project.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in publications (list)
|
||||
_items = []
|
||||
if self.publications:
|
||||
for _item_publications in self.publications:
|
||||
if _item_publications:
|
||||
_items.append(_item_publications.to_dict())
|
||||
_dict['publications'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of subject_classifications
|
||||
if self.subject_classifications:
|
||||
_dict['subject_classifications'] = self.subject_classifications.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in subprojects (list)
|
||||
_items = []
|
||||
if self.subprojects:
|
||||
for _item_subprojects in self.subprojects:
|
||||
if _item_subprojects:
|
||||
_items.append(_item_subprojects.to_dict())
|
||||
_dict['subprojects'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProject from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"abstract_de": obj.get("abstract_de"),
|
||||
"abstract_en": obj.get("abstract_en"),
|
||||
"equipment_group": obj.get("equipment_group"),
|
||||
"equipment_name": obj.get("equipment_name"),
|
||||
"external_link": obj.get("external_link"),
|
||||
"fachgebiete": [DFGProjectFachgebieteInner.from_dict(_item) for _item in obj["fachgebiete"]] if obj.get("fachgebiete") is not None else None,
|
||||
"fetched_at": obj.get("fetched_at"),
|
||||
"final_report_abstract_de": obj.get("final_report_abstract_de"),
|
||||
"final_report_abstract_en": obj.get("final_report_abstract_en"),
|
||||
"funding_end": obj.get("funding_end"),
|
||||
"funding_period_de": obj.get("funding_period_de"),
|
||||
"funding_period_en": obj.get("funding_period_en"),
|
||||
"funding_start": obj.get("funding_start"),
|
||||
"funding_type_de": obj.get("funding_type_de"),
|
||||
"funding_type_en": obj.get("funding_type_en"),
|
||||
"funding_type_key": obj.get("funding_type_key"),
|
||||
"funding_type_sort": obj.get("funding_type_sort"),
|
||||
"id": obj.get("id"),
|
||||
"institution_roles_order": obj.get("institution_roles_order"),
|
||||
"institutions": [DFGProjectInstitutionsInner.from_dict(_item) for _item in obj["institutions"]] if obj.get("institutions") is not None else None,
|
||||
"international_relation_de": obj.get("international_relation_de"),
|
||||
"international_relation_en": obj.get("international_relation_en"),
|
||||
"is_transfer_project": obj.get("is_transfer_project"),
|
||||
"link": obj.get("link"),
|
||||
"page_url": obj.get("page_url"),
|
||||
"parent_project_id": obj.get("parent_project_id"),
|
||||
"parent_title_de": obj.get("parent_title_de"),
|
||||
"parent_title_en": obj.get("parent_title_en"),
|
||||
"person_roles_order": obj.get("person_roles_order"),
|
||||
"persons": [DFGProjectPersonsInner.from_dict(_item) for _item in obj["persons"]] if obj.get("persons") is not None else None,
|
||||
"project": DFGProjectProject.from_dict(obj["project"]) if obj.get("project") is not None else None,
|
||||
"project_id": obj.get("project_id"),
|
||||
"project_identifier_de": obj.get("project_identifier_de"),
|
||||
"project_identifier_en": obj.get("project_identifier_en"),
|
||||
"publications": [DFGProjectPublicationsInner.from_dict(_item) for _item in obj["publications"]] if obj.get("publications") is not None else None,
|
||||
"subject_area_de": obj.get("subject_area_de"),
|
||||
"subject_area_en": obj.get("subject_area_en"),
|
||||
"subject_classifications": DFGProjectFachgebieteInner.from_dict(obj["subject_classifications"]) if obj.get("subject_classifications") is not None else None,
|
||||
"subproject_order": obj.get("subproject_order"),
|
||||
"subprojects": [DFGProjectSubprojectsInner.from_dict(_item) for _item in obj["subprojects"]] if obj.get("subprojects") is not None else None,
|
||||
"template_type": obj.get("template_type"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en"),
|
||||
"website_html_de": obj.get("website_html_de"),
|
||||
"website_html_en": obj.get("website_html_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectFachgebieteInner(BaseModel):
|
||||
"""
|
||||
DFGProjectFachgebieteInner
|
||||
""" # noqa: E501
|
||||
fach: Optional[StrictStr] = None
|
||||
fach_code: Optional[StrictStr] = None
|
||||
fachgebiet: Optional[StrictStr] = None
|
||||
fachgebiet_code: Optional[StrictStr] = None
|
||||
fachkollegium: Optional[StrictStr] = None
|
||||
fachkollegium_code: Optional[StrictStr] = None
|
||||
wissenschaftsbereich: Optional[StrictStr] = None
|
||||
wissenschaftsbereich_code: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["fach", "fach_code", "fachgebiet", "fachgebiet_code", "fachkollegium", "fachkollegium_code", "wissenschaftsbereich", "wissenschaftsbereich_code"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectFachgebieteInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectFachgebieteInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"fach": obj.get("fach"),
|
||||
"fach_code": obj.get("fach_code"),
|
||||
"fachgebiet": obj.get("fachgebiet"),
|
||||
"fachgebiet_code": obj.get("fachgebiet_code"),
|
||||
"fachkollegium": obj.get("fachkollegium"),
|
||||
"fachkollegium_code": obj.get("fachkollegium_code"),
|
||||
"wissenschaftsbereich": obj.get("wissenschaftsbereich"),
|
||||
"wissenschaftsbereich_code": obj.get("wissenschaftsbereich_code")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from datetime import datetime
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectInstitutionsInner(BaseModel):
|
||||
"""
|
||||
DFGProjectInstitutionsInner
|
||||
""" # noqa: E501
|
||||
dissolution_date: Optional[datetime] = None
|
||||
has_detail_page: Optional[StrictBool] = None
|
||||
institute_id: Optional[StrictInt] = None
|
||||
institute_name_de: Optional[StrictStr] = None
|
||||
institute_name_en: Optional[StrictStr] = None
|
||||
is_dissolved: Optional[StrictBool] = None
|
||||
is_head_display: Optional[StrictBool] = None
|
||||
project_ref_id: Optional[StrictInt] = None
|
||||
role_group_label_de: Optional[StrictStr] = None
|
||||
role_key: Optional[StrictStr] = None
|
||||
role_label_de: Optional[StrictStr] = None
|
||||
role_label_en: Optional[StrictStr] = None
|
||||
role_sort: Optional[StrictStr] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
sort_name: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["dissolution_date", "has_detail_page", "institute_id", "institute_name_de", "institute_name_en", "is_dissolved", "is_head_display", "project_ref_id", "role_group_label_de", "role_key", "role_label_de", "role_label_en", "role_sort", "sort_criteria", "sort_name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectInstitutionsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectInstitutionsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"dissolution_date": obj.get("dissolution_date"),
|
||||
"has_detail_page": obj.get("has_detail_page"),
|
||||
"institute_id": obj.get("institute_id"),
|
||||
"institute_name_de": obj.get("institute_name_de"),
|
||||
"institute_name_en": obj.get("institute_name_en"),
|
||||
"is_dissolved": obj.get("is_dissolved"),
|
||||
"is_head_display": obj.get("is_head_display"),
|
||||
"project_ref_id": obj.get("project_ref_id"),
|
||||
"role_group_label_de": obj.get("role_group_label_de"),
|
||||
"role_key": obj.get("role_key"),
|
||||
"role_label_de": obj.get("role_label_de"),
|
||||
"role_label_en": obj.get("role_label_en"),
|
||||
"role_sort": obj.get("role_sort"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"sort_name": obj.get("sort_name")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,118 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectPersonsInner(BaseModel):
|
||||
"""
|
||||
DFGProjectPersonsInner
|
||||
""" # noqa: E501
|
||||
affiliation_de: Optional[StrictStr] = None
|
||||
affiliation_en: Optional[StrictStr] = None
|
||||
award_text_de: Optional[StrictStr] = None
|
||||
award_text_en: Optional[StrictStr] = None
|
||||
full_name: Optional[StrictStr] = None
|
||||
is_deceased: Optional[StrictBool] = None
|
||||
is_head_display: Optional[StrictBool] = None
|
||||
person_id: Optional[StrictInt] = None
|
||||
project_ref_id: Optional[StrictInt] = None
|
||||
role_group_label_de: Optional[StrictStr] = None
|
||||
role_key: Optional[StrictStr] = None
|
||||
role_label_de: Optional[StrictStr] = None
|
||||
role_label_en: Optional[StrictStr] = None
|
||||
role_sort: Optional[StrictStr] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
sort_name: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["affiliation_de", "affiliation_en", "award_text_de", "award_text_en", "full_name", "is_deceased", "is_head_display", "person_id", "project_ref_id", "role_group_label_de", "role_key", "role_label_de", "role_label_en", "role_sort", "sort_criteria", "sort_name"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectPersonsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectPersonsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"affiliation_de": obj.get("affiliation_de"),
|
||||
"affiliation_en": obj.get("affiliation_en"),
|
||||
"award_text_de": obj.get("award_text_de"),
|
||||
"award_text_en": obj.get("award_text_en"),
|
||||
"full_name": obj.get("full_name"),
|
||||
"is_deceased": obj.get("is_deceased"),
|
||||
"is_head_display": obj.get("is_head_display"),
|
||||
"person_id": obj.get("person_id"),
|
||||
"project_ref_id": obj.get("project_ref_id"),
|
||||
"role_group_label_de": obj.get("role_group_label_de"),
|
||||
"role_key": obj.get("role_key"),
|
||||
"role_label_de": obj.get("role_label_de"),
|
||||
"role_label_en": obj.get("role_label_en"),
|
||||
"role_sort": obj.get("role_sort"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"sort_name": obj.get("sort_name")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectProject(BaseModel):
|
||||
"""
|
||||
DFGProjectProject
|
||||
""" # noqa: E501
|
||||
abstract_de: Optional[StrictStr] = None
|
||||
abstract_en: Optional[StrictStr] = None
|
||||
equipment_group: Optional[StrictStr] = None
|
||||
equipment_name: Optional[StrictStr] = None
|
||||
external_link: Optional[StrictStr] = None
|
||||
final_report_abstract_de: Optional[StrictStr] = None
|
||||
final_report_abstract_en: Optional[StrictStr] = None
|
||||
funding_end: Optional[StrictInt] = None
|
||||
funding_period_de: Optional[StrictStr] = None
|
||||
funding_period_en: Optional[StrictStr] = None
|
||||
funding_start: Optional[StrictInt] = None
|
||||
funding_type_de: Optional[StrictStr] = None
|
||||
funding_type_en: Optional[StrictStr] = None
|
||||
funding_type_key: Optional[StrictStr] = None
|
||||
funding_type_sort: Optional[StrictStr] = None
|
||||
international_relation_de: Optional[StrictStr] = None
|
||||
international_relation_en: Optional[StrictStr] = None
|
||||
is_transfer_project: Optional[StrictBool] = None
|
||||
parent_project_id: Optional[StrictInt] = None
|
||||
parent_title_de: Optional[StrictStr] = None
|
||||
parent_title_en: Optional[StrictStr] = None
|
||||
project_id: Optional[StrictInt] = None
|
||||
project_identifier_de: Optional[StrictStr] = None
|
||||
project_identifier_en: Optional[StrictStr] = None
|
||||
subject_area_de: Optional[StrictStr] = None
|
||||
subject_area_en: Optional[StrictStr] = None
|
||||
template_type: Optional[StrictStr] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
website_html_de: Optional[StrictStr] = None
|
||||
website_html_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["abstract_de", "abstract_en", "equipment_group", "equipment_name", "external_link", "final_report_abstract_de", "final_report_abstract_en", "funding_end", "funding_period_de", "funding_period_en", "funding_start", "funding_type_de", "funding_type_en", "funding_type_key", "funding_type_sort", "international_relation_de", "international_relation_en", "is_transfer_project", "parent_project_id", "parent_title_de", "parent_title_en", "project_id", "project_identifier_de", "project_identifier_en", "subject_area_de", "subject_area_en", "template_type", "title_de", "title_en", "website_html_de", "website_html_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectProject from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectProject from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"abstract_de": obj.get("abstract_de"),
|
||||
"abstract_en": obj.get("abstract_en"),
|
||||
"equipment_group": obj.get("equipment_group"),
|
||||
"equipment_name": obj.get("equipment_name"),
|
||||
"external_link": obj.get("external_link"),
|
||||
"final_report_abstract_de": obj.get("final_report_abstract_de"),
|
||||
"final_report_abstract_en": obj.get("final_report_abstract_en"),
|
||||
"funding_end": obj.get("funding_end"),
|
||||
"funding_period_de": obj.get("funding_period_de"),
|
||||
"funding_period_en": obj.get("funding_period_en"),
|
||||
"funding_start": obj.get("funding_start"),
|
||||
"funding_type_de": obj.get("funding_type_de"),
|
||||
"funding_type_en": obj.get("funding_type_en"),
|
||||
"funding_type_key": obj.get("funding_type_key"),
|
||||
"funding_type_sort": obj.get("funding_type_sort"),
|
||||
"international_relation_de": obj.get("international_relation_de"),
|
||||
"international_relation_en": obj.get("international_relation_en"),
|
||||
"is_transfer_project": obj.get("is_transfer_project"),
|
||||
"parent_project_id": obj.get("parent_project_id"),
|
||||
"parent_title_de": obj.get("parent_title_de"),
|
||||
"parent_title_en": obj.get("parent_title_en"),
|
||||
"project_id": obj.get("project_id"),
|
||||
"project_identifier_de": obj.get("project_identifier_de"),
|
||||
"project_identifier_en": obj.get("project_identifier_en"),
|
||||
"subject_area_de": obj.get("subject_area_de"),
|
||||
"subject_area_en": obj.get("subject_area_en"),
|
||||
"template_type": obj.get("template_type"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en"),
|
||||
"website_html_de": obj.get("website_html_de"),
|
||||
"website_html_en": obj.get("website_html_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+100
@@ -0,0 +1,100 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectPublicationsInner(BaseModel):
|
||||
"""
|
||||
DFGProjectPublicationsInner
|
||||
""" # noqa: E501
|
||||
authors_editors: Optional[StrictStr] = None
|
||||
doi: Optional[StrictStr] = None
|
||||
project_ref_id: Optional[StrictInt] = None
|
||||
publication_id: Optional[StrictInt] = None
|
||||
publication_year: Optional[StrictInt] = None
|
||||
sort_key: Optional[StrictInt] = None
|
||||
title: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["authors_editors", "doi", "project_ref_id", "publication_id", "publication_year", "sort_key", "title"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectPublicationsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectPublicationsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"authors_editors": obj.get("authors_editors"),
|
||||
"doi": obj.get("doi"),
|
||||
"project_ref_id": obj.get("project_ref_id"),
|
||||
"publication_id": obj.get("publication_id"),
|
||||
"publication_year": obj.get("publication_year"),
|
||||
"sort_key": obj.get("sort_key"),
|
||||
"title": obj.get("title")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+130
@@ -0,0 +1,130 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
DFG Projects API
|
||||
|
||||
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
|
||||
The version of the OpenAPI document: 1.0.0
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
from pydantic_core import to_jsonable_python
|
||||
|
||||
class DFGProjectSubprojectsInner(BaseModel):
|
||||
"""
|
||||
DFGProjectSubprojectsInner
|
||||
""" # noqa: E501
|
||||
funding_end: Optional[StrictInt] = None
|
||||
funding_period_de: Optional[StrictStr] = None
|
||||
funding_period_en: Optional[StrictStr] = None
|
||||
funding_start: Optional[StrictInt] = None
|
||||
group_label_de: Optional[StrictStr] = None
|
||||
group_label_en: Optional[StrictStr] = None
|
||||
is_head_display: Optional[StrictBool] = None
|
||||
parent_project_id: Optional[StrictInt] = None
|
||||
person_first_names: Optional[StrictStr] = None
|
||||
person_id: Optional[StrictInt] = None
|
||||
person_last_name: Optional[StrictStr] = None
|
||||
role_group_label_de: Optional[StrictStr] = None
|
||||
role_key: Optional[StrictStr] = None
|
||||
role_label_de: Optional[StrictStr] = None
|
||||
short_title: Optional[StrictStr] = None
|
||||
sort_criteria: Optional[StrictStr] = None
|
||||
sort_key: Optional[StrictStr] = None
|
||||
status_de: Optional[StrictStr] = None
|
||||
status_en: Optional[StrictStr] = None
|
||||
subproject_id: Optional[StrictInt] = None
|
||||
title_de: Optional[StrictStr] = None
|
||||
title_en: Optional[StrictStr] = None
|
||||
__properties: ClassVar[List[str]] = ["funding_end", "funding_period_de", "funding_period_en", "funding_start", "group_label_de", "group_label_en", "is_head_display", "parent_project_id", "person_first_names", "person_id", "person_last_name", "role_group_label_de", "role_key", "role_label_de", "short_title", "sort_criteria", "sort_key", "status_de", "status_en", "subproject_id", "title_de", "title_en"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
validate_by_name=True,
|
||||
validate_by_alias=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
return json.dumps(to_jsonable_python(self.to_dict()))
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectSubprojectsInner from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of DFGProjectSubprojectsInner from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"funding_end": obj.get("funding_end"),
|
||||
"funding_period_de": obj.get("funding_period_de"),
|
||||
"funding_period_en": obj.get("funding_period_en"),
|
||||
"funding_start": obj.get("funding_start"),
|
||||
"group_label_de": obj.get("group_label_de"),
|
||||
"group_label_en": obj.get("group_label_en"),
|
||||
"is_head_display": obj.get("is_head_display"),
|
||||
"parent_project_id": obj.get("parent_project_id"),
|
||||
"person_first_names": obj.get("person_first_names"),
|
||||
"person_id": obj.get("person_id"),
|
||||
"person_last_name": obj.get("person_last_name"),
|
||||
"role_group_label_de": obj.get("role_group_label_de"),
|
||||
"role_key": obj.get("role_key"),
|
||||
"role_label_de": obj.get("role_label_de"),
|
||||
"short_title": obj.get("short_title"),
|
||||
"sort_criteria": obj.get("sort_criteria"),
|
||||
"sort_key": obj.get("sort_key"),
|
||||
"status_de": obj.get("status_de"),
|
||||
"status_en": obj.get("status_en"),
|
||||
"subproject_id": obj.get("subproject_id"),
|
||||
"title_de": obj.get("title_de"),
|
||||
"title_en": obj.get("title_en")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
Reference in New Issue
Block a user