regenerated model
This commit is contained in:
@@ -33,7 +33,7 @@ class Institution(BaseModel):
|
||||
"""
|
||||
A university, research organization, or other affiliation
|
||||
""" # noqa: E501
|
||||
id: Optional[StrictStr] = Field(default=None, description="The OpenAlex ID for this institution.")
|
||||
id: Optional[StrictStr] = Field(default=None, description="The OpenAlex ID for this institution.", json_schema_extra={"examples": ["https://openalex.org/I27837315"]})
|
||||
ror: Optional[StrictStr] = Field(default=None, description="The ROR ID for this institution. This is the Canonical External ID for institutions.")
|
||||
display_name: Optional[StrictStr] = Field(default=None, description="The primary name of the institution.")
|
||||
country_code: Optional[StrictStr] = Field(default=None, description="ISO two-letter country code where this institution is located.")
|
||||
@@ -55,20 +55,13 @@ class Institution(BaseModel):
|
||||
updated_date: Optional[datetime] = 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"]
|
||||
|
||||
@field_validator('created_date', mode='before')
|
||||
@classmethod
|
||||
def normalize_created_date(cls, v: Any) -> Any:
|
||||
if isinstance(v, str) and len(v) > 10:
|
||||
return v[:10]
|
||||
return v
|
||||
|
||||
@field_validator('type')
|
||||
def type_validate_enum(cls, value):
|
||||
"""Validates the enum"""
|
||||
if value is None:
|
||||
return value
|
||||
|
||||
if value not in set(['education','funder', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other']):
|
||||
if value not in set(['education', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other']):
|
||||
raise ValueError("must be one of enum values ('education', 'healthcare', 'company', 'archive', 'nonprofit', 'government', 'facility', 'other')")
|
||||
return value
|
||||
|
||||
@@ -161,3 +154,5 @@ class Institution(BaseModel):
|
||||
"updated_date": obj.get("updated_date")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user