From 90d07b5ea1b7bc7bca98966b500583018dc6feda Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 19 Jul 2026 20:17:50 +0200 Subject: [PATCH 01/12] change names matching to match_phrase --- .../inse/projects/projects_search_client.py | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index 01a36348..d12b5c5f 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -665,33 +665,18 @@ async def search_dfg_projects( ) if names: name_must_clauses = [] - for full_name in names: - name_parts = full_name.strip().split() - if not name_parts: + full_name = full_name.strip() + if not full_name: continue - match_musts = [] - - for part in name_parts: - match_musts.append( - { - "match": { - "persons.full_name": { - "query": part, - "operator": "and", - } - } - } - ) - name_must_clauses.append( { "nested": { "path": "persons", "query": { - "bool": { - "must": match_musts + "match_phrase": { + "persons.full_name": full_name } }, } @@ -779,6 +764,7 @@ async def search_dfg_projects( sort_config = {"id": {"order": sort_direction}} body["sort"] = [sort_config] + print(body) response = await elasticsearch.search( index=ESIndex.PROJECTS_DFG_ALL, body=body, -- 2.56.1 From 03a5f188b2b1cc64ca70974bd933fce53f1b6997 Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 19 Jul 2026 20:19:07 +0200 Subject: [PATCH 02/12] generated new pydantic models for DFG data --- .../institute/dfg_institute.py | 157 ++++++++++++ .../institute/dfg_institute_institute.py | 130 ++++++++++ .../institute/dfg_institute_projects_inner.py | 120 ++++++++++ .../projects_dfg_v2/person/dfg_person.py | 159 +++++++++++++ .../person/dfg_person_awards_inner.py | 116 +++++++++ .../person/dfg_person_person.py | 120 ++++++++++ .../person/dfg_person_projects_inner.py | 128 ++++++++++ .../projects_dfg_v2/project/dfg_project.py | 224 ++++++++++++++++++ .../project/dfg_project_fachgebiete_inner.py | 102 ++++++++ .../project/dfg_project_institutions_inner.py | 117 +++++++++ .../project/dfg_project_persons_inner.py | 118 +++++++++ .../project/dfg_project_project.py | 148 ++++++++++++ .../project/dfg_project_publications_inner.py | 100 ++++++++ .../project/dfg_project_subprojects_inner.py | 130 ++++++++++ 14 files changed, 1869 insertions(+) create mode 100644 service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_institute.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_projects_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/person/dfg_person_awards_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/person/dfg_person_person.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/person/dfg_person_projects_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_fachgebiete_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_institutions_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_persons_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_project.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_publications_inner.py create mode 100644 service/src/main/inse/models/projects_dfg_v2/project/dfg_project_subprojects_inner.py diff --git a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py new file mode 100644 index 00000000..8e60a5bd --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_institute.py b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_institute.py new file mode 100644 index 00000000..a3bd17ef --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_institute.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_projects_inner.py b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_projects_inner.py new file mode 100644 index 00000000..5dd635dd --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute_projects_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py new file mode 100644 index 00000000..1c833616 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_awards_inner.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_awards_inner.py new file mode 100644 index 00000000..6d64c699 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_awards_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_person.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_person.py new file mode 100644 index 00000000..e9517466 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_person.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_projects_inner.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_projects_inner.py new file mode 100644 index 00000000..6c5349af --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person_projects_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py new file mode 100644 index 00000000..1dd9ed99 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_fachgebiete_inner.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_fachgebiete_inner.py new file mode 100644 index 00000000..1ca663c5 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_fachgebiete_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_institutions_inner.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_institutions_inner.py new file mode 100644 index 00000000..d9f4dd02 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_institutions_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_persons_inner.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_persons_inner.py new file mode 100644 index 00000000..fe4596e5 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_persons_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_project.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_project.py new file mode 100644 index 00000000..9a1b954f --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_project.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_publications_inner.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_publications_inner.py new file mode 100644 index 00000000..3f4cf32c --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_publications_inner.py @@ -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 + + diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_subprojects_inner.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_subprojects_inner.py new file mode 100644 index 00000000..d7bf0801 --- /dev/null +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project_subprojects_inner.py @@ -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 + + -- 2.56.1 From 571ecd5204248da61bb5b6c390474161df1c9ebe Mon Sep 17 00:00:00 2001 From: genja Date: Sun, 19 Jul 2026 20:19:21 +0200 Subject: [PATCH 03/12] generated new pydantic models for DFG data(2) --- .../projects_dfg_v2/institute/dfg_institute.py | 4 ++-- .../inse/models/projects_dfg_v2/person/dfg_person.py | 6 +++--- .../models/projects_dfg_v2/project/dfg_project.py | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py index 8e60a5bd..f23eaddc 100644 --- a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py +++ b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py @@ -20,8 +20,8 @@ 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 service.src.main.inse.models.projects_dfg_v2.institute.dfg_institute_institute import DFGInstituteInstitute +from service.src.main.inse.models.projects_dfg_v2.institute.dfg_institute_projects_inner import DFGInstituteProjectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py index 1c833616..63d7a3f1 100644 --- a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py @@ -20,9 +20,9 @@ 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 service.src.main.inse.models.projects_dfg_v2.person.dfg_person_awards_inner import DFGPersonAwardsInner +from service.src.main.inse.models.projects_dfg_v2.person.dfg_person_person import DFGPersonPerson +from service.src.main.inse.models.projects_dfg_v2.person.dfg_person_projects_inner import DFGPersonProjectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py index 1dd9ed99..f80a1d89 100644 --- a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py @@ -20,12 +20,12 @@ 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 service.src.main.inse.models.projects_dfg_v2.project.dfg_project_fachgebiete_inner import DFGProjectFachgebieteInner +from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_institutions_inner import DFGProjectInstitutionsInner +from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_persons_inner import DFGProjectPersonsInner +from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_project import DFGProjectProject +from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_publications_inner import DFGProjectPublicationsInner +from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_subprojects_inner import DFGProjectSubprojectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -- 2.56.1 From a948182da5be9f32af0a8a20ac8d8f24ffbd9c97 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:16:56 +0200 Subject: [PATCH 04/12] added backed endpoints for DFG persons and institutions filters --- service/src/main/inse/main.py | 4 + .../inse/projects/dfg_institutions/model.py | 8 + .../inse/projects/dfg_institutions/router.py | 47 ++++ .../inse/projects/dfg_institutions/service.py | 200 ++++++++++++++ .../main/inse/projects/dfg_persons/model.py | 8 + .../main/inse/projects/dfg_persons/router.py | 47 ++++ .../main/inse/projects/dfg_persons/service.py | 244 ++++++++++++++++++ service/src/main/inse/tags.py | 3 + webapp/src/app/app.routes.ts | 10 +- 9 files changed, 567 insertions(+), 4 deletions(-) create mode 100644 service/src/main/inse/projects/dfg_institutions/model.py create mode 100644 service/src/main/inse/projects/dfg_institutions/router.py create mode 100644 service/src/main/inse/projects/dfg_institutions/service.py create mode 100644 service/src/main/inse/projects/dfg_persons/model.py create mode 100644 service/src/main/inse/projects/dfg_persons/router.py create mode 100644 service/src/main/inse/projects/dfg_persons/service.py diff --git a/service/src/main/inse/main.py b/service/src/main/inse/main.py index 1fa1b997..083faa6d 100644 --- a/service/src/main/inse/main.py +++ b/service/src/main/inse/main.py @@ -58,6 +58,8 @@ from inse.authors.v2.router import router as authors_v2_router from inse.institutions.v2.router import router as institutions_v2_router from inse.topics.v2.router import router as topics_v2_router +from inse.projects.dfg_institutions.router import router as dfg_institutions_router +from inse.projects.dfg_persons.router import router as dfg_persons_router logger = logging.getLogger(__name__) ### startup @@ -112,6 +114,8 @@ app.include_router(institutions_v2_router) app.include_router(topics_v2_router) app.include_router(dashboard_router) +app.include_router(dfg_institutions_router) +app.include_router(dfg_persons_router) app.include_router(bookmarks_router) app.add_middleware( diff --git a/service/src/main/inse/projects/dfg_institutions/model.py b/service/src/main/inse/projects/dfg_institutions/model.py new file mode 100644 index 00000000..32f18aec --- /dev/null +++ b/service/src/main/inse/projects/dfg_institutions/model.py @@ -0,0 +1,8 @@ +from inse.model import Page +#from inse.models.projects_dfg_v2.institute.dfg_institute import DFGInstitute +from inse.projects.model import DfgInstitutionSummary + +class DfgInstitutionSummaryPage(Page[DfgInstitutionSummary]): + """A paginated response containing a list of institutions.""" + + pass diff --git a/service/src/main/inse/projects/dfg_institutions/router.py b/service/src/main/inse/projects/dfg_institutions/router.py new file mode 100644 index 00000000..a3e74631 --- /dev/null +++ b/service/src/main/inse/projects/dfg_institutions/router.py @@ -0,0 +1,47 @@ +import logging +from typing import Annotated + +from fastapi import APIRouter, Query + +from inse.projects.dfg_institutions.model import DfgInstitutionSummaryPage +from inse.tags import Tags +from inse.projects.dfg_institutions.service import autocomplete_institutions_for_selector, get_institutions_by_ids + +logger = logging.getLogger(__name__) + + +INSTITUTIONS_DFG_PREFIX = "/api/dfg/institutions" + +router = APIRouter(prefix=INSTITUTIONS_DFG_PREFIX, tags=[Tags.DFG_INSTITUTIONS]) + + +@router.get( + "/ids", + operation_id="getDfgInstitutionsByIds", + summary="Returns a list of institutions based on their IDs.", +) +async def get_dfg_institutions( + institution_ids: Annotated[ + list[str], + Query(description="A list of institution IDs to retrieve."), + ] = [], +) -> DfgInstitutionSummaryPage: + + return await get_institutions_by_ids(institution_ids=institution_ids or []) + + +@router.get( + "/autocomplete/selector", + operation_id="getDfgInstitutionAutocompleteForSelector", + summary="Returns a list of institutions based on a search term for autocomplete functionality.", +) +async def get_dfg_institution_autocomplete( + query: Annotated[ + str, + Query( + description="A search term to filter institutions by (partial matches allowed)." + ), + ] = "", +) -> DfgInstitutionSummaryPage: + + return await autocomplete_institutions_for_selector(query=query) diff --git a/service/src/main/inse/projects/dfg_institutions/service.py b/service/src/main/inse/projects/dfg_institutions/service.py new file mode 100644 index 00000000..aeb1f5e4 --- /dev/null +++ b/service/src/main/inse/projects/dfg_institutions/service.py @@ -0,0 +1,200 @@ +import logging +from typing import Dict, List, Optional + +from inse.integrations import elasticsearch +from inse.model import ESIndex, ESCluster +#from inse.models.projects_dfg_v2.institute.dfg_institute import DFGInstitute +from inse.projects.model import DfgInstitutionSummary +from inse.projects.dfg_institutions.model import DfgInstitutionSummaryPage + +logger = logging.getLogger(__name__) + + +async def search_institutions( + page: int = 0, + size: int = 10, + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + sort: Optional[List[Dict]] = None, + body: Optional[Dict] = None, +) -> DfgInstitutionSummaryPage: + """Searches for institutions in the DFG Institutes Elasticsearch index based on the provided parameters. + + Args: + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + query (Optional[Dict], optional): The search query to filter institutions by. Defaults to None. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + sort (Optional[List[Dict]], optional): A list of sorting criteria. Defaults to None. + body (Optional[Dict], optional): The request body for the Elasticsearch search query. Defaults to None. + + Returns: + DfgInstitutionSummaryPage: A page of institutions matching the search criteria. + """ + response = await elasticsearch.search( + index=ESIndex.PROJECTS_DFG_INSTITUTES, + cluster=ESCluster.INSE, + query=query, + source=source, + size=size, + offset=size * page, + sort=sort, + body=body, + ) + + hits_block = response.get("hits", {}) + hits = hits_block.get("hits", []) + institutions: List[DfgInstitutionSummary] = [] + for hit in hits: + _source = hit.get("_source", {}) + # Handle nested institute object if present + if "institute" in _source and isinstance(_source["institute"], dict): + # Merge institute fields into top-level if needed + institute_data = _source.pop("institute") + _source.update(institute_data) + institutions.append(DfgInstitutionSummary(**_source)) # type: ignore + + return DfgInstitutionSummaryPage( + elements=institutions, + total=hits_block.get("total", {}).get("value", len(institutions)), + page=page, + size=size, + ) + + +async def get_institutions_by_ids(institution_ids: List[str]) -> DfgInstitutionSummaryPage: + """Retrieves institutions based on a list of institution IDs. + + Args: + institution_ids (List[str]): A list of institution IDs to retrieve. + + Returns: + DfgInstitutionSummaryPage: A page of institutions matching the provided IDs. + """ + logger.debug(f"Fetching institutions for IDs: {institution_ids}") + if not institution_ids: + return DfgInstitutionSummaryPage(elements=[], total=0, page=0, size=0) + + return await search_institutions( + page=0, + size=len(institution_ids), + query={ + "terms": { + "id": institution_ids + } + }, + source=[ + "id", + "institute_name_de", + "institute_name_en", + "address_country_de", + "address_country_en", + "address_street", + "root_id", + "root_name_de", + "root_name_en", + ], + ) + + +async def autocomplete_institutions( + query: str, page: int = 0, size: int = 10, source: Optional[List[str]] = None +) -> DfgInstitutionSummaryPage: + """Autocompletes institutions based on a search term. + + Args: + query (str): The search term to autocomplete institutions with. + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + source (Optional[List[str]], optional): A list of fields to include in the response. Defaults to None. + + Returns: + DfgInstitutionSummaryPage: A page of institutions matching the autocomplete criteria. + """ + logger.debug(f"Autocomplete institutions for query: {query}") + if not query: + return DfgInstitutionSummaryPage(elements=[], total=0, page=0, size=0) + + return await search_institutions( + page=page, + size=size, + query={ + "bool": { + "should": [ + { + "match_phrase_prefix": { + "institute_name_de": { + "query": query, + "max_expansions": 50, + } + } + }, + { + "match_phrase_prefix": { + "institute_name_en": { + "query": query, + "max_expansions": 50, + } + } + }, + { + "match_phrase_prefix": { + "root_name_de": { + "query": query, + "max_expansions": 50, + } + } + }, + { + "match_phrase_prefix": { + "root_name_en": { + "query": query, + "max_expansions": 50, + } + } + }, + ], + "minimum_should_match": 1, + } + }, + source=source or [ + "id", + "institute_name_de", + "institute_name_en", + "root_id", + "root_name_de", + "root_name_en", + "address_country_de", + "address_country_en", + ], + ) + + +async def autocomplete_institutions_for_selector( + query: str, page: int = 0, size: int = 10 +) -> DfgInstitutionSummaryPage: + """Autocompletes institutions based on a search term for use in a selector component. + + Args: + query (str): The search term to filter institutions by (partial matches allowed). + page (int, optional): The page number to retrieve. Defaults to 0. + size (int, optional): The number of institutions to retrieve per page. Defaults to 10. + + Returns: + DfgInstitutionSummaryPage: A page of institutions matching the autocomplete criteria. + """ + return await autocomplete_institutions( + query=query, + page=page, + size=size, + source=[ + "id", + "institute_name_de", + "institute_name_en", + "root_id", + "root_name_de", + "root_name_en", + "address_country_de", + "address_country_en", + ], + ) \ No newline at end of file diff --git a/service/src/main/inse/projects/dfg_persons/model.py b/service/src/main/inse/projects/dfg_persons/model.py new file mode 100644 index 00000000..1acf1c6e --- /dev/null +++ b/service/src/main/inse/projects/dfg_persons/model.py @@ -0,0 +1,8 @@ +from inse.model import Page +#from inse.models.projects_dfg_v2.institute.dfg_institute import DFGInstitute +from inse.projects.model import DfgPersonSummary + +class DfgPersonSummaryPage(Page[DfgPersonSummary]): + """A paginated response containing a list of persons.""" + + pass diff --git a/service/src/main/inse/projects/dfg_persons/router.py b/service/src/main/inse/projects/dfg_persons/router.py new file mode 100644 index 00000000..a3f6f18f --- /dev/null +++ b/service/src/main/inse/projects/dfg_persons/router.py @@ -0,0 +1,47 @@ +import logging +from typing import Annotated + +from fastapi import APIRouter, Query + +from inse.projects.dfg_persons.model import DfgPersonSummaryPage +from inse.tags import Tags +from inse.projects.dfg_persons.service import autocomplete_persons_for_selector, get_persons_by_ids + +logger = logging.getLogger(__name__) + + +INSTITUTIONS_DFG_PREFIX = "/api/dfg/persons" + +router = APIRouter(prefix=INSTITUTIONS_DFG_PREFIX, tags=[Tags.DFG_PERSONS]) + + +@router.get( + "/ids", + operation_id="getDfgPersonsByIds", + summary="Returns a list of persons based on their IDs.", +) +async def get_dfg_persons_by_ids( + person_ids: Annotated[ + list[str], + Query(description="A list of person IDs to retrieve."), + ] = [], +) -> DfgPersonSummaryPage: + + return await get_persons_by_ids(person_ids=person_ids or []) + + +@router.get( + "/autocomplete/selector", + operation_id="getDfgPersonAutocompleteForSelector", + summary="Returns a list of persons based on a search term for autocomplete functionality.", +) +async def get_dfg_person_autocomplete( + query: Annotated[ + str, + Query( + description="A search term to filter persons by (partial matches allowed)." + ), + ] = "", +) -> DfgPersonSummaryPage: + + return await autocomplete_persons_for_selector(query=query) diff --git a/service/src/main/inse/projects/dfg_persons/service.py b/service/src/main/inse/projects/dfg_persons/service.py new file mode 100644 index 00000000..9685add4 --- /dev/null +++ b/service/src/main/inse/projects/dfg_persons/service.py @@ -0,0 +1,244 @@ +import logging +from typing import Dict, List, Optional + +from inse.integrations import elasticsearch +from inse.model import ESIndex, ESCluster +from inse.projects.model import DfgPersonSummary, DfgInstitutionSummary +from inse.projects.dfg_persons.model import DfgPersonSummaryPage + +logger = logging.getLogger(__name__) + + +async def search_persons( + page: int = 0, + size: int = 10, + query: Optional[Dict] = None, + source: Optional[List[str]] = None, + sort: Optional[List[Dict]] = None, + body: Optional[Dict] = None, +) -> DfgPersonSummaryPage: + """Searches for persons in the DFG Persons Elasticsearch index. + + Args: + page (int, optional): Page number. Defaults to 0. + size (int, optional): Number of results per page. Defaults to 10. + query (Optional[Dict], optional): Elasticsearch query DSL. Defaults to None. + source (Optional[List[str]], optional): Fields to include in response. Defaults to None. + sort (Optional[List[Dict]], optional): Sorting criteria. Defaults to None. + body (Optional[Dict], optional): Full request body. Defaults to None. + + Returns: + DfgPersonSummaryPage: Paginated list of persons. + """ + print(query) + response = await elasticsearch.search( + index=ESIndex.PROJECTS_DFG_PERSONS, + cluster=ESCluster.INSE, + query=query, + source=source, + size=size, + offset=size * page, + sort=sort, + body=body, + ) + + hits_block = response.get("hits", {}) + hits = hits_block.get("hits", []) + persons: List[DfgPersonSummary] = [] + + for hit in hits: + _source = hit.get("_source", {}) + + # Merge top-level person data with nested `person` object + if "person" in _source and isinstance(_source["person"], dict): + person_data = _source.pop("person") + _source.update(person_data) + + # Extract person-level fields + person_id = _source.get("person_id") or _source.get("id") + full_name = _source.get("full_name") + + institution = None + + if "institute_id" in _source and _source.get("institute_id") is not None: + institution = DfgInstitutionSummary( + institute_name_de=_source.get("institute_name_de"), + institute_name_en=_source.get("institute_name_en"), + root_name_de=_source.get("root_name_de"), + root_name_en=_source.get("root_name_en"), + root_id=_source.get("root_id"), + id=_source.get("institute_id"), + ) + + # Extract projects (only first 10 or relevant ones) + projects = [] + if "projects" in _source and isinstance(_source["projects"], list): + for proj in _source["projects"][:size]: # Limit to avoid bloat + projects.append( + DfgPersonSummary( + person_id=person_id, + project_ref_id=proj.get("project_id"), + full_name=full_name, + role_label_en=proj.get("role_label_en"), + role_label_de=proj.get("role_label_de"), + institution=institution, + ) + ) + + # If no projects, still create a summary + if not projects: + projects.append( + DfgPersonSummary( + person_id=person_id, + project_ref_id=None, + full_name=full_name, + role_label_en=None, + role_label_de=None, + institution=institution, + ) + ) + + # Add all project summaries + persons.extend(projects) + + return DfgPersonSummaryPage( + elements=persons, + total=hits_block.get("total", {}).get("value", len(persons)), + page=page, + size=size, + ) + + +async def get_persons_by_ids(person_ids: List[str]) -> DfgPersonSummaryPage: + """Retrieves persons by their IDs. + + Args: + person_ids (List[str]): List of person IDs (as strings). + + Returns: + DfgPersonSummaryPage: Page of persons matching the IDs. + """ + logger.debug(f"Fetching persons for IDs: {person_ids}") + if not person_ids: + return DfgPersonSummaryPage(elements=[], total=0, page=0, size=0) + + return await search_persons( + page=0, + size=len(person_ids), + query={ + "terms": { + "id": person_ids # or "person_id", depending on index mapping + } + }, + source=[ + "id", + "person_id", + "full_name", + "orcid_id", + "is_deceased", + "institute_name_de", + "institute_name_en", + "institute_id", + "root_name_de", + "root_name_en", + "root_id", + ], + ) + + +async def autocomplete_persons( + query: str, + page: int = 0, + size: int = 10, + source: Optional[List[str]] = None, +) -> DfgPersonSummaryPage: + """Autocomplete persons based on full name or ORCID. + + Args: + query (str): Search term. + page (int, optional): Page number. Defaults to 0. + size (int, optional): Results per page. Defaults to 10. + source (Optional[List[str]], optional): Fields to include. Defaults to None. + + Returns: + DfgPersonSummaryPage: Matching persons. + """ + logger.debug(f"Autocomplete persons for query: {query}") + if not query: + return DfgPersonSummaryPage(elements=[], total=0, page=0, size=0) + + return await search_persons( + page=page, + size=size, + query={ + "bool": { + "should": [ + { + "match_phrase_prefix": { + "full_name": { + "query": query, + "max_expansions": 50, + "analyzer": "searchabilityAnalyzer" + } + } + }, + { + "match_phrase_prefix": { + "orcid_id": { + "query": query, + "max_expansions": 50 + } + } + }, + ], + "minimum_should_match": 1, + } + }, + source=source or [ + "id", + "person_id", + "full_name", + "orcid_id", + "institute_name_de", + "institute_name_en", + "institute_id", + "root_name_de", + "root_name_en", + "root_id", + "projects", + ], + ) + + +async def autocomplete_persons_for_selector( + query: str, + page: int = 0, + size: int = 10, +) -> DfgPersonSummaryPage: + """Autocomplete persons for use in a selector UI component. + + Args: + query (str): Search term. + page (int, optional): Page number. Defaults to 0. + size (int, optional): Results per page. Defaults to 10. + + Returns: + DfgPersonSummaryPage: Matching persons with minimal fields. + """ + return await autocomplete_persons( + query=query, + page=page, + size=size, + source=[ + "id", + "person_id", + "full_name", + "orcid_id", + "institute_name_de", + "institute_name_en", + "institute_id", + "root_name_de", + "root_name_en", + "root_id", + ], + ) \ No newline at end of file diff --git a/service/src/main/inse/tags.py b/service/src/main/inse/tags.py index 5eb73000..3a7eefcc 100644 --- a/service/src/main/inse/tags.py +++ b/service/src/main/inse/tags.py @@ -19,3 +19,6 @@ class Tags(StrEnum): INSTITUTIONS_V2 = "Institutions V2" TOPICS_V2 = "Topics V2" WORKS_V2 = "Works V2" + + DFG_INSTITUTIONS = "DFG Institutions" + DFG_PERSONS = "DFG Persons" diff --git a/webapp/src/app/app.routes.ts b/webapp/src/app/app.routes.ts index 459f5e12..5368cc05 100644 --- a/webapp/src/app/app.routes.ts +++ b/webapp/src/app/app.routes.ts @@ -41,6 +41,8 @@ import { personCordisEuProjectPageResolver } from './resolvers/person-cordis-eu- import { selectedAuthorsResolver } from './resolvers/selected-authors.resolver'; import { authorWorkClassificationPageResolver } from './resolvers/author-work-classification-page.resolver'; import { workClassificationResolver } from './resolvers/work-classification.resolver'; +import { selectedDfgAuthorsResolver } from './resolvers/selected-dfg-authors.resolver'; +import { selectedDfgInstitutionsResolver } from './resolvers/selected-dfg-institutions.resolver'; export const routes: Routes = [ { path: '', @@ -380,10 +382,10 @@ export const routes: Routes = [ resolve: { dfgProjectPage: dfgProjectsResolver, personCordisEuProjectPage: personCordisEuProjectPageResolver, - selectedDfgInstitutions: selectedInstitutionsResolver, - selectedDfgAuthors: selectedAuthorsResolver, - selectedEuInstitutions: selectedInstitutionsResolver, - selectedEuAuthors: selectedAuthorsResolver, + selectedDfgInstitutionsPage: selectedDfgInstitutionsResolver, + selectedDfgAuthorsPage: selectedDfgAuthorsResolver, + selectedEuInstitutionsPage: selectedInstitutionsResolver, + selectedEuAuthorsPage: selectedAuthorsResolver, }, runGuardsAndResolvers: 'always', }, -- 2.56.1 From 05929cf76ad26d4276d1d187ed6bd412338f9771 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:17:10 +0200 Subject: [PATCH 05/12] import paths fixed --- .../projects_dfg_v2/institute/dfg_institute.py | 4 ++-- .../inse/models/projects_dfg_v2/person/dfg_person.py | 6 +++--- .../models/projects_dfg_v2/project/dfg_project.py | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py index f23eaddc..49e663a3 100644 --- a/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py +++ b/service/src/main/inse/models/projects_dfg_v2/institute/dfg_institute.py @@ -20,8 +20,8 @@ import json from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from service.src.main.inse.models.projects_dfg_v2.institute.dfg_institute_institute import DFGInstituteInstitute -from service.src.main.inse.models.projects_dfg_v2.institute.dfg_institute_projects_inner import DFGInstituteProjectsInner +from inse.models.projects_dfg_v2.institute.dfg_institute_institute import DFGInstituteInstitute +from inse.models.projects_dfg_v2.institute.dfg_institute_projects_inner import DFGInstituteProjectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py index 63d7a3f1..4cab237e 100644 --- a/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py +++ b/service/src/main/inse/models/projects_dfg_v2/person/dfg_person.py @@ -20,9 +20,9 @@ import json from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from service.src.main.inse.models.projects_dfg_v2.person.dfg_person_awards_inner import DFGPersonAwardsInner -from service.src.main.inse.models.projects_dfg_v2.person.dfg_person_person import DFGPersonPerson -from service.src.main.inse.models.projects_dfg_v2.person.dfg_person_projects_inner import DFGPersonProjectsInner +from inse.models.projects_dfg_v2.person.dfg_person_awards_inner import DFGPersonAwardsInner +from inse.models.projects_dfg_v2.person.dfg_person_person import DFGPersonPerson +from inse.models.projects_dfg_v2.person.dfg_person_projects_inner import DFGPersonProjectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python diff --git a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py index f80a1d89..1fa929ec 100644 --- a/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py +++ b/service/src/main/inse/models/projects_dfg_v2/project/dfg_project.py @@ -20,12 +20,12 @@ import json from datetime import datetime from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr from typing import Any, ClassVar, Dict, List, Optional -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_fachgebiete_inner import DFGProjectFachgebieteInner -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_institutions_inner import DFGProjectInstitutionsInner -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_persons_inner import DFGProjectPersonsInner -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_project import DFGProjectProject -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_publications_inner import DFGProjectPublicationsInner -from service.src.main.inse.models.projects_dfg_v2.project.dfg_project_subprojects_inner import DFGProjectSubprojectsInner +from inse.models.projects_dfg_v2.project.dfg_project_fachgebiete_inner import DFGProjectFachgebieteInner +from inse.models.projects_dfg_v2.project.dfg_project_institutions_inner import DFGProjectInstitutionsInner +from inse.models.projects_dfg_v2.project.dfg_project_persons_inner import DFGProjectPersonsInner +from inse.models.projects_dfg_v2.project.dfg_project_project import DFGProjectProject +from inse.models.projects_dfg_v2.project.dfg_project_publications_inner import DFGProjectPublicationsInner +from inse.models.projects_dfg_v2.project.dfg_project_subprojects_inner import DFGProjectSubprojectsInner from typing import Optional, Set from typing_extensions import Self from pydantic_core import to_jsonable_python -- 2.56.1 From 83f3dc593d680a75d4f9084c47e71dc778e5731f Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:19:05 +0200 Subject: [PATCH 06/12] projects data models adjustments --- service/src/main/inse/projects/logic.py | 4 +- service/src/main/inse/projects/model.py | 52 +++++++++---------- .../inse/projects/projects_search_client.py | 34 ++++++++++-- service/src/main/inse/projects/router.py | 4 +- service/src/main/inse/projects/service.py | 4 +- webapp/src/app/api/.openapi-generator/FILES | 5 ++ webapp/src/app/api/api/api.ts | 6 ++- webapp/src/app/api/model/models.ts | 3 ++ 8 files changed, 72 insertions(+), 40 deletions(-) diff --git a/service/src/main/inse/projects/logic.py b/service/src/main/inse/projects/logic.py index f4a8faea..1ced04f9 100644 --- a/service/src/main/inse/projects/logic.py +++ b/service/src/main/inse/projects/logic.py @@ -34,7 +34,7 @@ from typing import Union logger = logging.getLogger(__name__) -async def get_dfg_author_names_by_ids(author_ids: List[str]) -> Optional[List[str]]: +async def get_dfg_author_names_by_ids(author_ids: List[int]) -> Optional[List[str]]: try: body = { "_source": ["id", "full_name"], @@ -53,7 +53,7 @@ async def get_dfg_author_names_by_ids(author_ids: List[str]) -> Optional[List[st logger.exception(f"Error fetching author names for ids {author_ids}: {str(e)}") return [] -async def get_dfg_institution_names_by_ids(institution_ids: List[str]) -> Optional[List[str]]: +async def get_dfg_institution_names_by_ids(institution_ids: List[int]) -> Optional[List[str]]: try: body = { "_source": ["id","institute_name_de","institute_name_en"], diff --git a/service/src/main/inse/projects/model.py b/service/src/main/inse/projects/model.py index f23f3984..00a59479 100644 --- a/service/src/main/inse/projects/model.py +++ b/service/src/main/inse/projects/model.py @@ -12,6 +12,7 @@ from inse.model import ESIndex from inse.models.projects_eu_cordis.horizon2020.h2020_project_details import H2020ProjectDetails from inse.models.projects_eu_cordis.horizon_europe.heu_project_details import HEUProjectDetails from inse.models.projects_eu_cordis.fp7.fp7_project_details import Fp7ProjectDetails +from inse.models.projects_dfg_v2.project.dfg_project_fachgebiete_inner import DFGProjectFachgebieteInner from typing import Union class ProjectType(StrEnum): @@ -86,17 +87,23 @@ class EuProjectPage(Page): ) class DfgInstitutionSummary(BaseModel): + """A summary of a DFG institution.""" id: int - name_de: Optional[str] = None - name_en: Optional[str] = None + institute_name_de: Optional[str] = None + institute_name_en: Optional[str] = None + root_id: Optional[int] = None + root_name_de: Optional[str] = None + root_name_en: Optional[str] = None + address_country_de: Optional[str] = None + address_country_en: Optional[str] = None class DfgPersonSummary(BaseModel): person_id: int - project_ref_id: int + orcid_id: Optional[str] = None + project_ref_id: Optional[int] = None full_name: Optional[str] = None role_label_en: Optional[str] = None, role_label_de: Optional[str] = None, - root_institution: Optional[DfgInstitutionSummary] = None, institution: Optional[DfgInstitutionSummary] = None @@ -132,14 +139,6 @@ class DfgProjectSummary(BaseModel): description="The funding end date of the DFG project." ) - root_institutions: List[DfgInstitutionSummary] = Field( - default_factory=list, - description=( - "Root institutions associated with the project " - "(e.g. universities or umbrella organizations)." - ), - ) - institutions: List[DfgInstitutionSummary] = Field( default_factory=list, description="Institutions associated with the project." @@ -152,6 +151,10 @@ class DfgProjectSummary(BaseModel): default_factory=list, description="The persons involved in the DFG project.", ) + subject_classifications: Optional[List[DFGProjectFachgebieteInner]] = Field( + default=None, + description="The subject classifications of the DFG project.", + ) @classmethod def from_hit(cls, hit: dict) -> "DfgProjectSummary": source = hit.get("_source", {}) @@ -159,7 +162,6 @@ class DfgProjectSummary(BaseModel): names = [] institutions = {} - root_institutions = {} project_persons = [] persons = source.get("persons", []) @@ -178,35 +180,29 @@ class DfgProjectSummary(BaseModel): if person.get("institute_id") is not None: institution = DfgInstitutionSummary( id=person["institute_id"], - name_de=person.get("institute_name_de"), - name_en=person.get("institute_name_en"), + institute_name_de=person.get("institute_name_de"), + institute_name_en=person.get("institute_name_en"), + address_country_de=person.get("address_country_de"), + address_country_en=person.get("address_country_en"), + root_id=person["root_id"], + root_name_de=person.get("root_name_de"), + root_name_en=person.get("root_name_en"), ) institutions[person["institute_id"]] = institution - root_institution = None - if person.get("root_id") is not None: - root_institution = DfgInstitutionSummary( - id=person["root_id"], - name_de=person.get("root_name_de"), - name_en=person.get("root_name_en"), - ) - - root_institutions[person["root_id"]] = root_institution - if person.get("person_id") is not None: project_persons.append( DfgPersonSummary( person_id=person["person_id"], project_ref_id=person.get("project_ref_id"), + orcid_id=person.get("orcid_id"), full_name=full_name, role_label_en=person.get("role_label_en"), role_label_de=person.get("role_label_de"), - root_institution=root_institution, institution=institution, ) ) - return cls( id=hit.get("_id", ""), link=source.get("link") or source.get("page_url"), @@ -230,10 +226,10 @@ class DfgProjectSummary(BaseModel): if source.get("funding_end") is not None else None ), - root_institutions=list(root_institutions.values()), institutions=list(institutions.values()), names=names, persons=project_persons, + subject_classifications=[DFGProjectFachgebieteInner.from_dict(cls) for cls in source.get('subject_classifications', [])] ) diff --git a/service/src/main/inse/projects/projects_search_client.py b/service/src/main/inse/projects/projects_search_client.py index d12b5c5f..638991c7 100644 --- a/service/src/main/inse/projects/projects_search_client.py +++ b/service/src/main/inse/projects/projects_search_client.py @@ -625,6 +625,7 @@ async def search_dfg_projects( "subject_area_de", "subject_area_en", "persons", + "subject_classifications", ], "query": {}, } @@ -637,7 +638,7 @@ async def search_dfg_projects( { "multi_match": { "query": topic, - "fields": ["title", "title_de", "title_en","abstract_de","abstract_en","subject_area_de","subject_area_en"], + "fields": ["title", "title_de", "title_en","abstract_de","abstract_en","subject_area_de","subject_area_en","subject_classifications.fach","subject_classifications.fachkollegium","subject_classifications.fachgebiet,subject_classifications.fachgebiet_de","subject_classifications.wissenschaftsbereich"], "type": "phrase_prefix", "max_expansions": 100, } @@ -665,18 +666,33 @@ async def search_dfg_projects( ) if names: name_must_clauses = [] + for full_name in names: - full_name = full_name.strip() - if not full_name: + name_parts = full_name.strip().split() + if not name_parts: continue + match_musts = [] + + for part in name_parts: + match_musts.append( + { + "match": { + "persons.full_name": { + "query": part, + "operator": "and", + } + } + } + ) + name_must_clauses.append( { "nested": { "path": "persons", "query": { - "match_phrase": { - "persons.full_name": full_name + "bool": { + "must": match_musts } }, } @@ -798,6 +814,10 @@ async def search_dfg_projects( person["institute_name_de"] = institute.get("institute_name_de") person["institute_name_en"] = institute.get("institute_name_en") + person["address_country_de"] = institute.get("address_country_de") + person["address_country_en"] = institute.get("address_country_en") + + return _complete_response_to_dfg_project_page(response, page, size) @@ -882,6 +902,8 @@ async def get_person_institutes( "root_name_en", "institute_name_de", "institute_name_en", + "address_country_de", + "address_country_en", ], "query": { "terms": { @@ -904,6 +926,8 @@ async def get_person_institutes( "root_name_en": source.get("root_name_en"), "institute_name_de": source.get("institute_name_de"), "institute_name_en": source.get("institute_name_en"), + "address_country_de": source.get("address_country_de"), + "address_country_en": source.get("address_country_en"), } return result diff --git a/service/src/main/inse/projects/router.py b/service/src/main/inse/projects/router.py index fbf99a52..10647600 100644 --- a/service/src/main/inse/projects/router.py +++ b/service/src/main/inse/projects/router.py @@ -315,9 +315,9 @@ async def get_institution_cordis_eu_projects_funding_over_time( ) async def get_dfg_projects( author_id: Annotated[Optional[str], Query(description="The openalex author ID to filter by.")] = None, - author_filter_ids: Annotated[Optional[List[str]], Query(description="The author IDs to filter by.")] = None, + author_filter_ids: Annotated[Optional[List[int]], Query(description="The author IDs to filter by.")] = None, institution_ids: Annotated[ - Optional[List[str]], Query(description="The institution IDs to filter by.") + Optional[List[int]], Query(description="The institution IDs to filter by.") ] = None, title: Annotated[ Optional[str], Query(description="The title to filter by.") diff --git a/service/src/main/inse/projects/service.py b/service/src/main/inse/projects/service.py index 4cde149a..b91f9325 100644 --- a/service/src/main/inse/projects/service.py +++ b/service/src/main/inse/projects/service.py @@ -149,8 +149,8 @@ async def get_cordis_eu_projects_by_institution_id( async def get_dfg_projects_by_author_id( author_id: Optional[str], - author_filter_ids: Optional[List[str]], - institution_ids: Optional[List[str]], + author_filter_ids: Optional[List[int]], + institution_ids: Optional[List[int]], topics: Optional[List[str]], title: Optional[str], funding_years: Optional[List[str]], diff --git a/webapp/src/app/api/.openapi-generator/FILES b/webapp/src/app/api/.openapi-generator/FILES index a6fd90b6..86676070 100644 --- a/webapp/src/app/api/.openapi-generator/FILES +++ b/webapp/src/app/api/.openapi-generator/FILES @@ -8,6 +8,8 @@ api/auth.service.ts api/authorsV2.service.ts api/bookmarks.service.ts api/companyConnections.service.ts +api/dFGInstitutions.service.ts +api/dFGPersons.service.ts api/dashboard.service.ts api/funding.service.ts api/iNSEService.service.ts @@ -74,6 +76,7 @@ model/createOrganizationRequest.ts model/createPersonBookmark.ts model/customAuthor.ts model/customAuthorsListResponse.ts +model/dFGProjectFachgebieteInner.ts model/dashboardStatisticValue.ts model/dashboardStatistics.ts model/dehydratedAuthor.ts @@ -81,7 +84,9 @@ model/dehydratedFunder.ts model/dehydratedInstitution.ts model/dehydratedSource.ts model/dfgInstitutionSummary.ts +model/dfgInstitutionSummaryPage.ts model/dfgPersonSummary.ts +model/dfgPersonSummaryPage.ts model/dfgProjectDetails.ts model/dfgProjectPage.ts model/dfgProjectSummary.ts diff --git a/webapp/src/app/api/api/api.ts b/webapp/src/app/api/api/api.ts index 5fe8de7d..ecd90061 100644 --- a/webapp/src/app/api/api/api.ts +++ b/webapp/src/app/api/api/api.ts @@ -6,6 +6,10 @@ export * from './bookmarks.service'; import { BookmarksService } from './bookmarks.service'; export * from './companyConnections.service'; import { CompanyConnectionsService } from './companyConnections.service'; +export * from './dFGInstitutions.service'; +import { DFGInstitutionsService } from './dFGInstitutions.service'; +export * from './dFGPersons.service'; +import { DFGPersonsService } from './dFGPersons.service'; export * from './dashboard.service'; import { DashboardService } from './dashboard.service'; export * from './funding.service'; @@ -40,4 +44,4 @@ export * from './works.service'; import { WorksService } from './works.service'; export * from './worksV2.service'; import { WorksV2Service } from './worksV2.service'; -export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service]; +export const APIS = [AuthService, AuthorsV2Service, BookmarksService, CompanyConnectionsService, DFGInstitutionsService, DFGPersonsService, DashboardService, FundingService, INSEServiceService, InstitutionsService, InstitutionsV2Service, KeywordsService, NewsService, OrganizationService, PatentsService, PersonNetworkService, PersonsService, ProjectsService, TopicsService, TopicsV2Service, UniversityRankingsService, WorksService, WorksV2Service]; diff --git a/webapp/src/app/api/model/models.ts b/webapp/src/app/api/model/models.ts index 3b2a21f5..fae1f5af 100644 --- a/webapp/src/app/api/model/models.ts +++ b/webapp/src/app/api/model/models.ts @@ -43,6 +43,7 @@ export * from './createOrganizationRequest'; export * from './createPersonBookmark'; export * from './customAuthor'; export * from './customAuthorsListResponse'; +export * from './dFGProjectFachgebieteInner'; export * from './dashboardStatisticValue'; export * from './dashboardStatistics'; export * from './dehydratedAuthor'; @@ -50,7 +51,9 @@ export * from './dehydratedFunder'; export * from './dehydratedInstitution'; export * from './dehydratedSource'; export * from './dfgInstitutionSummary'; +export * from './dfgInstitutionSummaryPage'; export * from './dfgPersonSummary'; +export * from './dfgPersonSummaryPage'; export * from './dfgProjectDetails'; export * from './dfgProjectPage'; export * from './dfgProjectSummary'; -- 2.56.1 From 086915254cffd811c725193cb9af50090d2e482b Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:19:15 +0200 Subject: [PATCH 07/12] edited test for dfg search client --- .../src/main/inse/projects/test_projects_dfg.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/service/src/main/inse/projects/test_projects_dfg.py b/service/src/main/inse/projects/test_projects_dfg.py index c5ab8109..801859e6 100644 --- a/service/src/main/inse/projects/test_projects_dfg.py +++ b/service/src/main/inse/projects/test_projects_dfg.py @@ -14,7 +14,10 @@ async def test_search_dfg_projects(): assert len(res.elements) > 0 for element in res.elements: assert element.id is not None - assert any("Wolfgang Ahrens" in name for name in element.names) + assert any( + all(part.lower() in name.lower() for part in "Wolfgang Ahrens".split()) + for name in element.names + ) @pytest.mark.anyio async def test_get_dfg_project_by_id(): @@ -24,5 +27,11 @@ async def test_get_dfg_project_by_id(): assert project is not None assert project.id == known_id assert project.title is not None - assert any("Wolfgang Ahrens" in person for person in project.associated_persons) - assert any("Leibniz" in inst for inst in project.institutions) + assert any( + all(part.lower() in person.lower() for part in "Wolfgang Ahrens".split()) + for person in project.associated_persons + ) + assert any( + "Leibniz" in inst + for inst in project.institutions + ) -- 2.56.1 From 373d0850a3abf88788c453cfb8bb145af70c8f3d Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:20:24 +0200 Subject: [PATCH 08/12] added 2 DFG projects selectors (will be reworked later) --- ...earchable-dfg-author-select.component.html | 12 +++++ ...earchable-dfg-author-select.component.scss | 0 .../searchable-dfg-author-select.component.ts | 44 +++++++++++++++++++ ...able-dfg-institution-select.component.html | 12 +++++ ...able-dfg-institution-select.component.scss | 0 ...chable-dfg-institution-select.component.ts | 43 ++++++++++++++++++ 6 files changed, 111 insertions(+) create mode 100644 webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.html create mode 100644 webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.scss create mode 100644 webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.ts create mode 100644 webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.html create mode 100644 webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.scss create mode 100644 webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.ts diff --git a/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.html b/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.html new file mode 100644 index 00000000..c52cb15c --- /dev/null +++ b/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.html @@ -0,0 +1,12 @@ + diff --git a/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.scss b/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.ts b/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.ts new file mode 100644 index 00000000..146d37f5 --- /dev/null +++ b/webapp/src/app/shared/ui/searchable-dfg-author-select/searchable-dfg-author-select.component.ts @@ -0,0 +1,44 @@ +import { Component, inject, input, output } from '@angular/core'; +import { DFGPersonsService } from '../../../api'; +import { DfgPersonSummaryPage } from '../../../api/model/dfgPersonSummaryPage'; +import { DfgPersonSummary } from '../../../api/model/dfgPersonSummary'; +import { Observable } from 'rxjs'; +import { SearchableSelectComponent } from '../searchable-select/searchable-select.component'; + +@Component({ + selector: 'app-searchable-dfg-author-select', + imports: [SearchableSelectComponent], + templateUrl: './searchable-dfg-author-select.component.html', + styleUrl: './searchable-dfg-author-select.component.scss', +}) +export class SearchableDfgAuthorSelectComponent { + private readonly dfgPersonsService = inject(DFGPersonsService); + + label = input('Authoren'); + selectedAuthors = input.required(); + + handleAuthorSelectChange = output(); + + fetchAuthors = (searchTerm: string): Observable => { + return this.dfgPersonsService.getDfgPersonAutocompleteForSelector( + searchTerm, + ); + }; + + getAuthorLabel = (author: DfgPersonSummary): string => { + return author.full_name!; + }; + + getAuthorValue = (author: DfgPersonSummary): string => { + return String(author.person_id!); + }; + + getAuthorDescription = (author: DfgPersonSummary): string => { + const orcidId = author.orcid_id ?? 'Unbekannt'; + const roleLabel = + (author.role_label_de || author.role_label_en) ?? 'Unbekannt'; + const rootInstitution = author.institution?.root_name_de ?? 'Unbekannt'; + const institution = author.institution?.institute_name_de ?? 'Unbekannt'; + return `ORCID: ${orcidId} - Rolle: ${roleLabel} - Wurzelinstitution: ${rootInstitution} - Institution: ${institution}`; + }; +} diff --git a/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.html b/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.html new file mode 100644 index 00000000..ea0f7c1f --- /dev/null +++ b/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.html @@ -0,0 +1,12 @@ + diff --git a/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.scss b/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.scss new file mode 100644 index 00000000..e69de29b diff --git a/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.ts b/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.ts new file mode 100644 index 00000000..33e4ff6f --- /dev/null +++ b/webapp/src/app/shared/ui/searchable-dfg-institution-select/searchable-dfg-institution-select.component.ts @@ -0,0 +1,43 @@ +import { Component, inject, input, output } from '@angular/core'; +import { DfgInstitutionSummaryPage } from '../../../api/model/dfgInstitutionSummaryPage'; +import { DfgInstitutionSummary } from '../../../api/model/dfgInstitutionSummary'; +import { DFGInstitutionsService } from '../../../api'; +import { Observable } from 'rxjs'; +import { SearchableSelectComponent } from '../searchable-select/searchable-select.component'; + +@Component({ + selector: 'app-searchable-dfg-institution-select', + imports: [SearchableSelectComponent], + templateUrl: './searchable-dfg-institution-select.component.html', + styleUrl: './searchable-dfg-institution-select.component.scss', +}) +export class SearchableDfgInstitutionSelectComponent { + private readonly dfgInstitutionService = inject(DFGInstitutionsService); + + label = input('Institutionen'); + selectedInstitutions = input.required(); + + handleInstitutionSelectChange = output(); + + fetchInstitutions = ( + searchTerm: string, + ): Observable => { + return this.dfgInstitutionService.getDfgInstitutionAutocompleteForSelector( + searchTerm, + ); + }; + + getInstitutionLabel = (institution: DfgInstitutionSummary): string => { + return institution.institute_name_de! || institution.institute_name_en!; + }; + + getInstitutionValue = (institution: DfgInstitutionSummary): string => { + return Number(institution.id!).toString(); + }; + + getInstitutionDescription = (institution: DfgInstitutionSummary): string => { + return ( + institution.root_name_de! + ' (' + institution.address_country_de! + ')' + ); + }; +} -- 2.56.1 From 577cc8fe7af81e90fc7daebd39edd316aed3f830 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:20:56 +0200 Subject: [PATCH 09/12] added resolvers for dfg authors and institutions filters --- .../selected-dfg-authors.resolver.ts | 22 +++++++++++++++++++ .../selected-dfg-institutions.resolver.ts | 17 ++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 webapp/src/app/resolvers/selected-dfg-authors.resolver.ts create mode 100644 webapp/src/app/resolvers/selected-dfg-institutions.resolver.ts diff --git a/webapp/src/app/resolvers/selected-dfg-authors.resolver.ts b/webapp/src/app/resolvers/selected-dfg-authors.resolver.ts new file mode 100644 index 00000000..c932e13d --- /dev/null +++ b/webapp/src/app/resolvers/selected-dfg-authors.resolver.ts @@ -0,0 +1,22 @@ +import { ResolveFn } from '@angular/router'; +import { inject } from '@angular/core'; + +import { DFGPersonsService } from '../api'; +import { DfgPersonSummaryPage } from '../api/model/dfgPersonSummaryPage'; + +export const selectedDfgAuthorsResolver: ResolveFn = ( + route, + state, +) => { + const authorIdQueryParamKey = + (route.data['authorIdQueryParamKey'] as string) || 'authorId'; + + const authorIds = route.queryParamMap.getAll(authorIdQueryParamKey); + if (authorIds.length === 0) { + return { elements: [] }; + } + + return inject(DFGPersonsService).getDfgPersonsByIds( + authorIds.map((id) => id.trim()).filter((id) => id.length > 0), + ); +}; diff --git a/webapp/src/app/resolvers/selected-dfg-institutions.resolver.ts b/webapp/src/app/resolvers/selected-dfg-institutions.resolver.ts new file mode 100644 index 00000000..f8e595bf --- /dev/null +++ b/webapp/src/app/resolvers/selected-dfg-institutions.resolver.ts @@ -0,0 +1,17 @@ +import { inject } from '@angular/core'; +import { ResolveFn } from '@angular/router'; +import { DFGInstitutionsService } from '../api'; +import { DfgInstitutionSummaryPage } from '../api/model/dfgInstitutionSummaryPage'; + +export const selectedDfgInstitutionsResolver: ResolveFn< + DfgInstitutionSummaryPage +> = (route, state) => { + const institutionIdQueryParamKey = + (route.data['institutionIdQueryParamKey'] as string) || 'institutionId'; + + const institutionIds = route.queryParamMap.getAll(institutionIdQueryParamKey); + + return inject(DFGInstitutionsService).getDfgInstitutionsByIds( + institutionIds.map((id) => id.trim()).filter((id) => id.length > 0), + ); +}; -- 2.56.1 From 8a51484352cf3826d38d565561c9a45f620d77a9 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:22:14 +0200 Subject: [PATCH 10/12] adjustmets in frontend caused by new data models --- .../search-results.component.ts | 1 - .../person-projects.component.html | 8 +-- .../person-projects.component.ts | 11 +-- .../app/resolvers/dfg-projects.resolver.ts | 12 ++-- .../dfg-project-table.component.html | 4 +- .../dfg-project-table.component.ts | 4 +- .../project-filters.component.ts | 72 ++++++++++++------- 7 files changed, 72 insertions(+), 40 deletions(-) diff --git a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts index 874fbe7d..6cb4c2ab 100644 --- a/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts +++ b/webapp/src/app/modules/keywords-search/search-results/search-results.component.ts @@ -214,7 +214,6 @@ export class KeywordsSearchResultsComponent { this.updateQueryParams(event.checked); } updateQueryParams(fuzzy: boolean): void { - console.log('Updating query params with keywords:', fuzzy); const queryParams = { fuzzy: fuzzy, topics: fuzzy ? this.state.topicIds() : null, diff --git a/webapp/src/app/modules/person-projects/person-projects.component.html b/webapp/src/app/modules/person-projects/person-projects.component.html index 1499a315..e5d5bad9 100644 --- a/webapp/src/app/modules/person-projects/person-projects.component.html +++ b/webapp/src/app/modules/person-projects/person-projects.component.html @@ -10,7 +10,7 @@ (selectedIndexChange)="onTabChange($event)"> - + diff --git a/webapp/src/app/modules/person-projects/person-projects.component.ts b/webapp/src/app/modules/person-projects/person-projects.component.ts index 640293a8..2328bff5 100644 --- a/webapp/src/app/modules/person-projects/person-projects.component.ts +++ b/webapp/src/app/modules/person-projects/person-projects.component.ts @@ -1,11 +1,14 @@ import { Component, computed, input } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { toSignal } from '@angular/core/rxjs-interop'; +import { DfgInstitutionSummaryPage } from '../../api/model/dfgInstitutionSummaryPage'; import { CordisEuProjectPage, DfgProjectPage, Author, Institution, + AuthorPage, + InstitutionPageV2, } from '../../api'; import { MatCardModule } from '@angular/material/card'; import { MatTabsModule } from '@angular/material/tabs'; @@ -33,10 +36,10 @@ export class PersonProjectsComponent { dfgProjectPage = input.required(); personCordisEuProjectPage = input.required(); - selectedDfgInstitutions = input.required(); - selectedDfgAuthors = input.required(); - selectedEuInstitutions = input.required(); - selectedEuAuthors = input.required(); + selectedDfgInstitutionsPage = input.required(); + selectedDfgAuthorsPage = input.required(); + selectedEuInstitutionsPage = input.required(); + selectedEuAuthorsPage = input.required(); readonly dfgQueryParamKeys = projectQueryParamKeys; readonly euQueryParamKeys = euProjectQueryParamKeys; diff --git a/webapp/src/app/resolvers/dfg-projects.resolver.ts b/webapp/src/app/resolvers/dfg-projects.resolver.ts index 22ea215a..7d19daba 100644 --- a/webapp/src/app/resolvers/dfg-projects.resolver.ts +++ b/webapp/src/app/resolvers/dfg-projects.resolver.ts @@ -35,10 +35,14 @@ export const dfgProjectsResolver: ResolveFn = ( const topics = route.queryParamMap.getAll(projectQueryParamKeys.topicId); const years = route.queryParamMap.getAll(projectQueryParamKeys.years); - const institutionIds = route.queryParamMap.getAll( - projectQueryParamKeys.institutionId, - ); - const authorIds = route.queryParamMap.getAll(projectQueryParamKeys.authorId); + const institutionIds = route.queryParamMap + .getAll(projectQueryParamKeys.institutionId) + .map((id) => Number(id)) + .filter((id) => !isNaN(id)); + const authorIds = route.queryParamMap + .getAll(projectQueryParamKeys.authorId) + .map((id) => Number(id)) + .filter((id) => !isNaN(id)); console.log( 'RESOLVING', authorIds, diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html index c802f4b3..2d3860e5 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.html @@ -83,7 +83,9 @@ [attr.aria-label]="getInstitutionTooltipText(institution)" (click)="filterByInstitution(institution)"> apartment - {{ institution.name_de }} + {{ + institution.institute_name_de || institution.institute_name_en + }} } @empty { - diff --git a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts index 4685c3e2..050730c8 100644 --- a/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts +++ b/webapp/src/app/shared/ui/dfg-project-table/dfg-project-table.component.ts @@ -99,7 +99,7 @@ export class DfgProjectTableComponent implements OnInit { }, { id: 'names', - header: 'user', + header: 'Autoren', type: 'accessor', accessorKey: 'names', cellTemplate: this.authorsTmp(), @@ -229,7 +229,7 @@ export class DfgProjectTableComponent implements OnInit { } getProjectInstitutionName(institution: any): string { - return institution.name_de ?? institution.name_en; + return institution.institute_name_de ?? institution.institute_name_en; } isInstitutionActive( diff --git a/webapp/src/app/shared/ui/project-filters/project-filters.component.ts b/webapp/src/app/shared/ui/project-filters/project-filters.component.ts index a79fb0a6..999a30dd 100644 --- a/webapp/src/app/shared/ui/project-filters/project-filters.component.ts +++ b/webapp/src/app/shared/ui/project-filters/project-filters.component.ts @@ -3,10 +3,19 @@ import { Router } from '@angular/router'; import { toSignal } from '@angular/core/rxjs-interop'; import { MatButtonModule } from '@angular/material/button'; import { MatIconModule } from '@angular/material/icon'; -import { Author, Institution } from '../../../api'; +import { DfgInstitutionSummaryPage } from '../../../api/model/dfgInstitutionSummaryPage'; +import { DfgInstitutionSummary } from '../../../api/model/dfgInstitutionSummary'; +import { + Author, + AuthorPage, + DfgPersonSummary, + DfgPersonSummaryPage, + Institution, + InstitutionPageV2, +} from '../../../api'; import { QueryParamInputComponent } from '../query-param-input/query-param-input.component'; -import { SearchableInstitutionSelectComponent } from '../searchable-institution-select/searchable-institution-select.component'; -import { SearchableAuthorSelectComponent } from '../searchable-author-select/searchable-author-select.component'; +import { SearchableDfgInstitutionSelectComponent } from '../searchable-dfg-institution-select/searchable-dfg-institution-select.component'; + import { SearchableYearSelectComponent } from '../searchable-year-select/searchable-year-select.component'; import { projectQueryParamKeys } from '../../../resolvers/dfg-projects.resolver'; import { @@ -14,6 +23,7 @@ import { SelectedFiltersComponent, } from '../selected-filters/selected-filters.component'; import { map } from 'rxjs/internal/operators/map'; +import { SearchableDfgAuthorSelectComponent } from '../searchable-dfg-author-select/searchable-dfg-author-select.component'; @Component({ selector: 'app-project-filters', @@ -21,8 +31,8 @@ import { map } from 'rxjs/internal/operators/map'; MatButtonModule, MatIconModule, QueryParamInputComponent, - SearchableInstitutionSelectComponent, - SearchableAuthorSelectComponent, + SearchableDfgInstitutionSelectComponent, + SearchableDfgAuthorSelectComponent, SearchableYearSelectComponent, SelectedFiltersComponent, ], @@ -35,9 +45,20 @@ export class ProjectFilterComponent { // Each tab (DFG / EU) passes its OWN key set so they never collide. queryParamKeys = projectQueryParamKeys; - selectedInstitutions = input([]); selectedTopics = input([]); - selectedAuthors = input([]); + + // selectedAuthorsPage = input(); + // selectedAuthors = computed( + // () => this.selectedAuthorsPage()?.elements || [], + // ); + selectedAuthorsPage = input(); + selectedAuthors = computed( + () => this.selectedAuthorsPage()?.elements || [], + ); + selectedInstitutionsPage = input(); + selectedInstitutions = computed( + () => this.selectedInstitutionsPage()?.elements || [], + ); showTitleFilter = input(true); showInstitutionFilter = input(true); @@ -72,19 +93,20 @@ export class ProjectFilterComponent { institutionLabel = computed(() => { const selected = this.selectedInstitutions().filter((i) => - this.selectedInstitutionIds().includes(i.id!), + this.selectedInstitutionIds().includes(String(i.id!)), ); if (selected.length === 0) return 'Institution'; - if (selected.length === 1) return selected[0].display_name ?? 'Institution'; + if (selected.length === 1) + return selected[0].institute_name_de ?? 'Institution'; return `${selected.length} Institutionen`; }); authorLabel = computed(() => { const selected = this.selectedAuthors().filter((a) => - this.selectedAuthorIds().includes(a.id!), + this.selectedAuthorIds().includes(String(a.person_id!)), ); if (selected.length === 0) return 'Autor'; - if (selected.length === 1) return selected[0].display_name ?? 'Autor'; + if (selected.length === 1) return selected[0].full_name ?? 'Autor'; return `${selected.length} Autoren`; }); @@ -102,16 +124,16 @@ export class ProjectFilterComponent { queryParamKey: keys.institutionId, icon: 'apartment', valueFormatter: (value: string) => - this.selectedInstitutions().find((i) => i.id === value) - ?.display_name ?? value, + this.selectedInstitutions().find((i) => String(i.id) === value) + ?.institute_name_de ?? value, }, { id: 'authors', queryParamKey: keys.authorId, icon: 'person', valueFormatter: (value: string) => - this.selectedAuthors().find((a) => a.id === value)?.display_name ?? - value, + this.selectedAuthors().find((a) => String(a.person_id) === value) + ?.full_name ?? value, }, ]; }); @@ -138,13 +160,15 @@ export class ProjectFilterComponent { }); } }; - handleInstitutionSelectChange = (institution: Institution): void => { + handleInstitutionSelectChange = ( + institution: DfgInstitutionSummary, + ): void => { if (!institution.id) return; const keys = this.queryParamKeys; const selectedIds = this.selectedInstitutionIds(); - const nextIds = selectedIds.includes(institution.id) - ? selectedIds.filter((id) => id !== institution.id) - : [...selectedIds, institution.id]; + const nextIds = selectedIds.includes(String(institution.id)) + ? selectedIds.filter((id) => id !== String(institution.id)) + : [...selectedIds, String(institution.id)]; this.router.navigate([], { queryParams: { [keys.institutionId]: nextIds, [keys.page]: 0 }, @@ -152,13 +176,13 @@ export class ProjectFilterComponent { }); }; - handleAuthorSelectChange = (author: Author): void => { - if (!author.id) return; + handleAuthorSelectChange = (author: DfgPersonSummary): void => { + if (!author.person_id) return; const keys = this.queryParamKeys; const selectedIds = this.selectedAuthorIds(); - const nextIds = selectedIds.includes(author.id) - ? selectedIds.filter((id) => id !== author.id) - : [...selectedIds, author.id]; + const nextIds = selectedIds.includes(String(author.person_id)) + ? selectedIds.filter((id) => id !== String(author.person_id)) + : [...selectedIds, String(author.person_id)]; this.router.navigate([], { queryParams: { [keys.authorId]: nextIds, [keys.page]: 0 }, -- 2.56.1 From 5aedb9d94f5352dae907b0e98b913c5c483a60e4 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:22:36 +0200 Subject: [PATCH 11/12] applied new projects filters --- .../shared/ui/project-filters/project-filters.component.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/webapp/src/app/shared/ui/project-filters/project-filters.component.html b/webapp/src/app/shared/ui/project-filters/project-filters.component.html index e8698b50..bc7d53da 100644 --- a/webapp/src/app/shared/ui/project-filters/project-filters.component.html +++ b/webapp/src/app/shared/ui/project-filters/project-filters.component.html @@ -8,7 +8,7 @@ }
@if (showInstitutionFilter()) { - } @if (showAuthorFilter()) { - -- 2.56.1 From 83ffe6e3f7cdc514c88c91d6cdc5080ab0b84fb3 Mon Sep 17 00:00:00 2001 From: genja Date: Mon, 20 Jul 2026 01:22:48 +0200 Subject: [PATCH 12/12] regenerated models + services --- .../app/api/api/dFGInstitutions.service.ts | 158 ++ webapp/src/app/api/api/dFGPersons.service.ts | 158 ++ webapp/src/app/api/api/patents.service.ts | 11 +- webapp/src/app/api/api/projects.service.ts | 1888 ++++++----------- webapp/src/app/api/api/worksV2.service.ts | 1637 +++++--------- .../api/model/dFGProjectFachgebieteInner.ts | 25 + .../app/api/model/dfgInstitutionSummary.ts | 12 +- .../api/model/dfgInstitutionSummaryPage.ts | 34 + webapp/src/app/api/model/dfgPersonSummary.ts | 4 +- .../src/app/api/model/dfgPersonSummaryPage.ts | 34 + webapp/src/app/api/model/dfgProjectSummary.ts | 6 +- 11 files changed, 1611 insertions(+), 2356 deletions(-) create mode 100644 webapp/src/app/api/api/dFGInstitutions.service.ts create mode 100644 webapp/src/app/api/api/dFGPersons.service.ts create mode 100644 webapp/src/app/api/model/dFGProjectFachgebieteInner.ts create mode 100644 webapp/src/app/api/model/dfgInstitutionSummaryPage.ts create mode 100644 webapp/src/app/api/model/dfgPersonSummaryPage.ts diff --git a/webapp/src/app/api/api/dFGInstitutions.service.ts b/webapp/src/app/api/api/dFGInstitutions.service.ts new file mode 100644 index 00000000..2582d69a --- /dev/null +++ b/webapp/src/app/api/api/dFGInstitutions.service.ts @@ -0,0 +1,158 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { DfgInstitutionSummaryPage } from '../model/dfgInstitutionSummaryPage'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class DFGInstitutionsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a list of institutions based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/institutions/autocomplete/selector + * @param query A search term to filter institutions by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgInstitutionAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgInstitutionAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/institutions/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns a list of institutions based on their IDs. + * @endpoint get /api/dfg/institutions/ids + * @param institutionIds A list of institution IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgInstitutionsByIds(institutionIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgInstitutionsByIds(institutionIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_ids'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/institutions/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/dFGPersons.service.ts b/webapp/src/app/api/api/dFGPersons.service.ts new file mode 100644 index 00000000..edfcf946 --- /dev/null +++ b/webapp/src/app/api/api/dFGPersons.service.ts @@ -0,0 +1,158 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +/* tslint:disable:no-unused-variable member-ordering */ + +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; + +// @ts-ignore +import { DfgPersonSummaryPage } from '../model/dfgPersonSummaryPage'; +// @ts-ignore +import { HTTPValidationError } from '../model/hTTPValidationError'; + +// @ts-ignore +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; +import { BaseService } from '../api.base.service'; + + + +@Injectable({ + providedIn: 'root' +}) +export class DFGPersonsService extends BaseService { + + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Returns a list of persons based on a search term for autocomplete functionality. + * @endpoint get /api/dfg/persons/autocomplete/selector + * @param query A search term to filter persons by (partial matches allowed). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgPersonAutocompleteForSelector(query?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgPersonAutocompleteForSelector(query?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + query, 'query'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/persons/autocomplete/selector`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Returns a list of persons based on their IDs. + * @endpoint get /api/dfg/persons/ids + * @param personIds A list of person IDs to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgPersonsByIds(personIds?: Array, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgPersonsByIds(personIds?: Array, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgPersonsByIds(personIds?: Array, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgPersonsByIds(personIds?: Array, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (personIds) { + personIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'person_ids'); + }) + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/dfg/persons/ids`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + +} diff --git a/webapp/src/app/api/api/patents.service.ts b/webapp/src/app/api/api/patents.service.ts index ec6e9280..c3f30c46 100644 --- a/webapp/src/app/api/api/patents.service.ts +++ b/webapp/src/app/api/api/patents.service.ts @@ -201,14 +201,13 @@ export class PatentsService extends BaseService { * @param identifier * @param prefix * @param title - * @param fillingDate * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. * @param reportProgress flag to report request and response progress. */ - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; - public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, fillingDate?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getPatentByIdOrTitle(identifier: string, prefix?: string, title?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { if (identifier === null || identifier === undefined) { throw new Error('Required parameter identifier was null or undefined when calling getPatentByIdOrTitle.'); } @@ -218,8 +217,6 @@ export class PatentsService extends BaseService { prefix, 'prefix'); localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, title, 'title'); - localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, - fillingDate, 'filling_date'); let localVarHeaders = this.defaultHeaders; diff --git a/webapp/src/app/api/api/projects.service.ts b/webapp/src/app/api/api/projects.service.ts index 34ed25af..0928793a 100644 --- a/webapp/src/app/api/api/projects.service.ts +++ b/webapp/src/app/api/api/projects.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { BundProjectDetails } from '../model/bundProjectDetails'; @@ -52,1259 +46,675 @@ import { ProjectsSortBy } from '../model/projectsSortBy'; import { SortDirection } from '../model/sortDirection'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class ProjectsService extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Get DFG projects. - * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/person/dfg/search - * @param authorId The openalex author ID to filter by. - * @param authorFilterIds The author IDs to filter by. - * @param institutionIds The institution IDs to filter by. - * @param title The title to filter by. - * @param topics The topics to filter by. - * @param fundingYears The funding years to filter by. - * @param page The page number. - * @param size The page size. - * @param sortBy The field to sort by. - * @param sortDirection The sort direction (asc or desc). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getDfgProjects( - authorId?: string, - authorFilterIds?: Array, - institutionIds?: Array, - title?: string, - topics?: Array, - fundingYears?: Array, - page?: number, - size?: number, - sortBy?: string, - sortDirection?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getDfgProjects( - authorId?: string, - authorFilterIds?: Array, - institutionIds?: Array, - title?: string, - topics?: Array, - fundingYears?: Array, - page?: number, - size?: number, - sortBy?: string, - sortDirection?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDfgProjects( - authorId?: string, - authorFilterIds?: Array, - institutionIds?: Array, - title?: string, - topics?: Array, - fundingYears?: Array, - page?: number, - size?: number, - sortBy?: string, - sortDirection?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getDfgProjects( - authorId?: string, - authorFilterIds?: Array, - institutionIds?: Array, - title?: string, - topics?: Array, - fundingYears?: Array, - page?: number, - size?: number, - sortBy?: string, - sortDirection?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - authorId, - 'author_id', - ); - if (authorFilterIds) { - authorFilterIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'author_filter_ids', + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); + } + + /** + * Get DFG projects. + * Returns a page of DFG projects based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/person/dfg/search + * @param authorId The openalex author ID to filter by. + * @param authorFilterIds The author IDs to filter by. + * @param institutionIds The institution IDs to filter by. + * @param title The title to filter by. + * @param topics The topics to filter by. + * @param fundingYears The funding years to filter by. + * @param page The page number. + * @param size The page size. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getDfgProjects(authorId?: string, authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, fundingYears?: Array, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getDfgProjects(authorId?: string, authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, fundingYears?: Array, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgProjects(authorId?: string, authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, fundingYears?: Array, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getDfgProjects(authorId?: string, authorFilterIds?: Array, institutionIds?: Array, title?: string, topics?: Array, fundingYears?: Array, page?: number, size?: number, sortBy?: string, sortDirection?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + authorId, 'author_id'); + if (authorFilterIds) { + authorFilterIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'author_filter_ids'); + }) + } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_ids'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topics'); + }) + } + if (fundingYears) { + fundingYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'funding_years'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/person/dfg/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_ids', + + /** + * Get EU projects for an author. + * Returns a list of EU projects associated with the specified author ID. + * @endpoint get /api/projects/author/{raw_oa_author_id}/eu + * @param rawOaAuthorId The author ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getEuProjectsForAuthor(rawOaAuthorId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getEuProjectsForAuthor(rawOaAuthorId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getEuProjectsForAuthor.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}/eu`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topics', + + /** + * Get funding over time for bund projects. + * Returns the funding over time for bund projects associated with the specified institution. + * @endpoint get /api/projects/institution/bund/funding-over-time + * @param rawOaInstitutionId The institution ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionBundProjectsFundingOverTime(rawOaInstitutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionBundProjectsFundingOverTime.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + rawOaInstitutionId, 'raw_oa_institution_id'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/bund/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (fundingYears) { - fundingYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'funding_years', + + /** + * Get funding over time for EU projects. + * Returns the funding over time for EU projects associated with the specified institution. + * @endpoint get /api/projects/institution/eu/funding-over-time + * @param rawOaInstitutionId The institution ID to filter by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionCordisEuProjectsFundingOverTime(rawOaInstitutionId: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionCordisEuProjectsFundingOverTime.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + rawOaInstitutionId, 'raw_oa_institution_id'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/eu/funding-over-time`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortDirection, - 'sort_direction', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Get a single BUND project. + * Returns a single BUND project based on its ID. + * @endpoint get /api/projects/bund/{id} + * @param id The ID of the BUND project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleBundProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSingleBundProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleBundProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleBundProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSingleBundProject.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - let localVarPath = `/api/projects/person/dfg/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - /** - * Get EU projects for an author. - * Returns a list of EU projects associated with the specified author ID. - * @endpoint get /api/projects/author/{raw_oa_author_id}/eu - * @param rawOaAuthorId The author ID to filter by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getEuProjectsForAuthor( - rawOaAuthorId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getEuProjectsForAuthor( - rawOaAuthorId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getEuProjectsForAuthor( - rawOaAuthorId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getEuProjectsForAuthor( - rawOaAuthorId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error( - 'Required parameter rawOaAuthorId was null or undefined when calling getEuProjectsForAuthor.', - ); - } + const localVarTransferCache: boolean = options?.transferCache ?? true; - let localVarHeaders = this.defaultHeaders; - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}/eu`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get funding over time for bund projects. - * Returns the funding over time for bund projects associated with the specified institution. - * @endpoint get /api/projects/institution/bund/funding-over-time - * @param rawOaInstitutionId The institution ID to filter by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionBundProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getInstitutionBundProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionBundProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionBundProjectsFundingOverTime( - rawOaInstitutionId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error( - 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionBundProjectsFundingOverTime.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - rawOaInstitutionId, - 'raw_oa_institution_id', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/institution/bund/funding-over-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get funding over time for EU projects. - * Returns the funding over time for EU projects associated with the specified institution. - * @endpoint get /api/projects/institution/eu/funding-over-time - * @param rawOaInstitutionId The institution ID to filter by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionCordisEuProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getInstitutionCordisEuProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionCordisEuProjectsFundingOverTime( - rawOaInstitutionId: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionCordisEuProjectsFundingOverTime( - rawOaInstitutionId: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error( - 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionCordisEuProjectsFundingOverTime.', - ); - } - - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - rawOaInstitutionId, - 'raw_oa_institution_id', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/institution/eu/funding-over-time`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get a single BUND project. - * Returns a single BUND project based on its ID. - * @endpoint get /api/projects/bund/{id} - * @param id The ID of the BUND project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleBundProject( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getSingleBundProject( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleBundProject( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleBundProject( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getSingleBundProject.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/bund/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get a single DFG project. - * Returns a single DFG project based on its ID. - * @endpoint get /api/projects/dfg/{id} - * @param id The ID of the DFG project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleDfgProject( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getSingleDfgProject( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleDfgProject( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleDfgProject( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getSingleDfgProject.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/dfg/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get a single EU Cordis project. - * Returns a single EU Cordis project based on its ID. - * @endpoint get /api/projects/eu/{id} - * @param id The ID of the EU Cordis project to retrieve. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getSingleEuCordisProject( - id: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getSingleEuCordisProject( - id: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleEuCordisProject( - id: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getSingleEuCordisProject( - id: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (id === null || id === undefined) { - throw new Error( - 'Required parameter id was null or undefined when calling getSingleEuCordisProject.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/eu/${this.configuration.encodeParam({ name: 'id', value: id, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get bund projects. - * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. - * @endpoint post /api/projects/institution/bund/search - * @param projectsFilteringProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchBundProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchBundProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchBundProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchBundProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if ( - projectsFilteringProperties === null || - projectsFilteringProperties === undefined - ) { - throw new Error( - 'Required parameter projectsFilteringProperties was null or undefined when calling searchBundProjects.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/institution/bund/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: projectsFilteringProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Get EU projects. - * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. - * @endpoint post /api/projects/institution/eu/search - * @param projectsFilteringProperties - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchCordisEuProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchCordisEuProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchCordisEuProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchCordisEuProjects( - projectsFilteringProperties: ProjectsFilteringProperties, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if ( - projectsFilteringProperties === null || - projectsFilteringProperties === undefined - ) { - throw new Error( - 'Required parameter projectsFilteringProperties was null or undefined when calling searchCordisEuProjects.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - // to determine the Content-Type header - const consumes: string[] = ['application/json']; - const httpContentTypeSelected: string | undefined = - this.configuration.selectHeaderContentType(consumes); - if (httpContentTypeSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Content-Type', - httpContentTypeSelected, - ); - } - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/projects/institution/eu/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'post', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - body: projectsFilteringProperties, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Search projects across all funders. - * Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter. - * @endpoint get /api/projects/search - * @param page The page number. - * @param size The page size. - * @param selectedProjectTypes The set of project types to filter by (e.g., \'bund\', \'eu\', \'dfg\'). If not provided, projects of all types will be included. - * @param title The title to filter by. - * @param sortBy The field to sort by. - * @param sortDirection The sort direction (asc or desc). - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public searchProjects( - page?: number, - size?: number, - selectedProjectTypes?: Set, - title?: string, - sortBy?: ProjectsSortBy, - sortDirection?: SortDirection, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public searchProjects( - page?: number, - size?: number, - selectedProjectTypes?: Set, - title?: string, - sortBy?: ProjectsSortBy, - sortDirection?: SortDirection, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchProjects( - page?: number, - size?: number, - selectedProjectTypes?: Set, - title?: string, - sortBy?: ProjectsSortBy, - sortDirection?: SortDirection, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public searchProjects( - page?: number, - size?: number, - selectedProjectTypes?: Set, - title?: string, - sortBy?: ProjectsSortBy, - sortDirection?: SortDirection, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - if (selectedProjectTypes) { - selectedProjectTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'selected_project_types', + let localVarPath = `/api/projects/bund/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortDirection, - 'sort_direction', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Get a single DFG project. + * Returns a single DFG project based on its ID. + * @endpoint get /api/projects/dfg/{id} + * @param id The ID of the DFG project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleDfgProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSingleDfgProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleDfgProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleDfgProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSingleDfgProject.'); + } - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarHeaders = this.defaultHeaders; - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/dfg/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Get a single EU Cordis project. + * Returns a single EU Cordis project based on its ID. + * @endpoint get /api/projects/eu/{id} + * @param id The ID of the EU Cordis project to retrieve. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getSingleEuCordisProject(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getSingleEuCordisProject(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleEuCordisProject(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getSingleEuCordisProject(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (id === null || id === undefined) { + throw new Error('Required parameter id was null or undefined when calling getSingleEuCordisProject.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/eu/${this.configuration.encodeParam({name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Get bund projects. + * Returns a page of bund projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/bund/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchBundProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (projectsFilteringProperties === null || projectsFilteringProperties === undefined) { + throw new Error('Required parameter projectsFilteringProperties was null or undefined when calling searchBundProjects.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/bund/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Get EU projects. + * Returns a page of EU projects based on the provided pagination parameters and optional institution filter. + * @endpoint post /api/projects/institution/eu/search + * @param projectsFilteringProperties + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchCordisEuProjects(projectsFilteringProperties: ProjectsFilteringProperties, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (projectsFilteringProperties === null || projectsFilteringProperties === undefined) { + throw new Error('Required parameter projectsFilteringProperties was null or undefined when calling searchCordisEuProjects.'); + } + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + // to determine the Content-Type header + const consumes: string[] = [ + 'application/json' + ]; + const httpContentTypeSelected: string | undefined = this.configuration.selectHeaderContentType(consumes); + if (httpContentTypeSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); + } + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/institution/eu/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('post', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + body: projectsFilteringProperties, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); + } + + /** + * Search projects across all funders. + * Returns a page of projects across all funders based on the provided pagination parameters and optional institution filter. + * @endpoint get /api/projects/search + * @param page The page number. + * @param size The page size. + * @param selectedProjectTypes The set of project types to filter by (e.g., \'bund\', \'eu\', \'dfg\'). If not provided, projects of all types will be included. + * @param title The title to filter by. + * @param sortBy The field to sort by. + * @param sortDirection The sort direction (asc or desc). + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public searchProjects(page?: number, size?: number, selectedProjectTypes?: Set, title?: string, sortBy?: ProjectsSortBy, sortDirection?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + if (selectedProjectTypes) { + selectedProjectTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'selected_project_types'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortDirection, 'sort_direction'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/projects/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } + ); } - let localVarPath = `/api/projects/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/api/worksV2.service.ts b/webapp/src/app/api/api/worksV2.service.ts index 336ad96c..78013c2d 100644 --- a/webapp/src/app/api/api/worksV2.service.ts +++ b/webapp/src/app/api/api/worksV2.service.ts @@ -1,7 +1,7 @@ /** * Innovation Search Engine API * - * + * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech @@ -9,18 +9,12 @@ */ /* tslint:disable:no-unused-variable member-ordering */ -import { Inject, Injectable, Optional } from '@angular/core'; -import { - HttpClient, - HttpHeaders, - HttpParams, - HttpResponse, - HttpEvent, - HttpParameterCodec, - HttpContext, -} from '@angular/common/http'; -import { CustomHttpParameterCodec } from '../encoder'; -import { Observable } from 'rxjs'; +import { Inject, Injectable, Optional } from '@angular/core'; +import { HttpClient, HttpHeaders, HttpParams, + HttpResponse, HttpEvent, HttpParameterCodec, HttpContext + } from '@angular/common/http'; +import { CustomHttpParameterCodec } from '../encoder'; +import { Observable } from 'rxjs'; // @ts-ignore import { HTTPValidationError } from '../model/hTTPValidationError'; @@ -38,1120 +32,559 @@ import { WorkPageV2 } from '../model/workPageV2'; import { WorkSortBy } from '../model/workSortBy'; // @ts-ignore -import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; -import { Configuration } from '../configuration'; +import { BASE_PATH, COLLECTION_FORMATS } from '../variables'; +import { Configuration } from '../configuration'; import { BaseService } from '../api.base.service'; + + @Injectable({ - providedIn: 'root', + providedIn: 'root' }) export class WorksV2Service extends BaseService { - constructor( - protected httpClient: HttpClient, - @Optional() @Inject(BASE_PATH) basePath: string | string[], - @Optional() configuration?: Configuration, - ) { - super(basePath, configuration); - } - /** - * Returns a paginated list of works for a given author based on their ID. - * @endpoint get /api/v2/works/author/{raw_oa_author_id} - * @param rawOaAuthorId The raw OpenAlex author id. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param title A title to filter by (partial matches allowed). - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getAuthorWorkPage( - rawOaAuthorId: string, - page?: number, - size?: number, - title?: string, - publicationYears?: Array, - publicationTypes?: Array, - institutionIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getAuthorWorkPage( - rawOaAuthorId: string, - page?: number, - size?: number, - title?: string, - publicationYears?: Array, - publicationTypes?: Array, - institutionIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorkPage( - rawOaAuthorId: string, - page?: number, - size?: number, - title?: string, - publicationYears?: Array, - publicationTypes?: Array, - institutionIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getAuthorWorkPage( - rawOaAuthorId: string, - page?: number, - size?: number, - title?: string, - publicationYears?: Array, - publicationTypes?: Array, - institutionIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error( - 'Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.', - ); + constructor(protected httpClient: HttpClient, @Optional() @Inject(BASE_PATH) basePath: string|string[], @Optional() configuration?: Configuration) { + super(basePath, configuration); } - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_years', + /** + * Returns a paginated list of works for a given author based on their ID. + * @endpoint get /api/v2/works/author/{raw_oa_author_id} + * @param rawOaAuthorId The raw OpenAlex author id. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param title A title to filter by (partial matches allowed). + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getAuthorWorkPage(rawOaAuthorId: string, page?: number, size?: number, title?: string, publicationYears?: Array, publicationTypes?: Array, institutionIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getAuthorWorkPage.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_years'); + }) + } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_types'); + }) + } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_ids'); + }) + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_ids'); + }) + } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'language_codes'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sort_order'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_types', + + /** + * Returns a paginated list of works for a given institution based on their ID. + * @endpoint get /api/v2/works/institution/{raw_oa_institution_id} + * @param rawOaInstitutionId The raw OpenAlex institution id. + * @param page The page number to retrieve. (0-based) + * @param title A title to filter by (partial matches allowed). + * @param size The number of works to retrieve per page. + * @param publicationYears A list of publication years to filter by. + * @param publicationTypes A list of publication types to filter by. + * @param authorIds A list of author IDs to filter by. + * @param topicIds A list of topic IDs to filter by. + * @param languageCodes A list of language codes to filter by. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getInstitutionWorkPage(rawOaInstitutionId: string, page?: number, title?: string, size?: number, publicationYears?: Array, publicationTypes?: Array, authorIds?: Array, topicIds?: Array, languageCodes?: Array, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { + throw new Error('Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.'); + } + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + if (publicationYears) { + publicationYears.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_years'); + }) + } + if (publicationTypes) { + publicationTypes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_types'); + }) + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'author_ids'); + }) + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_ids'); + }) + } + if (languageCodes) { + languageCodes.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'language_codes'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sort_order'); + + let localVarHeaders = this.defaultHeaders; + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/institution/${this.configuration.encodeParam({name: "rawOaInstitutionId", value: rawOaInstitutionId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_ids', + + /** + * Returns the classifications of a work based on its ID. + * @endpoint get /api/v2/works/classification/work/{raw_oa_work_id} + * @param rawOaWorkId The raw OpenAlex work id. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationByWorkId(rawOaWorkId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaWorkId === null || rawOaWorkId === undefined) { + throw new Error('Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/classification/work/${this.configuration.encodeParam({name: "rawOaWorkId", value: rawOaWorkId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_ids', + + /** + * Returns the classifications of an author\'s works based on their ID. + * @endpoint get /api/v2/works/classification/author/{raw_oa_author_id} + * @param rawOaAuthorId The raw OpenAlex author id. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationsByAuthorId(rawOaAuthorId: string, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + if (rawOaAuthorId === null || rawOaAuthorId === undefined) { + throw new Error('Required parameter rawOaAuthorId was null or undefined when calling getWorkClassificationsByAuthorId.'); + } + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/classification/author/${this.configuration.encodeParam({name: "rawOaAuthorId", value: rawOaAuthorId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined})}`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'language_codes', + + /** + * Returns the classifications of works based on their IDs. + * @endpoint get /api/v2/works/classification/works/search + * @param workIds A list of OpenAlex work IDs to retrieve classifications for. + * @param page The page number to retrieve. (0-based) + * @param size The number of classifications to retrieve per page. + * @param secureFgpAcc + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorkClassificationsByWorkIds(workIds?: Array, page?: number, size?: number, secureFgpAcc?: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { + + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (workIds) { + workIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'work_ids'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + + let localVarHeaders = this.defaultHeaders; + + // authentication (HTTPBearer) required + localVarHeaders = this.configuration.addCredentialToHeaders('HTTPBearer', 'Authorization', localVarHeaders, 'Bearer '); + + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } + + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); + + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/classification/works/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sort_order', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); + /** + * Search works by topics or raw keywords with filters. + * @endpoint get /api/v2/works/keyword/search + * @param topics List of topics to match. + * @param topicIds List of topic IDs to match. + * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. + * @param keywords Raw keywords to search in title/abstract. + * @param fuzzy Use topic resolution if True, otherwise use raw keywords. + * @param publicationYear A list of publication years to filter by. + * @param publicationType A list of publication types to filter by. + * @param institutionIds A list of institution IDs to filter by. + * @param authorIds A list of author IDs to filter by. + * @param language A list of language codes to filter by. + * @param title Title to search for in works. + * @param page The page number to retrieve. (0-based) + * @param size The number of works to retrieve per page. + * @param sortBy The field to sort by. + * @param sortOrder The order to sort by. + * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. + * @param reportProgress flag to report request and response progress. + */ + public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable; + public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable>; + public getWorksByKeywords(topics?: Array, topicIds?: Array, filterTopicIds?: Array, keywords?: Array, fuzzy?: boolean, publicationYear?: Array, publicationType?: Array, institutionIds?: Array, authorIds?: Array, language?: Array, title?: string, page?: number, size?: number, sortBy?: WorkSortBy, sortOrder?: SortDirection, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: 'application/json', context?: HttpContext, transferCache?: boolean}): Observable { - const localVarTransferCache: boolean = options?.transferCache ?? true; + let localVarQueryParameters = new HttpParams({encoder: this.encoder}); + if (topics) { + topics.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topics'); + }) + } + if (topicIds) { + topicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'topic_ids'); + }) + } + if (filterTopicIds) { + filterTopicIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'filter_topic_ids'); + }) + } + if (keywords) { + keywords.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'keywords'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + fuzzy, 'fuzzy'); + if (publicationYear) { + publicationYear.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_year'); + }) + } + if (publicationType) { + publicationType.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'publication_type'); + }) + } + if (institutionIds) { + institutionIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'institution_ids'); + }) + } + if (authorIds) { + authorIds.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'author_ids'); + }) + } + if (language) { + language.forEach((element) => { + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + element, 'language'); + }) + } + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + title, 'title'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + page, 'page'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + size, 'size'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortBy, 'sort_by'); + localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, + sortOrder, 'sort_order'); - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } + let localVarHeaders = this.defaultHeaders; - let localVarPath = `/api/v2/works/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } + const localVarHttpHeaderAcceptSelected: string | undefined = options?.httpHeaderAccept ?? this.configuration.selectHeaderAccept([ + 'application/json' + ]); + if (localVarHttpHeaderAcceptSelected !== undefined) { + localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); + } - /** - * Returns a paginated list of works for a given institution based on their ID. - * @endpoint get /api/v2/works/institution/{raw_oa_institution_id} - * @param rawOaInstitutionId The raw OpenAlex institution id. - * @param page The page number to retrieve. (0-based) - * @param title A title to filter by (partial matches allowed). - * @param size The number of works to retrieve per page. - * @param publicationYears A list of publication years to filter by. - * @param publicationTypes A list of publication types to filter by. - * @param authorIds A list of author IDs to filter by. - * @param topicIds A list of topic IDs to filter by. - * @param languageCodes A list of language codes to filter by. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getInstitutionWorkPage( - rawOaInstitutionId: string, - page?: number, - title?: string, - size?: number, - publicationYears?: Array, - publicationTypes?: Array, - authorIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getInstitutionWorkPage( - rawOaInstitutionId: string, - page?: number, - title?: string, - size?: number, - publicationYears?: Array, - publicationTypes?: Array, - authorIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionWorkPage( - rawOaInstitutionId: string, - page?: number, - title?: string, - size?: number, - publicationYears?: Array, - publicationTypes?: Array, - authorIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getInstitutionWorkPage( - rawOaInstitutionId: string, - page?: number, - title?: string, - size?: number, - publicationYears?: Array, - publicationTypes?: Array, - authorIds?: Array, - topicIds?: Array, - languageCodes?: Array, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaInstitutionId === null || rawOaInstitutionId === undefined) { - throw new Error( - 'Required parameter rawOaInstitutionId was null or undefined when calling getInstitutionWorkPage.', - ); - } + const localVarHttpContext: HttpContext = options?.context ?? new HttpContext(); - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - if (publicationYears) { - publicationYears.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_years', + const localVarTransferCache: boolean = options?.transferCache ?? true; + + + let responseType_: 'text' | 'json' | 'blob' = 'json'; + if (localVarHttpHeaderAcceptSelected) { + if (localVarHttpHeaderAcceptSelected.startsWith('text')) { + responseType_ = 'text'; + } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { + responseType_ = 'json'; + } else { + responseType_ = 'blob'; + } + } + + let localVarPath = `/api/v2/works/keyword/search`; + const { basePath, withCredentials } = this.configuration; + return this.httpClient.request('get', `${basePath}${localVarPath}`, + { + context: localVarHttpContext, + params: localVarQueryParameters, + responseType: responseType_, + ...(withCredentials ? { withCredentials } : {}), + headers: localVarHeaders, + observe: observe, + ...(localVarTransferCache !== undefined ? { transferCache: localVarTransferCache } : {}), + reportProgress: reportProgress + } ); - }); - } - if (publicationTypes) { - publicationTypes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_types', - ); - }); - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'author_ids', - ); - }); - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_ids', - ); - }); - } - if (languageCodes) { - languageCodes.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'language_codes', - ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sort_order', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); } - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/institution/${this.configuration.encodeParam({ name: 'rawOaInstitutionId', value: rawOaInstitutionId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the classifications of a work based on its ID. - * @endpoint get /api/v2/works/classification/work/{raw_oa_work_id} - * @param rawOaWorkId The raw OpenAlex work id. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkClassificationByWorkId( - rawOaWorkId: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWorkClassificationByWorkId( - rawOaWorkId: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationByWorkId( - rawOaWorkId: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationByWorkId( - rawOaWorkId: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaWorkId === null || rawOaWorkId === undefined) { - throw new Error( - 'Required parameter rawOaWorkId was null or undefined when calling getWorkClassificationByWorkId.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/classification/work/${this.configuration.encodeParam({ name: 'rawOaWorkId', value: rawOaWorkId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the classifications of an author\'s works based on their ID. - * @endpoint get /api/v2/works/classification/author/{raw_oa_author_id} - * @param rawOaAuthorId The raw OpenAlex author id. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkClassificationsByAuthorId( - rawOaAuthorId: string, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWorkClassificationsByAuthorId( - rawOaAuthorId: string, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationsByAuthorId( - rawOaAuthorId: string, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationsByAuthorId( - rawOaAuthorId: string, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - if (rawOaAuthorId === null || rawOaAuthorId === undefined) { - throw new Error( - 'Required parameter rawOaAuthorId was null or undefined when calling getWorkClassificationsByAuthorId.', - ); - } - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/classification/author/${this.configuration.encodeParam({ name: 'rawOaAuthorId', value: rawOaAuthorId, in: 'path', style: 'simple', explode: false, dataType: 'string', dataFormat: undefined })}`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Returns the classifications of works based on their IDs. - * @endpoint get /api/v2/works/classification/works/search - * @param workIds A list of OpenAlex work IDs to retrieve classifications for. - * @param page The page number to retrieve. (0-based) - * @param size The number of classifications to retrieve per page. - * @param secureFgpAcc - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorkClassificationsByWorkIds( - workIds?: Array, - page?: number, - size?: number, - secureFgpAcc?: string, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWorkClassificationsByWorkIds( - workIds?: Array, - page?: number, - size?: number, - secureFgpAcc?: string, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationsByWorkIds( - workIds?: Array, - page?: number, - size?: number, - secureFgpAcc?: string, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorkClassificationsByWorkIds( - workIds?: Array, - page?: number, - size?: number, - secureFgpAcc?: string, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (workIds) { - workIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'work_ids', - ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - - let localVarHeaders = this.defaultHeaders; - - // authentication (HTTPBearer) required - localVarHeaders = this.configuration.addCredentialToHeaders( - 'HTTPBearer', - 'Authorization', - localVarHeaders, - 'Bearer ', - ); - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/classification/works/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } - - /** - * Search works by topics or raw keywords with filters. - * @endpoint get /api/v2/works/keyword/search - * @param topics List of topics to match. - * @param topicIds List of topic IDs to match. - * @param filterTopicIds Additional topic IDs to filter results by, independent of search mode. - * @param keywords Raw keywords to search in title/abstract. - * @param fuzzy Use topic resolution if True, otherwise use raw keywords. - * @param publicationYear A list of publication years to filter by. - * @param publicationType A list of publication types to filter by. - * @param institutionIds A list of institution IDs to filter by. - * @param authorIds A list of author IDs to filter by. - * @param language A list of language codes to filter by. - * @param title Title to search for in works. - * @param page The page number to retrieve. (0-based) - * @param size The number of works to retrieve per page. - * @param sortBy The field to sort by. - * @param sortOrder The order to sort by. - * @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body. - * @param reportProgress flag to report request and response progress. - */ - public getWorksByKeywords( - topics?: Array, - topicIds?: Array, - filterTopicIds?: Array, - keywords?: Array, - fuzzy?: boolean, - publicationYear?: Array, - publicationType?: Array, - institutionIds?: Array, - authorIds?: Array, - language?: Array, - title?: string, - page?: number, - size?: number, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'body', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable; - public getWorksByKeywords( - topics?: Array, - topicIds?: Array, - filterTopicIds?: Array, - keywords?: Array, - fuzzy?: boolean, - publicationYear?: Array, - publicationType?: Array, - institutionIds?: Array, - authorIds?: Array, - language?: Array, - title?: string, - page?: number, - size?: number, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'response', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorksByKeywords( - topics?: Array, - topicIds?: Array, - filterTopicIds?: Array, - keywords?: Array, - fuzzy?: boolean, - publicationYear?: Array, - publicationType?: Array, - institutionIds?: Array, - authorIds?: Array, - language?: Array, - title?: string, - page?: number, - size?: number, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe?: 'events', - reportProgress?: boolean, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable>; - public getWorksByKeywords( - topics?: Array, - topicIds?: Array, - filterTopicIds?: Array, - keywords?: Array, - fuzzy?: boolean, - publicationYear?: Array, - publicationType?: Array, - institutionIds?: Array, - authorIds?: Array, - language?: Array, - title?: string, - page?: number, - size?: number, - sortBy?: WorkSortBy, - sortOrder?: SortDirection, - observe: any = 'body', - reportProgress: boolean = false, - options?: { - httpHeaderAccept?: 'application/json'; - context?: HttpContext; - transferCache?: boolean; - }, - ): Observable { - let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); - if (topics) { - topics.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topics', - ); - }); - } - if (topicIds) { - topicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'topic_ids', - ); - }); - } - if (filterTopicIds) { - filterTopicIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'filter_topic_ids', - ); - }); - } - if (keywords) { - keywords.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'keywords', - ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - fuzzy, - 'fuzzy', - ); - if (publicationYear) { - publicationYear.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_year', - ); - }); - } - if (publicationType) { - publicationType.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'publication_type', - ); - }); - } - if (institutionIds) { - institutionIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'institution_ids', - ); - }); - } - if (authorIds) { - authorIds.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'author_ids', - ); - }); - } - if (language) { - language.forEach((element) => { - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - element, - 'language', - ); - }); - } - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - title, - 'title', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - page, - 'page', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - size, - 'size', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortBy, - 'sort_by', - ); - localVarQueryParameters = this.addToHttpParams( - localVarQueryParameters, - sortOrder, - 'sort_order', - ); - - let localVarHeaders = this.defaultHeaders; - - const localVarHttpHeaderAcceptSelected: string | undefined = - options?.httpHeaderAccept ?? - this.configuration.selectHeaderAccept(['application/json']); - if (localVarHttpHeaderAcceptSelected !== undefined) { - localVarHeaders = localVarHeaders.set( - 'Accept', - localVarHttpHeaderAcceptSelected, - ); - } - - const localVarHttpContext: HttpContext = - options?.context ?? new HttpContext(); - - const localVarTransferCache: boolean = options?.transferCache ?? true; - - let responseType_: 'text' | 'json' | 'blob' = 'json'; - if (localVarHttpHeaderAcceptSelected) { - if (localVarHttpHeaderAcceptSelected.startsWith('text')) { - responseType_ = 'text'; - } else if ( - this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected) - ) { - responseType_ = 'json'; - } else { - responseType_ = 'blob'; - } - } - - let localVarPath = `/api/v2/works/keyword/search`; - const { basePath, withCredentials } = this.configuration; - return this.httpClient.request( - 'get', - `${basePath}${localVarPath}`, - { - context: localVarHttpContext, - params: localVarQueryParameters, - responseType: responseType_, - ...(withCredentials ? { withCredentials } : {}), - headers: localVarHeaders, - observe: observe, - ...(localVarTransferCache !== undefined - ? { transferCache: localVarTransferCache } - : {}), - reportProgress: reportProgress, - }, - ); - } } diff --git a/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts new file mode 100644 index 00000000..716a0f11 --- /dev/null +++ b/webapp/src/app/api/model/dFGProjectFachgebieteInner.ts @@ -0,0 +1,25 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +/** + * DFGProjectFachgebieteInner + */ +export interface DFGProjectFachgebieteInner { + fach?: string | null; + fach_code?: string | null; + fachgebiet?: string | null; + fachgebiet_code?: string | null; + fachkollegium?: string | null; + fachkollegium_code?: string | null; + wissenschaftsbereich?: string | null; + wissenschaftsbereich_code?: string | null; +} + diff --git a/webapp/src/app/api/model/dfgInstitutionSummary.ts b/webapp/src/app/api/model/dfgInstitutionSummary.ts index 0565c758..e3da7abf 100644 --- a/webapp/src/app/api/model/dfgInstitutionSummary.ts +++ b/webapp/src/app/api/model/dfgInstitutionSummary.ts @@ -9,9 +9,17 @@ */ +/** + * A summary of a DFG institution. + */ export interface DfgInstitutionSummary { id: number; - name_de?: string | null; - name_en?: string | null; + institute_name_de?: string | null; + institute_name_en?: string | null; + root_id?: number | null; + root_name_de?: string | null; + root_name_en?: string | null; + address_country_de?: string | null; + address_country_en?: string | null; } diff --git a/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts new file mode 100644 index 00000000..0bb6e492 --- /dev/null +++ b/webapp/src/app/api/model/dfgInstitutionSummaryPage.ts @@ -0,0 +1,34 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DfgInstitutionSummary } from './dfgInstitutionSummary'; + + +/** + * A paginated response containing a list of institutions. + */ +export interface DfgInstitutionSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/dfgPersonSummary.ts b/webapp/src/app/api/model/dfgPersonSummary.ts index 57021a1d..ebd441ee 100644 --- a/webapp/src/app/api/model/dfgPersonSummary.ts +++ b/webapp/src/app/api/model/dfgPersonSummary.ts @@ -12,11 +12,11 @@ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; export interface DfgPersonSummary { person_id: number; - project_ref_id: number; + orcid_id?: string | null; + project_ref_id?: number | null; full_name?: string | null; role_label_en?: string | null; role_label_de?: string | null; - root_institution?: DfgInstitutionSummary | null; institution?: DfgInstitutionSummary | null; } diff --git a/webapp/src/app/api/model/dfgPersonSummaryPage.ts b/webapp/src/app/api/model/dfgPersonSummaryPage.ts new file mode 100644 index 00000000..c4b7d916 --- /dev/null +++ b/webapp/src/app/api/model/dfgPersonSummaryPage.ts @@ -0,0 +1,34 @@ +/** + * Innovation Search Engine API + * + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ +import { DfgPersonSummary } from './dfgPersonSummary'; + + +/** + * A paginated response containing a list of persons. + */ +export interface DfgPersonSummaryPage { + /** + * The elements of the page. + */ + elements?: Array; + /** + * The page number. (0-based) + */ + page?: number; + /** + * The page size in elements. + */ + size?: number; + /** + * The total number of elements. + */ + total?: number; +} + diff --git a/webapp/src/app/api/model/dfgProjectSummary.ts b/webapp/src/app/api/model/dfgProjectSummary.ts index 80392042..f3e80b4a 100644 --- a/webapp/src/app/api/model/dfgProjectSummary.ts +++ b/webapp/src/app/api/model/dfgProjectSummary.ts @@ -8,6 +8,7 @@ * Do not edit the class manually. */ import { DfgInstitutionSummary } from './dfgInstitutionSummary'; +import { DFGProjectFachgebieteInner } from './dFGProjectFachgebieteInner'; import { DfgPersonSummary } from './dfgPersonSummary'; @@ -21,10 +22,6 @@ export interface DfgProjectSummary { professional_classification?: string | null; funding_start?: string | null; funding_end?: string | null; - /** - * Root institutions associated with the project (e.g. universities or umbrella organizations). - */ - root_institutions?: Array; /** * Institutions associated with the project. */ @@ -37,5 +34,6 @@ export interface DfgProjectSummary { * The persons involved in the DFG project. */ persons?: Array; + subject_classifications?: Array | null; } -- 2.56.1