changed institutions to hold associated institution array
This commit is contained in:
@@ -29,12 +29,17 @@ async def get_institution_by_id(
|
||||
raw_oa_institution_id=institution_id,
|
||||
source=[
|
||||
"id",
|
||||
"ror",
|
||||
"display_name",
|
||||
"country_code",
|
||||
"type",
|
||||
"homepage_url",
|
||||
"display_name_alternatives",
|
||||
"works_count",
|
||||
"cited_by_count",
|
||||
"geo",
|
||||
"summary_stats",
|
||||
"associated_institutions",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ from pydantic_core import to_jsonable_python
|
||||
|
||||
from inse.models.openalex.author_counts_by_year_inner import AuthorCountsByYearInner
|
||||
from inse.models.openalex.author_summary_stats import AuthorSummaryStats
|
||||
from inse.models.openalex.dehydrated_institution import DehydratedInstitution
|
||||
from inse.models.openalex.institution_geo import InstitutionGeo
|
||||
from inse.models.openalex.institution_ids import InstitutionIds
|
||||
|
||||
@@ -51,9 +52,10 @@ class Institution(BaseModel):
|
||||
ids: InstitutionIds | None = None
|
||||
counts_by_year: list[AuthorCountsByYearInner] | None = Field(default=None, description="`works_count` and `cited_by_count` for each of the last ten years.")
|
||||
works_api_url: StrictStr | None = Field(default=None, description="A URL that will get you a list of all works affiliated with this institution.")
|
||||
associated_institutions: list[DehydratedInstitution] | None = Field(default=None, description="Associated institutions list.")
|
||||
created_date: date | None = Field(default=None, description="When this institution was added to OpenAlex (ISO 8601 date).")
|
||||
updated_date: datetime | None = Field(default=None, description="When this institution was last updated (ISO 8601 datetime).")
|
||||
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "created_date", "updated_date"]
|
||||
__properties: ClassVar[list[str]] = ["id", "ror", "display_name", "country_code", "type", "homepage_url", "image_url", "image_thumbnail_url", "display_name_acronyms", "display_name_alternatives", "works_count", "cited_by_count", "summary_stats", "geo", "lineage", "ids", "counts_by_year", "works_api_url", "associated_institutions", "created_date", "updated_date"]
|
||||
|
||||
@field_validator('type')
|
||||
def type_validate_enum(cls, value):
|
||||
@@ -151,6 +153,7 @@ class Institution(BaseModel):
|
||||
"ids": InstitutionIds.from_dict(obj["ids"]) if obj.get("ids") is not None else None,
|
||||
"counts_by_year": [AuthorCountsByYearInner.from_dict(_item) for _item in obj["counts_by_year"]] if obj.get("counts_by_year") is not None else None,
|
||||
"works_api_url": obj.get("works_api_url"),
|
||||
"associated_institutions": [DehydratedInstitution.from_dict(_item) for _item in obj["associated_institutions"]] if obj.get("associated_institutions") is not None else None,
|
||||
"created_date": obj.get("created_date"),
|
||||
"updated_date": obj.get("updated_date")
|
||||
})
|
||||
|
||||
@@ -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
|
||||
@@ -11,31 +11,31 @@ import { InstitutionIds } from './institutionIds';
|
||||
import { AuthorCountsByYearInner } from './authorCountsByYearInner';
|
||||
import { AuthorSummaryStats } from './authorSummaryStats';
|
||||
import { InstitutionGeo } from './institutionGeo';
|
||||
|
||||
import { DehydratedInstitution } from './dehydratedInstitution';
|
||||
|
||||
/**
|
||||
* A university, research organization, or other affiliation
|
||||
*/
|
||||
export interface Institution {
|
||||
id?: string | null;
|
||||
ror?: string | null;
|
||||
display_name?: string | null;
|
||||
country_code?: string | null;
|
||||
type?: string | null;
|
||||
homepage_url?: string | null;
|
||||
image_url?: string | null;
|
||||
image_thumbnail_url?: string | null;
|
||||
display_name_acronyms?: Array<string> | null;
|
||||
display_name_alternatives?: Array<string> | null;
|
||||
works_count?: number | null;
|
||||
cited_by_count?: number | null;
|
||||
summary_stats?: AuthorSummaryStats | null;
|
||||
geo?: InstitutionGeo | null;
|
||||
lineage?: Array<string> | null;
|
||||
ids?: InstitutionIds | null;
|
||||
counts_by_year?: Array<AuthorCountsByYearInner> | null;
|
||||
works_api_url?: string | null;
|
||||
created_date?: string | null;
|
||||
updated_date?: string | null;
|
||||
export interface Institution {
|
||||
id?: string | null;
|
||||
ror?: string | null;
|
||||
display_name?: string | null;
|
||||
country_code?: string | null;
|
||||
type?: string | null;
|
||||
homepage_url?: string | null;
|
||||
image_url?: string | null;
|
||||
image_thumbnail_url?: string | null;
|
||||
display_name_acronyms?: Array<string> | null;
|
||||
display_name_alternatives?: Array<string> | null;
|
||||
works_count?: number | null;
|
||||
cited_by_count?: number | null;
|
||||
summary_stats?: AuthorSummaryStats | null;
|
||||
geo?: InstitutionGeo | null;
|
||||
lineage?: Array<string> | null;
|
||||
ids?: InstitutionIds | null;
|
||||
counts_by_year?: Array<AuthorCountsByYearInner> | null;
|
||||
works_api_url?: string | null;
|
||||
associated_institutions?: Array<DehydratedInstitution> | null;
|
||||
created_date?: string | null;
|
||||
updated_date?: string | null;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user