diff --git a/pydantic_schemaorg/3DModel.py b/pydantic_schemaorg/3DModel.py index 377d0c5e..920a5895 100644 --- a/pydantic_schemaorg/3DModel.py +++ b/pydantic_schemaorg/3DModel.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MediaObject import MediaObject @@ -16,7 +16,7 @@ class _3DModel(MediaObject): """ type_: str = Field("3DModel", const=True, alias='@type') - isResizable: Optional[Union[List[StrictBool], StrictBool]] = Field( + isResizable: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether the 3DModel allows resizing. For example, room layout applications often do" "not allow 3DModel elements to be resized to reflect reality.", diff --git a/pydantic_schemaorg/APIReference.py b/pydantic_schemaorg/APIReference.py index f138d3f9..2c8c32e7 100644 --- a/pydantic_schemaorg/APIReference.py +++ b/pydantic_schemaorg/APIReference.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.TechArticle import TechArticle diff --git a/pydantic_schemaorg/Accommodation.py b/pydantic_schemaorg/Accommodation.py index c3fbf83d..978567ff 100644 --- a/pydantic_schemaorg/Accommodation.py +++ b/pydantic_schemaorg/Accommodation.py @@ -1,7 +1,10 @@ -from pydantic import StrictBool, Field, AnyUrl +from pydantic import AnyUrl, Field, StrictBool from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.LocationFeatureSpecification import LocationFeatureSpecification +from pydantic_schemaorg.FloorPlan import FloorPlan from pydantic_schemaorg.Place import Place @@ -16,12 +19,12 @@ class Accommodation(Place): """ type_: str = Field("Accommodation", const=True, alias='@type') - numberOfBedrooms: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + numberOfBedrooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]]" "or [[FloorPlan]].", ) - numberOfBathroomsTotal: Optional[Union[List[int], int]] = Field( + numberOfBathroomsTotal: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The total integer number of bathrooms in a some [[Accommodation]], following real estate" "conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field):" @@ -32,39 +35,39 @@ class Accommodation(Place): None, description="Indications regarding the permitted usage of the accommodation.", ) - numberOfPartialBathrooms: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfPartialBathrooms: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]." "This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field).", ) - yearBuilt: Optional[Union[List[Decimal], Decimal]] = Field( + yearBuilt: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The year an [[Accommodation]] was constructed. This corresponds to the [YearBuilt" "field in RESO](https://ddwiki.reso.org/display/DDW17/YearBuilt+Field).", ) - leaseLength: Any = Field( + leaseLength: Optional[Union[List[Union[Duration, QuantitativeValue, str]], Union[Duration, QuantitativeValue, str]]] = Field( None, description="Length of the lease for some [[Accommodation]], either particular to some [[Offer]]" "or in some cases intrinsic to the property.", ) - amenityFeature: Optional[Union[List[LocationFeatureSpecification], LocationFeatureSpecification]] = Field( + amenityFeature: Optional[Union[List[Union[LocationFeatureSpecification, str]], Union[LocationFeatureSpecification, str]]] = Field( None, description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic" "property does not make a statement about whether the feature is included in an offer for" "the main accommodation or available at extra costs.", ) - numberOfRooms: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - tourBookingPage: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + tourBookingPage: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]" "or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.", ) - petsAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( + petsAllowed: Optional[Union[List[Union[str, StrictBool]], Union[str, StrictBool]]] = Field( None, description="Indicates whether pets are allowed to enter the accommodation or lodging business." "More detailed information can be put in a text value.", @@ -82,16 +85,16 @@ class Accommodation(Place): "systems [vary internationally](https://en.wikipedia.org/wiki/Storey#Consecutive_number_floor_designations)," "the local system should be used where possible.", ) - floorSize: Any = Field( + floorSize: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s):" "MTK for square meter, FTK for square foot, or YDK for square yard", ) - accommodationFloorPlan: Any = Field( + accommodationFloorPlan: Optional[Union[List[Union[FloorPlan, str]], Union[FloorPlan, str]]] = Field( None, description="A floorplan of some [[Accommodation]].", ) - numberOfFullBathrooms: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfFullBathrooms: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]." "This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).", diff --git a/pydantic_schemaorg/Action.py b/pydantic_schemaorg/Action.py index c3517629..bc567f1d 100644 --- a/pydantic_schemaorg/Action.py +++ b/pydantic_schemaorg/Action.py @@ -1,8 +1,14 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.VirtualLocation import VirtualLocation +from pydantic_schemaorg.Place import Place from datetime import datetime, time +from pydantic_schemaorg.EntryPoint import EntryPoint +from pydantic_schemaorg.ActionStatusType import ActionStatusType class Action(Thing): @@ -16,31 +22,31 @@ class Action(Thing): """ type_: str = Field("Action", const=True, alias='@type') - result: Optional[Union[List[Thing], Thing]] = Field( + result: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The result produced in the action. e.g. John wrote *a book*.", ) - object: Optional[Union[List[Thing], Thing]] = Field( + object: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The object upon which the action is carried out, whose state is kept intact or changed." "Also known as the semantic roles patient, affected or undergoer (which change their" "state) or theme (which doesn't). e.g. John read *a book*.", ) - participant: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + participant: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Other co-agents that participated in the action indirectly. e.g. John wrote a book with" "*Steve*.", ) - error: Optional[Union[List[Thing], Thing]] = Field( + error: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="For failed actions, more information on the cause of the failure.", ) - location: Union[List[Union[str, Any]], Union[str, Any]] = Field( + location: Optional[Union[List[Union[str, PostalAddress, VirtualLocation, Place]], Union[str, PostalAddress, VirtualLocation, Place]]] = Field( None, description="The location of, for example, where an event is happening, where an organization is located," "or where an action takes place.", ) - endTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + endTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to end. For actions that span a period of time, when the action" @@ -49,24 +55,24 @@ class Action(Thing): "Event uses startDate/endDate instead of startTime/endTime, even when describing" "dates with times. This situation may be clarified in future revisions.", ) - agent: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + agent: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The direct performer or driver of the action (animate or inanimate). e.g. *John* wrote" "a book.", ) - target: Any = Field( + target: Optional[Union[List[Union[EntryPoint, str]], Union[EntryPoint, str]]] = Field( None, description="Indicates a target EntryPoint for an Action.", ) - actionStatus: Any = Field( + actionStatus: Optional[Union[List[Union[ActionStatusType, str]], Union[ActionStatusType, str]]] = Field( None, description="Indicates the current disposition of the Action.", ) - instrument: Optional[Union[List[Thing], Thing]] = Field( + instrument: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The object that helped the agent perform the action. e.g. John wrote a book with *a pen*.", ) - startTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + startTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to start. For actions that span a period of time, when the action" diff --git a/pydantic_schemaorg/ActionAccessSpecification.py b/pydantic_schemaorg/ActionAccessSpecification.py index 0bf07b58..4acd5e3f 100644 --- a/pydantic_schemaorg/ActionAccessSpecification.py +++ b/pydantic_schemaorg/ActionAccessSpecification.py @@ -1,9 +1,12 @@ -from pydantic import StrictBool, Field, AnyUrl -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic import AnyUrl, Field, StrictBool from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from typing import List, Optional, Union from datetime import datetime, time, date +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.MediaSubscription import MediaSubscription +from pydantic_schemaorg.Offer import Offer from pydantic_schemaorg.Intangible import Intangible @@ -14,36 +17,36 @@ class ActionAccessSpecification(Intangible): """ type_: str = Field("ActionAccessSpecification", const=True, alias='@type') - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", ) - availabilityStarts: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityStarts: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The beginning of the availability of the product or service included in the offer.", ) - eligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + eligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "valid. See also [[ineligibleRegion]].", ) - requiresSubscription: Union[List[Union[StrictBool, Any]], Union[StrictBool, Any]] = Field( + requiresSubscription: Optional[Union[List[Union[StrictBool, MediaSubscription, str]], Union[StrictBool, MediaSubscription, str]]] = Field( None, description="Indicates if use of the media require a subscription (either paid or free). Allowed values" "are ```true``` or ```false``` (note that an earlier version had 'yes', 'no').", ) - expectsAcceptanceOf: Any = Field( + expectsAcceptanceOf: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="An Offer which must be accepted before the user can perform the Action. For example, the" "user may need to buy a movie before being able to watch it.", ) - availabilityEnds: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityEnds: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The end of the availability of the product or service included in the offer.", ) - ineligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + ineligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" diff --git a/pydantic_schemaorg/AggregateOffer.py b/pydantic_schemaorg/AggregateOffer.py index 934e248f..33d26751 100644 --- a/pydantic_schemaorg/AggregateOffer.py +++ b/pydantic_schemaorg/AggregateOffer.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Demand import Demand from pydantic_schemaorg.Offer import Offer -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal @@ -16,7 +16,7 @@ class AggregateOffer(Offer): """ type_: str = Field("AggregateOffer", const=True, alias='@type') - offers: Optional[Union[List[Union[Demand, Offer]], Union[Demand, Offer]]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -39,7 +39,7 @@ class AggregateOffer(Offer): "similiar Unicode symbols. * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to" "indicate a decimal point. Avoid using these symbols as a readability separator.", ) - offerCount: Optional[Union[List[int], int]] = Field( + offerCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of offers for the product.", ) diff --git a/pydantic_schemaorg/AggregateRating.py b/pydantic_schemaorg/AggregateRating.py index e2ebd143..35bcaca4 100644 --- a/pydantic_schemaorg/AggregateRating.py +++ b/pydantic_schemaorg/AggregateRating.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.Rating import Rating @@ -11,15 +11,15 @@ class AggregateRating(Rating): """ type_: str = Field("AggregateRating", const=True, alias='@type') - reviewCount: Optional[Union[List[int], int]] = Field( + reviewCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The count of total number of reviews.", ) - ratingCount: Optional[Union[List[int], int]] = Field( + ratingCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The count of total number of ratings.", ) - itemReviewed: Optional[Union[List[Thing], Thing]] = Field( + itemReviewed: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The item that is being reviewed/rated.", ) diff --git a/pydantic_schemaorg/Airline.py b/pydantic_schemaorg/Airline.py index fe00d48a..13f108f1 100644 --- a/pydantic_schemaorg/Airline.py +++ b/pydantic_schemaorg/Airline.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.BoardingPolicyType import BoardingPolicyType +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization @@ -10,7 +11,7 @@ class Airline(Organization): """ type_: str = Field("Airline", const=True, alias='@type') - boardingPolicy: Any = Field( + boardingPolicy: Optional[Union[List[Union[BoardingPolicyType, str]], Union[BoardingPolicyType, str]]] = Field( None, description="The type of boarding policy used by the airline (e.g. zone-based or group-based).", ) diff --git a/pydantic_schemaorg/Airport.py b/pydantic_schemaorg/Airport.py index 597ebec2..f18bd945 100644 --- a/pydantic_schemaorg/Airport.py +++ b/pydantic_schemaorg/Airport.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CivicStructure import CivicStructure diff --git a/pydantic_schemaorg/AlignmentObject.py b/pydantic_schemaorg/AlignmentObject.py index 0e9e5d25..98c65dc4 100644 --- a/pydantic_schemaorg/AlignmentObject.py +++ b/pydantic_schemaorg/AlignmentObject.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Any, Union from pydantic_schemaorg.Intangible import Intangible @@ -18,7 +18,7 @@ class AlignmentObject(Intangible): description="A category of alignment between the learning resource and the framework node. Recommended" "values include: 'requires', 'textComplexity', 'readingLevel', and 'educationalSubject'.", ) - targetUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + targetUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The URL of a node in an established educational framework.", ) diff --git a/pydantic_schemaorg/AnatomicalStructure.py b/pydantic_schemaorg/AnatomicalStructure.py index 18d9d941..c171f6a5 100644 --- a/pydantic_schemaorg/AnatomicalStructure.py +++ b/pydantic_schemaorg/AnatomicalStructure.py @@ -1,5 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.ImageObject import ImageObject +from typing import List, Optional, Any, Union +from pydantic_schemaorg.MedicalCondition import MedicalCondition +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -11,20 +15,20 @@ class AnatomicalStructure(MedicalEntity): """ type_: str = Field("AnatomicalStructure", const=True, alias='@type') - diagram: Any = Field( + diagram: Optional[Union[List[Union[ImageObject, str]], Union[ImageObject, str]]] = Field( None, description="An image containing a diagram that illustrates the structure and/or its component substructures" "and/or connections with other structures.", ) - subStructure: Any = Field( + subStructure: Optional[Union[List[Union['AnatomicalStructure', str]], Union['AnatomicalStructure', str]]] = Field( None, description="Component (sub-)structure(s) that comprise this anatomical structure.", ) - connectedTo: Any = Field( + connectedTo: Optional[Union[List[Union['AnatomicalStructure', str]], Union['AnatomicalStructure', str]]] = Field( None, description="Other anatomical structures to which this structure is connected.", ) - relatedCondition: Any = Field( + relatedCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="A medical condition associated with this anatomy.", ) @@ -32,11 +36,11 @@ class AnatomicalStructure(MedicalEntity): None, description="Location in the body of the anatomical structure.", ) - relatedTherapy: Any = Field( + relatedTherapy: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A medical therapy related to this anatomy.", ) - partOfSystem: Any = Field( + partOfSystem: Optional[Union[List[Union[AnatomicalSystem, str]], Union[AnatomicalSystem, str]]] = Field( None, description="The anatomical or organ system that this structure is part of.", ) diff --git a/pydantic_schemaorg/AnatomicalSystem.py b/pydantic_schemaorg/AnatomicalSystem.py index 8554e45f..3b56adef 100644 --- a/pydantic_schemaorg/AnatomicalSystem.py +++ b/pydantic_schemaorg/AnatomicalSystem.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalCondition import MedicalCondition from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -17,22 +17,22 @@ class AnatomicalSystem(MedicalEntity): """ type_: str = Field("AnatomicalSystem", const=True, alias='@type') - comprisedOf: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + comprisedOf: Optional[Union[List[Union[AnatomicalStructure, 'AnatomicalSystem', str]], Union[AnatomicalStructure, 'AnatomicalSystem', str]]] = Field( None, description="Specifying something physically contained by something else. Typically used here" "for the underlying anatomical structures, such as organs, that comprise the anatomical" "system.", ) - relatedCondition: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + relatedCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="A medical condition associated with this anatomy.", ) - relatedStructure: Optional[Union[List[AnatomicalStructure], AnatomicalStructure]] = Field( + relatedStructure: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="Related anatomical structure(s) that are not part of the system but relate or connect" "to it, such as vascular bundles associated with an organ system.", ) - relatedTherapy: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + relatedTherapy: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A medical therapy related to this anatomy.", ) diff --git a/pydantic_schemaorg/Answer.py b/pydantic_schemaorg/Answer.py index ffd1c37e..163614cd 100644 --- a/pydantic_schemaorg/Answer.py +++ b/pydantic_schemaorg/Answer.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.WebContent import WebContent from pydantic_schemaorg.Comment import Comment -from typing import Any, Optional, Union, List +from pydantic_schemaorg.WebContent import WebContent +from typing import List, Optional, Union class Answer(Comment): @@ -11,7 +11,7 @@ class Answer(Comment): """ type_: str = Field("Answer", const=True, alias='@type') - answerExplanation: Optional[Union[List[Union[WebContent, Comment]], Union[WebContent, Comment]]] = Field( + answerExplanation: Optional[Union[List[Union[Comment, WebContent, str]], Union[Comment, WebContent, str]]] = Field( None, description="A step-by-step or full explanation about Answer. Can outline how this Answer was achieved" "or contain more broad clarification or statement about it.", diff --git a/pydantic_schemaorg/Apartment.py b/pydantic_schemaorg/Apartment.py index 0fb10fe0..aff43862 100644 --- a/pydantic_schemaorg/Apartment.py +++ b/pydantic_schemaorg/Apartment.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Accommodation import Accommodation @@ -13,13 +14,13 @@ class Apartment(Accommodation): """ type_: str = Field("Apartment", const=True, alias='@type') - numberOfRooms: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - occupancy: Any = Field( + occupancy: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The allowed total occupancy for the accommodation in persons (including infants etc)." "For individual accommodations, this is not necessarily the legal maximum but defines" diff --git a/pydantic_schemaorg/ApartmentComplex.py b/pydantic_schemaorg/ApartmentComplex.py index 1b497016..d2203dbd 100644 --- a/pydantic_schemaorg/ApartmentComplex.py +++ b/pydantic_schemaorg/ApartmentComplex.py @@ -1,7 +1,7 @@ -from pydantic import StrictBool, Field, AnyUrl -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic import AnyUrl, Field, StrictBool from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Residence import Residence @@ -12,28 +12,28 @@ class ApartmentComplex(Residence): """ type_: str = Field("ApartmentComplex", const=True, alias='@type') - numberOfBedrooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfBedrooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]]" "or [[FloorPlan]].", ) - tourBookingPage: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + tourBookingPage: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]" "or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.", ) - numberOfAccommodationUnits: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + numberOfAccommodationUnits: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicates the total (available plus unavailable) number of accommodation units in" "an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]]" "(within its specific [[ApartmentComplex]]). See also [[numberOfAvailableAccommodationUnits]].", ) - petsAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( + petsAllowed: Optional[Union[List[Union[str, StrictBool]], Union[str, StrictBool]]] = Field( None, description="Indicates whether pets are allowed to enter the accommodation or lodging business." "More detailed information can be put in a text value.", ) - numberOfAvailableAccommodationUnits: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + numberOfAvailableAccommodationUnits: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicates the number of available accommodation units in an [[ApartmentComplex]]," "or the number of accommodation units for a specific [[FloorPlan]] (within its specific" diff --git a/pydantic_schemaorg/ArchiveComponent.py b/pydantic_schemaorg/ArchiveComponent.py index d785c077..9c13bc2f 100644 --- a/pydantic_schemaorg/ArchiveComponent.py +++ b/pydantic_schemaorg/ArchiveComponent.py @@ -1,6 +1,8 @@ from pydantic import Field +from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ArchiveOrganization import ArchiveOrganization from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,11 +14,11 @@ class ArchiveComponent(CreativeWork): """ type_: str = Field("ArchiveComponent", const=True, alias='@type') - itemLocation: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + itemLocation: Optional[Union[List[Union[str, PostalAddress, Place]], Union[str, PostalAddress, Place]]] = Field( None, description="Current location of the item.", ) - holdingArchive: Any = Field( + holdingArchive: Optional[Union[List[Union[ArchiveOrganization, str]], Union[ArchiveOrganization, str]]] = Field( None, description="[[ArchiveOrganization]] that holds, keeps or maintains the [[ArchiveComponent]].", ) diff --git a/pydantic_schemaorg/ArchiveOrganization.py b/pydantic_schemaorg/ArchiveOrganization.py index 6245d8fa..cc0c034e 100644 --- a/pydantic_schemaorg/ArchiveOrganization.py +++ b/pydantic_schemaorg/ArchiveOrganization.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.ArchiveComponent import ArchiveComponent -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.LocalBusiness import LocalBusiness @@ -12,7 +12,7 @@ class ArchiveOrganization(LocalBusiness): """ type_: str = Field("ArchiveOrganization", const=True, alias='@type') - archiveHeld: Optional[Union[List[ArchiveComponent], ArchiveComponent]] = Field( + archiveHeld: Optional[Union[List[Union[ArchiveComponent, str]], Union[ArchiveComponent, str]]] = Field( None, description="Collection, [fonds](https://en.wikipedia.org/wiki/Fonds), or item held, kept" "or maintained by an [[ArchiveOrganization]].", diff --git a/pydantic_schemaorg/Artery.py b/pydantic_schemaorg/Artery.py index 340ef62f..54f007da 100644 --- a/pydantic_schemaorg/Artery.py +++ b/pydantic_schemaorg/Artery.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Vessel import Vessel @@ -11,11 +11,11 @@ class Artery(Vessel): """ type_: str = Field("Artery", const=True, alias='@type') - supplyTo: Optional[Union[List[AnatomicalStructure], AnatomicalStructure]] = Field( + supplyTo: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="The area to which the artery supplies blood.", ) - arterialBranch: Optional[Union[List[AnatomicalStructure], AnatomicalStructure]] = Field( + arterialBranch: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="The branches that comprise the arterial structure.", ) diff --git a/pydantic_schemaorg/Article.py b/pydantic_schemaorg/Article.py index 4f3daa30..c4d062d4 100644 --- a/pydantic_schemaorg/Article.py +++ b/pydantic_schemaorg/Article.py @@ -1,6 +1,7 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.SpeakableSpecification import SpeakableSpecification class Article(CreativeWork): @@ -24,7 +25,7 @@ class Article(CreativeWork): description="Articles may belong to one or more 'sections' in a magazine or newspaper, such as Sports," "Lifestyle, etc.", ) - speakable: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + speakable: Optional[Union[List[Union[AnyUrl, SpeakableSpecification, str]], Union[AnyUrl, SpeakableSpecification, str]]] = Field( None, description="Indicates sections of a Web page that are particularly 'speakable' in the sense of being" "highlighted as being especially appropriate for text-to-speech conversion. Other" @@ -41,7 +42,7 @@ class Article(CreativeWork): "to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]]" "which is defined to be a possible value of the *speakable* property.", ) - wordCount: Optional[Union[List[int], int]] = Field( + wordCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of words in the text of the Article.", ) diff --git a/pydantic_schemaorg/AskAction.py b/pydantic_schemaorg/AskAction.py index 872ecb76..841971f2 100644 --- a/pydantic_schemaorg/AskAction.py +++ b/pydantic_schemaorg/AskAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Question import Question -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CommunicateAction import CommunicateAction @@ -12,7 +12,7 @@ class AskAction(CommunicateAction): """ type_: str = Field("AskAction", const=True, alias='@type') - question: Optional[Union[List[Question], Question]] = Field( + question: Optional[Union[List[Union[Question, str]], Union[Question, str]]] = Field( None, description="A sub property of object. A question.", ) diff --git a/pydantic_schemaorg/Audience.py b/pydantic_schemaorg/Audience.py index b342236b..596cb560 100644 --- a/pydantic_schemaorg/Audience.py +++ b/pydantic_schemaorg/Audience.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from pydantic_schemaorg.Intangible import Intangible @@ -15,7 +16,7 @@ class Audience(Intangible): description="The target group associated with a given audience (e.g. veterans, car owners, musicians," "etc.).", ) - geographicArea: Any = Field( + geographicArea: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The geographic area associated with the audience.", ) diff --git a/pydantic_schemaorg/AudioObject.py b/pydantic_schemaorg/AudioObject.py index 30c625b3..f5385f20 100644 --- a/pydantic_schemaorg/AudioObject.py +++ b/pydantic_schemaorg/AudioObject.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MediaObject import MediaObject diff --git a/pydantic_schemaorg/Audiobook.py b/pydantic_schemaorg/Audiobook.py index b173eb74..367d114c 100644 --- a/pydantic_schemaorg/Audiobook.py +++ b/pydantic_schemaorg/Audiobook.py @@ -1,22 +1,23 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Duration import Duration +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.AudioObject import AudioObject from pydantic_schemaorg.Book import Book +from pydantic_schemaorg.AudioObject import AudioObject -class Audiobook(AudioObject, Book): +class Audiobook(Book, AudioObject): """An audiobook. See https://schema.org/Audiobook. """ type_: str = Field("Audiobook", const=True, alias='@type') - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - readBy: Optional[Union[List[Person], Person]] = Field( + readBy: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person who reads (performs) the audiobook.", ) diff --git a/pydantic_schemaorg/AuthorizeAction.py b/pydantic_schemaorg/AuthorizeAction.py index 0ef72d9f..eb123721 100644 --- a/pydantic_schemaorg/AuthorizeAction.py +++ b/pydantic_schemaorg/AuthorizeAction.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.ContactPoint import ContactPoint -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AllocateAction import AllocateAction @@ -14,7 +14,7 @@ class AuthorizeAction(AllocateAction): """ type_: str = Field("AuthorizeAction", const=True, alias='@type') - recipient: Optional[Union[List[Union[Organization, Audience, Person, ContactPoint]], Union[Organization, Audience, Person, ContactPoint]]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/BankAccount.py b/pydantic_schemaorg/BankAccount.py index 8c6c53f2..4a9f06e0 100644 --- a/pydantic_schemaorg/BankAccount.py +++ b/pydantic_schemaorg/BankAccount.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Union from pydantic_schemaorg.FinancialProduct import FinancialProduct @@ -11,7 +12,7 @@ class BankAccount(FinancialProduct): """ type_: str = Field("BankAccount", const=True, alias='@type') - accountMinimumInflow: Any = Field( + accountMinimumInflow: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="A minimum amount that has to be paid in every month.", ) @@ -19,7 +20,7 @@ class BankAccount(FinancialProduct): None, description="The type of a bank account.", ) - accountOverdraftLimit: Any = Field( + accountOverdraftLimit: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="An overdraft is an extension of credit from a lending institution when an account reaches" "zero. An overdraft allows the individual to continue withdrawing money even if the account" diff --git a/pydantic_schemaorg/BedDetails.py b/pydantic_schemaorg/BedDetails.py index 7205b082..ac38583b 100644 --- a/pydantic_schemaorg/BedDetails.py +++ b/pydantic_schemaorg/BedDetails.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.BedType import BedType from pydantic_schemaorg.Intangible import Intangible @@ -13,11 +14,11 @@ class BedDetails(Intangible): """ type_: str = Field("BedDetails", const=True, alias='@type') - numberOfBeds: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfBeds: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The quantity of the given bed type available in the HotelRoom, Suite, House, or Apartment.", ) - typeOfBed: Union[List[Union[str, Any]], Union[str, Any]] = Field( + typeOfBed: Optional[Union[List[Union[str, BedType]], Union[str, BedType]]] = Field( None, description="The type of bed to which the BedDetail refers, i.e. the type of bed available in the quantity" "indicated by quantity.", diff --git a/pydantic_schemaorg/BioChemEntity.py b/pydantic_schemaorg/BioChemEntity.py index f7c31047..b771dc81 100644 --- a/pydantic_schemaorg/BioChemEntity.py +++ b/pydantic_schemaorg/BioChemEntity.py @@ -1,7 +1,10 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTerm import DefinedTerm from pydantic_schemaorg.PropertyValue import PropertyValue +from pydantic_schemaorg.MedicalCondition import MedicalCondition +from pydantic_schemaorg.Taxon import Taxon +from pydantic_schemaorg.Gene import Gene from pydantic_schemaorg.Thing import Thing @@ -13,15 +16,15 @@ class BioChemEntity(Thing): """ type_: str = Field("BioChemEntity", const=True, alias='@type') - bioChemSimilarity: Any = Field( + bioChemSimilarity: Optional[Union[List[Union['BioChemEntity', str]], Union['BioChemEntity', str]]] = Field( None, description="A similar BioChemEntity, e.g., obtained by fingerprint similarity algorithms.", ) - isPartOfBioChemEntity: Any = Field( + isPartOfBioChemEntity: Optional[Union[List[Union['BioChemEntity', str]], Union['BioChemEntity', str]]] = Field( None, description="Indicates a BioChemEntity that is (in some sense) a part of this BioChemEntity.", ) - hasMolecularFunction: Optional[Union[List[Union[AnyUrl, DefinedTerm, PropertyValue]], Union[AnyUrl, DefinedTerm, PropertyValue]]] = Field( + hasMolecularFunction: Optional[Union[List[Union[AnyUrl, DefinedTerm, PropertyValue, str]], Union[AnyUrl, DefinedTerm, PropertyValue, str]]] = Field( None, description="Molecular function performed by this BioChemEntity; please use PropertyValue if you" "want to include any evidence.", @@ -31,38 +34,38 @@ class BioChemEntity(Thing): description="A common representation such as a protein sequence or chemical structure for this entity." "For images use schema.org/image.", ) - hasBioChemEntityPart: Any = Field( + hasBioChemEntityPart: Optional[Union[List[Union['BioChemEntity', str]], Union['BioChemEntity', str]]] = Field( None, description="Indicates a BioChemEntity that (in some sense) has this BioChemEntity as a part.", ) - associatedDisease: Union[List[Union[AnyUrl, PropertyValue, Any]], Union[AnyUrl, PropertyValue, Any]] = Field( + associatedDisease: Optional[Union[List[Union[AnyUrl, PropertyValue, MedicalCondition, str]], Union[AnyUrl, PropertyValue, MedicalCondition, str]]] = Field( None, description="Disease associated to this BioChemEntity. Such disease can be a MedicalCondition or" "a URL. If you want to add an evidence supporting the association, please use PropertyValue.", ) - taxonomicRange: Union[List[Union[AnyUrl, str, DefinedTerm, Any]], Union[AnyUrl, str, DefinedTerm, Any]] = Field( + taxonomicRange: Optional[Union[List[Union[AnyUrl, str, DefinedTerm, Taxon]], Union[AnyUrl, str, DefinedTerm, Taxon]]] = Field( None, description="The taxonomic grouping of the organism that expresses, encodes, or in someway related" "to the BioChemEntity.", ) - isInvolvedInBiologicalProcess: Optional[Union[List[Union[AnyUrl, DefinedTerm, PropertyValue]], Union[AnyUrl, DefinedTerm, PropertyValue]]] = Field( + isInvolvedInBiologicalProcess: Optional[Union[List[Union[AnyUrl, DefinedTerm, PropertyValue, str]], Union[AnyUrl, DefinedTerm, PropertyValue, str]]] = Field( None, description="Biological process this BioChemEntity is involved in; please use PropertyValue if" "you want to include any evidence.", ) - biologicalRole: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + biologicalRole: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="A role played by the BioChemEntity within a biological context.", ) - bioChemInteraction: Any = Field( + bioChemInteraction: Optional[Union[List[Union['BioChemEntity', str]], Union['BioChemEntity', str]]] = Field( None, description="A BioChemEntity that is known to interact with this item.", ) - isEncodedByBioChemEntity: Any = Field( + isEncodedByBioChemEntity: Optional[Union[List[Union[Gene, str]], Union[Gene, str]]] = Field( None, description="Another BioChemEntity encoding by this one.", ) - isLocatedInSubcellularLocation: Optional[Union[List[Union[AnyUrl, DefinedTerm, PropertyValue]], Union[AnyUrl, DefinedTerm, PropertyValue]]] = Field( + isLocatedInSubcellularLocation: Optional[Union[List[Union[AnyUrl, PropertyValue, DefinedTerm, str]], Union[AnyUrl, PropertyValue, DefinedTerm, str]]] = Field( None, description="Subcellular location where this BioChemEntity is located; please use PropertyValue" "if you want to include any evidence.", diff --git a/pydantic_schemaorg/Blog.py b/pydantic_schemaorg/Blog.py index 89ee1f63..e903fd1f 100644 --- a/pydantic_schemaorg/Blog.py +++ b/pydantic_schemaorg/Blog.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.BlogPosting import BlogPosting +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,13 +13,13 @@ class Blog(CreativeWork): """ type_: str = Field("Blog", const=True, alias='@type') - blogPosts: Any = Field( + blogPosts: Optional[Union[List[Union[BlogPosting, str]], Union[BlogPosting, str]]] = Field( None, description="Indicates a post that is part of a [[Blog]]. Note that historically, what we term a \"Blog\"" "was once known as a \"weblog\", and that what we term a \"BlogPosting\" is now often colloquially" "referred to as a \"blog\".", ) - blogPost: Any = Field( + blogPost: Optional[Union[List[Union[BlogPosting, str]], Union[BlogPosting, str]]] = Field( None, description="A posting that is part of this blog.", ) diff --git a/pydantic_schemaorg/BoatTrip.py b/pydantic_schemaorg/BoatTrip.py index 198c582f..10b53753 100644 --- a/pydantic_schemaorg/BoatTrip.py +++ b/pydantic_schemaorg/BoatTrip.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.BoatTerminal import BoatTerminal +from typing import List, Optional, Union from pydantic_schemaorg.Trip import Trip @@ -10,11 +11,11 @@ class BoatTrip(Trip): """ type_: str = Field("BoatTrip", const=True, alias='@type') - arrivalBoatTerminal: Any = Field( + arrivalBoatTerminal: Optional[Union[List[Union[BoatTerminal, str]], Union[BoatTerminal, str]]] = Field( None, description="The terminal or port from which the boat arrives.", ) - departureBoatTerminal: Any = Field( + departureBoatTerminal: Optional[Union[List[Union[BoatTerminal, str]], Union[BoatTerminal, str]]] = Field( None, description="The terminal or port from which the boat departs.", ) diff --git a/pydantic_schemaorg/Book.py b/pydantic_schemaorg/Book.py index 924ca150..b91c47c6 100644 --- a/pydantic_schemaorg/Book.py +++ b/pydantic_schemaorg/Book.py @@ -1,6 +1,6 @@ from pydantic import StrictBool, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.BookFormatType import BookFormatType from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,11 +12,11 @@ class Book(CreativeWork): """ type_: str = Field("Book", const=True, alias='@type') - illustrator: Optional[Union[List[Person], Person]] = Field( + illustrator: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The illustrator of the book.", ) - abridged: Optional[Union[List[StrictBool], StrictBool]] = Field( + abridged: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether the book is an abridged edition.", ) @@ -24,11 +24,11 @@ class Book(CreativeWork): None, description="The ISBN of the book.", ) - numberOfPages: Optional[Union[List[int], int]] = Field( + numberOfPages: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of pages in the book.", ) - bookFormat: Optional[Union[List[BookFormatType], BookFormatType]] = Field( + bookFormat: Optional[Union[List[Union[BookFormatType, str]], Union[BookFormatType, str]]] = Field( None, description="The format of the book.", ) diff --git a/pydantic_schemaorg/BorrowAction.py b/pydantic_schemaorg/BorrowAction.py index 18247abe..7cc88465 100644 --- a/pydantic_schemaorg/BorrowAction.py +++ b/pydantic_schemaorg/BorrowAction.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TransferAction import TransferAction @@ -13,7 +13,7 @@ class BorrowAction(TransferAction): """ type_: str = Field("BorrowAction", const=True, alias='@type') - lender: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + lender: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A sub property of participant. The person that lends the object being borrowed.", ) diff --git a/pydantic_schemaorg/Brand.py b/pydantic_schemaorg/Brand.py index 79107543..7e6ec3ce 100644 --- a/pydantic_schemaorg/Brand.py +++ b/pydantic_schemaorg/Brand.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.AggregateRating import AggregateRating +from typing import List, Optional, Union from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.Review import Review from pydantic_schemaorg.Intangible import Intangible @@ -13,7 +14,7 @@ class Brand(Intangible): """ type_: str = Field("Brand", const=True, alias='@type') - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) @@ -21,11 +22,11 @@ class Brand(Intangible): None, description="A slogan or motto associated with the item.", ) - logo: Optional[Union[List[Union[AnyUrl, ImageObject]], Union[AnyUrl, ImageObject]]] = Field( + logo: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An associated logo.", ) - review: Optional[Union[List[Review], Review]] = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) diff --git a/pydantic_schemaorg/BroadcastChannel.py b/pydantic_schemaorg/BroadcastChannel.py index d9c762fb..d858abd6 100644 --- a/pydantic_schemaorg/BroadcastChannel.py +++ b/pydantic_schemaorg/BroadcastChannel.py @@ -1,5 +1,8 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.BroadcastFrequencySpecification import BroadcastFrequencySpecification +from pydantic_schemaorg.BroadcastService import BroadcastService +from pydantic_schemaorg.CableOrSatelliteService import CableOrSatelliteService from pydantic_schemaorg.Intangible import Intangible @@ -15,7 +18,7 @@ class BroadcastChannel(Intangible): description="The unique address by which the BroadcastService can be identified in a provider lineup." "In US, this is typically a number.", ) - broadcastFrequency: Union[List[Union[str, Any]], Union[str, Any]] = Field( + broadcastFrequency: Optional[Union[List[Union[str, BroadcastFrequencySpecification]], Union[str, BroadcastFrequencySpecification]]] = Field( None, description="The frequency used for over-the-air broadcasts. Numeric values or simple ranges e.g." "87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels," @@ -25,7 +28,7 @@ class BroadcastChannel(Intangible): None, description="Genre of the creative work, broadcast channel or group.", ) - providesBroadcastService: Any = Field( + providesBroadcastService: Optional[Union[List[Union[BroadcastService, str]], Union[BroadcastService, str]]] = Field( None, description="The BroadcastService offered on this channel.", ) @@ -33,7 +36,7 @@ class BroadcastChannel(Intangible): None, description="The type of service required to have access to the channel (e.g. Standard or Premium).", ) - inBroadcastLineup: Any = Field( + inBroadcastLineup: Optional[Union[List[Union[CableOrSatelliteService, str]], Union[CableOrSatelliteService, str]]] = Field( None, description="The CableOrSatelliteService offering the channel.", ) diff --git a/pydantic_schemaorg/BroadcastEvent.py b/pydantic_schemaorg/BroadcastEvent.py index 99c3573f..1e34bae0 100644 --- a/pydantic_schemaorg/BroadcastEvent.py +++ b/pydantic_schemaorg/BroadcastEvent.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Event import Event from pydantic_schemaorg.PublicationEvent import PublicationEvent @@ -12,7 +12,7 @@ class BroadcastEvent(PublicationEvent): """ type_: str = Field("BroadcastEvent", const=True, alias='@type') - isLiveBroadcast: Optional[Union[List[StrictBool], StrictBool]] = Field( + isLiveBroadcast: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="True if the broadcast is of a live event.", ) @@ -24,7 +24,7 @@ class BroadcastEvent(PublicationEvent): None, description="The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).", ) - broadcastOfEvent: Optional[Union[List[Event], Event]] = Field( + broadcastOfEvent: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="The event being broadcast such as a sporting event or awards ceremony.", ) diff --git a/pydantic_schemaorg/BroadcastFrequencySpecification.py b/pydantic_schemaorg/BroadcastFrequencySpecification.py index 9cc62c70..bada24fe 100644 --- a/pydantic_schemaorg/BroadcastFrequencySpecification.py +++ b/pydantic_schemaorg/BroadcastFrequencySpecification.py @@ -1,8 +1,8 @@ from pydantic import Field from pydantic_schemaorg.QualitativeValue import QualitativeValue -from typing import Any, Optional, Union, List -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Any, Union from decimal import Decimal +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Intangible import Intangible @@ -17,7 +17,7 @@ class BroadcastFrequencySpecification(Intangible): None, description="The modulation (e.g. FM, AM, etc) used by a particular broadcast service.", ) - broadcastFrequencyValue: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + broadcastFrequencyValue: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The frequency in MHz for a particular broadcast.", ) diff --git a/pydantic_schemaorg/BroadcastService.py b/pydantic_schemaorg/BroadcastService.py index a87a48d8..4ae637be 100644 --- a/pydantic_schemaorg/BroadcastService.py +++ b/pydantic_schemaorg/BroadcastService.py @@ -1,9 +1,10 @@ from pydantic import Field from pydantic_schemaorg.BroadcastFrequencySpecification import BroadcastFrequencySpecification -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Place import Place from pydantic_schemaorg.BroadcastChannel import BroadcastChannel +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Service import Service @@ -20,7 +21,7 @@ class BroadcastService(Service): "87-99. In addition a shortcut idiom is supported for frequences of AM and FM radio channels," "e.g. \"87 FM\".", ) - broadcaster: Optional[Union[List[Organization], Organization]] = Field( + broadcaster: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The organization owning or operating the broadcast service.", ) @@ -28,7 +29,7 @@ class BroadcastService(Service): None, description="The type of screening or video broadcast used (e.g. IMAX, 3D, SD, HD, etc.).", ) - area: Optional[Union[List[Place], Place]] = Field( + area: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The area within which users can expect to reach the broadcast service.", ) @@ -41,21 +42,21 @@ class BroadcastService(Service): description="The timezone in [ISO 8601 format](http://en.wikipedia.org/wiki/ISO_8601) for which" "the service bases its broadcasts", ) - hasBroadcastChannel: Optional[Union[List[BroadcastChannel], BroadcastChannel]] = Field( + hasBroadcastChannel: Optional[Union[List[Union[BroadcastChannel, str]], Union[BroadcastChannel, str]]] = Field( None, description="A broadcast channel of a broadcast service.", ) - broadcastAffiliateOf: Optional[Union[List[Organization], Organization]] = Field( + broadcastAffiliateOf: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The media network(s) whose content is broadcast on this station.", ) - inLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + inLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="The language of the content or performance or used in an action. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" "[[availableLanguage]].", ) - parentService: Any = Field( + parentService: Optional[Union[List[Union['BroadcastService', str]], Union['BroadcastService', str]]] = Field( None, description="A broadcast service to which the broadcast service may belong to such as regional variations" "of a national channel.", diff --git a/pydantic_schemaorg/BusOrCoach.py b/pydantic_schemaorg/BusOrCoach.py index b74af5e2..84392674 100644 --- a/pydantic_schemaorg/BusOrCoach.py +++ b/pydantic_schemaorg/BusOrCoach.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Vehicle import Vehicle @@ -17,7 +17,7 @@ class BusOrCoach(Vehicle): description="The ACRISS Car Classification Code is a code used by many car rental companies, for classifying" "vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.", ) - roofLoad: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + roofLoad: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted total weight of cargo and installations (e.g. a roof rack) on top of the" "vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate" diff --git a/pydantic_schemaorg/BusTrip.py b/pydantic_schemaorg/BusTrip.py index e305550a..a57ba60e 100644 --- a/pydantic_schemaorg/BusTrip.py +++ b/pydantic_schemaorg/BusTrip.py @@ -1,6 +1,7 @@ from pydantic import Field +from pydantic_schemaorg.BusStop import BusStop from pydantic_schemaorg.BusStation import BusStation -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Trip import Trip @@ -11,11 +12,11 @@ class BusTrip(Trip): """ type_: str = Field("BusTrip", const=True, alias='@type') - departureBusStop: Union[List[Union[BusStation, Any]], Union[BusStation, Any]] = Field( + departureBusStop: Optional[Union[List[Union[BusStop, BusStation, str]], Union[BusStop, BusStation, str]]] = Field( None, description="The stop or station from which the bus departs.", ) - arrivalBusStop: Union[List[Union[BusStation, Any]], Union[BusStation, Any]] = Field( + arrivalBusStop: Optional[Union[List[Union[BusStop, BusStation, str]], Union[BusStop, BusStation, str]]] = Field( None, description="The stop or station from which the bus arrives.", ) diff --git a/pydantic_schemaorg/BusinessAudience.py b/pydantic_schemaorg/BusinessAudience.py index 2276d4ff..b92a0d1c 100644 --- a/pydantic_schemaorg/BusinessAudience.py +++ b/pydantic_schemaorg/BusinessAudience.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Audience import Audience @@ -11,15 +12,15 @@ class BusinessAudience(Audience): """ type_: str = Field("BusinessAudience", const=True, alias='@type') - yearsInOperation: Any = Field( + yearsInOperation: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The age of the business.", ) - numberOfEmployees: Any = Field( + numberOfEmployees: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The number of employees in an organization e.g. business.", ) - yearlyRevenue: Any = Field( + yearlyRevenue: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The size of the business in annual revenue.", ) diff --git a/pydantic_schemaorg/BuyAction.py b/pydantic_schemaorg/BuyAction.py index 4adce559..b56d774e 100644 --- a/pydantic_schemaorg/BuyAction.py +++ b/pydantic_schemaorg/BuyAction.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.WarrantyPromise import WarrantyPromise from pydantic_schemaorg.TradeAction import TradeAction @@ -14,16 +14,16 @@ class BuyAction(TradeAction): """ type_: str = Field("BuyAction", const=True, alias='@type') - vendor: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + vendor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="'vendor' is an earlier term for 'seller'.", ) - seller: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + seller: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity which offers (sells / leases / lends / loans) the services / goods. A seller may" "also be a provider.", ) - warrantyPromise: Optional[Union[List[WarrantyPromise], WarrantyPromise]] = Field( + warrantyPromise: Optional[Union[List[Union[WarrantyPromise, str]], Union[WarrantyPromise, str]]] = Field( None, description="The warranty promise(s) included in the offer.", ) diff --git a/pydantic_schemaorg/CDCPMDRecord.py b/pydantic_schemaorg/CDCPMDRecord.py index b0fcc20f..ae308ece 100644 --- a/pydantic_schemaorg/CDCPMDRecord.py +++ b/pydantic_schemaorg/CDCPMDRecord.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime, date from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,21 +15,21 @@ class CDCPMDRecord(StructuredValue): """ type_: str = Field("CDCPMDRecord", const=True, alias='@type') - cvdNumVentUse: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumVentUse: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numventuse - MECHANICAL VENTILATORS IN USE: Total number of ventilators in use.", ) - cvdNumTotBeds: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumTotBeds: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numtotbeds - ALL HOSPITAL BEDS: Total number of all Inpatient and outpatient beds, including" "all staffed,ICU, licensed, and overflow (surge) beds used for inpatients or outpatients.", ) - cvdNumC19Died: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19Died: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19died - DEATHS: Patients with suspected or confirmed COVID-19 who died in the hospital," "ED, or any overflow location.", ) - cvdNumC19HOPats: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19HOPats: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19hopats - HOSPITAL ONSET: Patients hospitalized in an NHSN inpatient care location" "with onset of suspected or confirmed COVID-19 14 or more days after hospitalization.", @@ -40,45 +40,45 @@ class CDCPMDRecord(StructuredValue): "to identify the facility. To provide other details, [[healthcareReportingData]]" "can be used on a [[Hospital]] entry.", ) - cvdNumC19OverflowPats: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19OverflowPats: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19overflowpats - ED/OVERFLOW: Patients with suspected or confirmed COVID-19" "who are in the ED or any overflow location awaiting an inpatient bed.", ) - cvdNumBeds: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumBeds: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numbeds - HOSPITAL INPATIENT BEDS: Inpatient beds, including all staffed, licensed," "and overflow (surge) beds used for inpatients.", ) - datePosted: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + datePosted: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Publication date of an online listing.", ) - cvdNumICUBedsOcc: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumICUBedsOcc: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numicubedsocc - ICU BED OCCUPANCY: Total number of staffed inpatient ICU beds that are" "occupied.", ) - cvdNumVent: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumVent: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numvent - MECHANICAL VENTILATORS: Total number of ventilators available.", ) - cvdNumC19HospPats: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19HospPats: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19hosppats - HOSPITALIZED: Patients currently hospitalized in an inpatient care" "location who have suspected or confirmed COVID-19.", ) - cvdNumICUBeds: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumICUBeds: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numicubeds - ICU BEDS: Total number of staffed inpatient intensive care unit (ICU) beds.", ) - cvdNumC19OFMechVentPats: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19OFMechVentPats: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19ofmechventpats - ED/OVERFLOW and VENTILATED: Patients with suspected or confirmed" "COVID-19 who are in the ED or any overflow location awaiting an inpatient bed and on a mechanical" "ventilator.", ) - cvdNumC19MechVentPats: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumC19MechVentPats: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numc19mechventpats - HOSPITALIZED and VENTILATED: Patients hospitalized in an NHSN" "inpatient care location who have suspected or confirmed COVID-19 and are on a mechanical" @@ -94,7 +94,7 @@ class CDCPMDRecord(StructuredValue): None, description="collectiondate - Date for which patient counts are reported.", ) - cvdNumBedsOcc: Optional[Union[List[Decimal], Decimal]] = Field( + cvdNumBedsOcc: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="numbedsocc - HOSPITAL INPATIENT BED OCCUPANCY: Total number of staffed inpatient beds" "that are occupied.", diff --git a/pydantic_schemaorg/Car.py b/pydantic_schemaorg/Car.py index 8e7ce533..2f763eab 100644 --- a/pydantic_schemaorg/Car.py +++ b/pydantic_schemaorg/Car.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Vehicle import Vehicle @@ -16,7 +16,7 @@ class Car(Vehicle): description="The ACRISS Car Classification Code is a code used by many car rental companies, for classifying" "vehicles. ACRISS stands for Association of Car Rental Industry Systems and Standards.", ) - roofLoad: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + roofLoad: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted total weight of cargo and installations (e.g. a roof rack) on top of the" "vehicle. Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: You can indicate" diff --git a/pydantic_schemaorg/CategoryCode.py b/pydantic_schemaorg/CategoryCode.py index 167b418e..83ed61e0 100644 --- a/pydantic_schemaorg/CategoryCode.py +++ b/pydantic_schemaorg/CategoryCode.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.CategoryCodeSet import CategoryCodeSet from pydantic_schemaorg.DefinedTerm import DefinedTerm @@ -14,7 +15,7 @@ class CategoryCode(DefinedTerm): None, description="A short textual code that uniquely identifies the value.", ) - inCodeSet: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + inCodeSet: Optional[Union[List[Union[AnyUrl, CategoryCodeSet, str]], Union[AnyUrl, CategoryCodeSet, str]]] = Field( None, description="A [[CategoryCodeSet]] that contains this category code.", ) diff --git a/pydantic_schemaorg/CategoryCodeSet.py b/pydantic_schemaorg/CategoryCodeSet.py index 1943510f..4492b460 100644 --- a/pydantic_schemaorg/CategoryCodeSet.py +++ b/pydantic_schemaorg/CategoryCodeSet.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.CategoryCode import CategoryCode -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTermSet import DefinedTermSet @@ -11,7 +11,7 @@ class CategoryCodeSet(DefinedTermSet): """ type_: str = Field("CategoryCodeSet", const=True, alias='@type') - hasCategoryCode: Optional[Union[List[CategoryCode], CategoryCode]] = Field( + hasCategoryCode: Optional[Union[List[Union[CategoryCode, str]], Union[CategoryCode, str]]] = Field( None, description="A Category code contained in this code set.", ) diff --git a/pydantic_schemaorg/Chapter.py b/pydantic_schemaorg/Chapter.py index fb7992ba..08132b91 100644 --- a/pydantic_schemaorg/Chapter.py +++ b/pydantic_schemaorg/Chapter.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/ChemicalSubstance.py b/pydantic_schemaorg/ChemicalSubstance.py index b729da71..2e423716 100644 --- a/pydantic_schemaorg/ChemicalSubstance.py +++ b/pydantic_schemaorg/ChemicalSubstance.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTerm import DefinedTerm from pydantic_schemaorg.BioChemEntity import BioChemEntity @@ -17,11 +17,11 @@ class ChemicalSubstance(BioChemEntity): description="The chemical composition describes the identity and relative ratio of the chemical" "elements that make up the substance.", ) - chemicalRole: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + chemicalRole: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="A role played by the BioChemEntity within a chemical context.", ) - potentialUse: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + potentialUse: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="Intended use of the BioChemEntity by humans.", ) diff --git a/pydantic_schemaorg/ChooseAction.py b/pydantic_schemaorg/ChooseAction.py index 9f5dcbd2..a141bc58 100644 --- a/pydantic_schemaorg/ChooseAction.py +++ b/pydantic_schemaorg/ChooseAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AssessAction import AssessAction diff --git a/pydantic_schemaorg/CivicStructure.py b/pydantic_schemaorg/CivicStructure.py index 564880f4..856a71a9 100644 --- a/pydantic_schemaorg/CivicStructure.py +++ b/pydantic_schemaorg/CivicStructure.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Place import Place diff --git a/pydantic_schemaorg/Claim.py b/pydantic_schemaorg/Claim.py index 4414f550..c5253ee6 100644 --- a/pydantic_schemaorg/Claim.py +++ b/pydantic_schemaorg/Claim.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person @@ -21,16 +21,16 @@ class Claim(CreativeWork): """ type_: str = Field("Claim", const=True, alias='@type') - firstAppearance: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + firstAppearance: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Indicates the first known occurence of a [[Claim]] in some [[CreativeWork]].", ) - claimInterpreter: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + claimInterpreter: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="For a [[Claim]] interpreted from [[MediaObject]] content sed to indicate a claim contained," "implied or refined from the content of a [[MediaObject]].", ) - appearance: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + appearance: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Indicates an occurence of a [[Claim]] in some [[CreativeWork]].", ) diff --git a/pydantic_schemaorg/ClaimReview.py b/pydantic_schemaorg/ClaimReview.py index 75009af4..30d566c7 100644 --- a/pydantic_schemaorg/ClaimReview.py +++ b/pydantic_schemaorg/ClaimReview.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Review import Review diff --git a/pydantic_schemaorg/Class.py b/pydantic_schemaorg/Class.py index 41051d47..c8df8470 100644 --- a/pydantic_schemaorg/Class.py +++ b/pydantic_schemaorg/Class.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Enumeration import Enumeration -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Property import Property +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -11,7 +12,7 @@ class Class(Intangible): """ type_: str = Field("Class", const=True, alias='@type') - supersededBy: Union[List[Union[Enumeration, Any]], Union[Enumeration, Any]] = Field( + supersededBy: Optional[Union[List[Union['Class', Enumeration, Property, str]], Union['Class', Enumeration, Property, str]]] = Field( None, description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.", ) diff --git a/pydantic_schemaorg/Clip.py b/pydantic_schemaorg/Clip.py index f7da31ff..ec2adf7c 100644 --- a/pydantic_schemaorg/Clip.py +++ b/pydantic_schemaorg/Clip.py @@ -1,8 +1,12 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person from decimal import Decimal +from pydantic_schemaorg.HyperTocEntry import HyperTocEntry from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries +from pydantic_schemaorg.Episode import Episode +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWork import CreativeWork @@ -13,21 +17,21 @@ class Clip(CreativeWork): """ type_: str = Field("Clip", const=True, alias='@type') - partOfSeason: Any = Field( + partOfSeason: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="The season to which this episode belongs.", ) - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - startOffset: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + startOffset: Optional[Union[List[Union[Decimal, HyperTocEntry, str]], Union[Decimal, HyperTocEntry, str]]] = Field( None, description="The start time of the clip expressed as the number of seconds from the beginning of the" "work.", @@ -36,29 +40,29 @@ class Clip(CreativeWork): None, description="Position of the clip within an ordered group of clips.", ) - partOfSeries: Optional[Union[List[CreativeWorkSeries], CreativeWorkSeries]] = Field( + partOfSeries: Optional[Union[List[Union[CreativeWorkSeries, str]], Union[CreativeWorkSeries, str]]] = Field( None, description="The series to which this episode or season belongs.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - partOfEpisode: Any = Field( + partOfEpisode: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="The episode to which this clip belongs.", ) - endOffset: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + endOffset: Optional[Union[List[Union[Decimal, HyperTocEntry, str]], Union[Decimal, HyperTocEntry, str]]] = Field( None, description="The end time of the clip expressed as the number of seconds from the beginning of the work.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/Collection.py b/pydantic_schemaorg/Collection.py index 3bc31728..49dc84a4 100644 --- a/pydantic_schemaorg/Collection.py +++ b/pydantic_schemaorg/Collection.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -10,7 +10,7 @@ class Collection(CreativeWork): """ type_: str = Field("Collection", const=True, alias='@type') - collectionSize: Optional[Union[List[int], int]] = Field( + collectionSize: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of items in the [[Collection]].", ) diff --git a/pydantic_schemaorg/ComicCoverArt.py b/pydantic_schemaorg/ComicCoverArt.py index 71cac265..84914d7b 100644 --- a/pydantic_schemaorg/ComicCoverArt.py +++ b/pydantic_schemaorg/ComicCoverArt.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.CoverArt import CoverArt from pydantic_schemaorg.ComicStory import ComicStory +from pydantic_schemaorg.CoverArt import CoverArt -class ComicCoverArt(CoverArt, ComicStory): +class ComicCoverArt(ComicStory, CoverArt): """The artwork on the cover of a comic. See https://schema.org/ComicCoverArt. diff --git a/pydantic_schemaorg/ComicIssue.py b/pydantic_schemaorg/ComicIssue.py index e4035b7c..2c31f8f7 100644 --- a/pydantic_schemaorg/ComicIssue.py +++ b/pydantic_schemaorg/ComicIssue.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PublicationIssue import PublicationIssue @@ -15,16 +15,16 @@ class ComicIssue(PublicationIssue): """ type_: str = Field("ComicIssue", const=True, alias='@type') - colorist: Optional[Union[List[Person], Person]] = Field( + colorist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds color to inked drawings.", ) - artist: Optional[Union[List[Person], Person]] = Field( + artist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The primary artist for a work in a medium other than pencils or digital line art--for example," "if the primary artwork is done in watercolors or digital paints.", ) - letterer: Optional[Union[List[Person], Person]] = Field( + letterer: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds lettering, including speech balloons and sound effects, to" "artwork.", @@ -34,11 +34,11 @@ class ComicIssue(PublicationIssue): description="A description of the variant cover for the issue, if the issue is a variant printing. For" "example, \"Bryan Hitch Variant Cover\" or \"2nd Printing Variant\".", ) - penciler: Optional[Union[List[Person], Person]] = Field( + penciler: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who draws the primary narrative artwork.", ) - inker: Optional[Union[List[Person], Person]] = Field( + inker: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who traces over the pencil drawings in ink after pencils are complete.", ) diff --git a/pydantic_schemaorg/ComicStory.py b/pydantic_schemaorg/ComicStory.py index 9923e163..c5f468a6 100644 --- a/pydantic_schemaorg/ComicStory.py +++ b/pydantic_schemaorg/ComicStory.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -13,25 +13,25 @@ class ComicStory(CreativeWork): """ type_: str = Field("ComicStory", const=True, alias='@type') - colorist: Optional[Union[List[Person], Person]] = Field( + colorist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds color to inked drawings.", ) - artist: Optional[Union[List[Person], Person]] = Field( + artist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The primary artist for a work in a medium other than pencils or digital line art--for example," "if the primary artwork is done in watercolors or digital paints.", ) - letterer: Optional[Union[List[Person], Person]] = Field( + letterer: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds lettering, including speech balloons and sound effects, to" "artwork.", ) - penciler: Optional[Union[List[Person], Person]] = Field( + penciler: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who draws the primary narrative artwork.", ) - inker: Optional[Union[List[Person], Person]] = Field( + inker: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who traces over the pencil drawings in ink after pencils are complete.", ) diff --git a/pydantic_schemaorg/Comment.py b/pydantic_schemaorg/Comment.py index 3da329f6..ca174b0d 100644 --- a/pydantic_schemaorg/Comment.py +++ b/pydantic_schemaorg/Comment.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -11,15 +11,15 @@ class Comment(CreativeWork): """ type_: str = Field("Comment", const=True, alias='@type') - downvoteCount: Optional[Union[List[int], int]] = Field( + downvoteCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of downvotes this question, answer or comment has received from the community.", ) - upvoteCount: Optional[Union[List[int], int]] = Field( + upvoteCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of upvotes this question, answer or comment has received from the community.", ) - parentItem: Any = Field( + parentItem: Optional[Union[List[Union['Comment', str]], Union['Comment', str]]] = Field( None, description="The parent of a question, answer or item in general.", ) diff --git a/pydantic_schemaorg/CommentAction.py b/pydantic_schemaorg/CommentAction.py index 76f0a4a6..2524355e 100644 --- a/pydantic_schemaorg/CommentAction.py +++ b/pydantic_schemaorg/CommentAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Comment import Comment -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CommunicateAction import CommunicateAction @@ -11,7 +11,7 @@ class CommentAction(CommunicateAction): """ type_: str = Field("CommentAction", const=True, alias='@type') - resultComment: Optional[Union[List[Comment], Comment]] = Field( + resultComment: Optional[Union[List[Union[Comment, str]], Union[Comment, str]]] = Field( None, description="A sub property of result. The Comment created or sent as a result of this action.", ) diff --git a/pydantic_schemaorg/CommunicateAction.py b/pydantic_schemaorg/CommunicateAction.py index feedcb88..5f7164da 100644 --- a/pydantic_schemaorg/CommunicateAction.py +++ b/pydantic_schemaorg/CommunicateAction.py @@ -1,8 +1,10 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Organization import Organization +from typing import List, Optional, Union +from pydantic_schemaorg.Language import Language +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.InteractAction import InteractAction @@ -15,19 +17,19 @@ class CommunicateAction(InteractAction): """ type_: str = Field("CommunicateAction", const=True, alias='@type') - about: Optional[Union[List[Thing], Thing]] = Field( + about: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The subject matter of the content.", ) - language: Any = Field( + language: Optional[Union[List[Union[Language, str]], Union[Language, str]]] = Field( None, description="A sub property of instrument. The language used on this action.", ) - recipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) - inLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + inLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="The language of the content or performance or used in an action. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" diff --git a/pydantic_schemaorg/CompoundPriceSpecification.py b/pydantic_schemaorg/CompoundPriceSpecification.py index b3e4aa56..75820f41 100644 --- a/pydantic_schemaorg/CompoundPriceSpecification.py +++ b/pydantic_schemaorg/CompoundPriceSpecification.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.PriceTypeEnumeration import PriceTypeEnumeration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.UnitPriceSpecification import UnitPriceSpecification from pydantic_schemaorg.PriceSpecification import PriceSpecification @@ -24,7 +24,7 @@ class CompoundPriceSpecification(PriceSpecification): "PriceTypeEnumeration or as a free form text string for price types that are not already" "predefined in PriceTypeEnumeration.", ) - priceComponent: Optional[Union[List[UnitPriceSpecification], UnitPriceSpecification]] = Field( + priceComponent: Optional[Union[List[Union[UnitPriceSpecification, str]], Union[UnitPriceSpecification, str]]] = Field( None, description="This property links to all [[UnitPriceSpecification]] nodes that apply in parallel" "for the [[CompoundPriceSpecification]] node.", diff --git a/pydantic_schemaorg/ConsumeAction.py b/pydantic_schemaorg/ConsumeAction.py index 307efb67..a1c9004f 100644 --- a/pydantic_schemaorg/ConsumeAction.py +++ b/pydantic_schemaorg/ConsumeAction.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.ActionAccessSpecification import ActionAccessSpecification +from typing import List, Optional, Union +from pydantic_schemaorg.Offer import Offer from pydantic_schemaorg.Action import Action @@ -10,12 +12,12 @@ class ConsumeAction(Action): """ type_: str = Field("ConsumeAction", const=True, alias='@type') - actionAccessibilityRequirement: Any = Field( + actionAccessibilityRequirement: Optional[Union[List[Union[ActionAccessSpecification, str]], Union[ActionAccessSpecification, str]]] = Field( None, description="A set of requirements that a must be fulfilled in order to perform an Action. If more than" "one value is specied, fulfilling one set of requirements will allow the Action to be performed.", ) - expectsAcceptanceOf: Any = Field( + expectsAcceptanceOf: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="An Offer which must be accepted before the user can perform the Action. For example, the" "user may need to buy a movie before being able to watch it.", diff --git a/pydantic_schemaorg/ContactPoint.py b/pydantic_schemaorg/ContactPoint.py index 8a2ca8c0..24f53ad1 100644 --- a/pydantic_schemaorg/ContactPoint.py +++ b/pydantic_schemaorg/ContactPoint.py @@ -1,7 +1,10 @@ from pydantic import Field from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.Language import Language +from pydantic_schemaorg.OpeningHoursSpecification import OpeningHoursSpecification from pydantic_schemaorg.ContactPointOption import ContactPointOption from pydantic_schemaorg.Product import Product from pydantic_schemaorg.StructuredValue import StructuredValue @@ -14,7 +17,7 @@ class ContactPoint(StructuredValue): """ type_: str = Field("ContactPoint", const=True, alias='@type') - areaServed: Union[List[Union[str, AdministrativeArea, Place, Any]], Union[str, AdministrativeArea, Place, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) @@ -24,13 +27,13 @@ class ContactPoint(StructuredValue): "For example, a sales contact point, a PR contact point and so on. This property is used" "to specify the kind of contact point.", ) - availableLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + availableLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="A language someone may use with or at the item, service or place. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" "[[inLanguage]]", ) - serviceArea: Union[List[Union[AdministrativeArea, Place, Any]], Union[AdministrativeArea, Place, Any]] = Field( + serviceArea: Optional[Union[List[Union[AdministrativeArea, GeoShape, Place, str]], Union[AdministrativeArea, GeoShape, Place, str]]] = Field( None, description="The geographic area where the service is provided.", ) @@ -38,7 +41,7 @@ class ContactPoint(StructuredValue): None, description="Email address.", ) - hoursAvailable: Any = Field( + hoursAvailable: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="The hours during which this service or contact is available.", ) @@ -46,7 +49,7 @@ class ContactPoint(StructuredValue): None, description="The telephone number.", ) - contactOption: Optional[Union[List[ContactPointOption], ContactPointOption]] = Field( + contactOption: Optional[Union[List[Union[ContactPointOption, str]], Union[ContactPointOption, str]]] = Field( None, description="An option available on this contact point (e.g. a toll-free number or support for hearing-impaired" "callers).", diff --git a/pydantic_schemaorg/CookAction.py b/pydantic_schemaorg/CookAction.py index 07dea712..23cc2b95 100644 --- a/pydantic_schemaorg/CookAction.py +++ b/pydantic_schemaorg/CookAction.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Recipe import Recipe +from typing import List, Optional, Union from pydantic_schemaorg.FoodEstablishment import FoodEstablishment from pydantic_schemaorg.Place import Place from pydantic_schemaorg.FoodEvent import FoodEvent @@ -13,15 +14,15 @@ class CookAction(CreateAction): """ type_: str = Field("CookAction", const=True, alias='@type') - recipe: Any = Field( + recipe: Optional[Union[List[Union[Recipe, str]], Union[Recipe, str]]] = Field( None, description="A sub property of instrument. The recipe/instructions used to perform the action.", ) - foodEstablishment: Optional[Union[List[Union[FoodEstablishment, Place]], Union[FoodEstablishment, Place]]] = Field( + foodEstablishment: Optional[Union[List[Union[FoodEstablishment, Place, str]], Union[FoodEstablishment, Place, str]]] = Field( None, description="A sub property of location. The specific food establishment where the action occurred.", ) - foodEvent: Optional[Union[List[FoodEvent], FoodEvent]] = Field( + foodEvent: Optional[Union[List[Union[FoodEvent, str]], Union[FoodEvent, str]]] = Field( None, description="A sub property of location. The specific food event where the action occurred.", ) diff --git a/pydantic_schemaorg/Corporation.py b/pydantic_schemaorg/Corporation.py index 596ba9bf..d4f3a0d6 100644 --- a/pydantic_schemaorg/Corporation.py +++ b/pydantic_schemaorg/Corporation.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization diff --git a/pydantic_schemaorg/Course.py b/pydantic_schemaorg/Course.py index e408ba7c..ee8c385c 100644 --- a/pydantic_schemaorg/Course.py +++ b/pydantic_schemaorg/Course.py @@ -1,13 +1,14 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.StructuredValue import StructuredValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential +from pydantic_schemaorg.CourseInstance import CourseInstance from pydantic_schemaorg.AlignmentObject import AlignmentObject -from pydantic_schemaorg.CreativeWork import CreativeWork from pydantic_schemaorg.LearningResource import LearningResource +from pydantic_schemaorg.CreativeWork import CreativeWork -class Course(CreativeWork, LearningResource): +class Course(LearningResource, CreativeWork): """A description of an educational course which may be offered as distinct instances at" "which take place at different times or take place at different locations, or be offered" "through different media or modes of study. An educational course is a sequence of one" @@ -18,7 +19,7 @@ class Course(CreativeWork, LearningResource): """ type_: str = Field("Course", const=True, alias='@type') - numberOfCredits: Optional[Union[List[Union[int, StructuredValue]], Union[int, StructuredValue]]] = Field( + numberOfCredits: Optional[Union[List[Union[int, StructuredValue, str]], Union[int, StructuredValue, str]]] = Field( None, description="The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.", ) @@ -31,12 +32,12 @@ class Course(CreativeWork, LearningResource): None, description="The identifier for the [[Course]] used by the course [[provider]] (e.g. CS101 or 6.001).", ) - hasCourseInstance: Any = Field( + hasCourseInstance: Optional[Union[List[Union[CourseInstance, str]], Union[CourseInstance, str]]] = Field( None, description="An offering of the course at a specific time and place or through specific media or mode" "of study or to a specific section of students.", ) - coursePrerequisites: Union[List[Union[str, AlignmentObject, Any]], Union[str, AlignmentObject, Any]] = Field( + coursePrerequisites: Optional[Union[List[Union[str, AlignmentObject, 'Course']], Union[str, AlignmentObject, 'Course']]] = Field( None, description="Requirements for taking the Course. May be completion of another [[Course]] or a textual" "description like \"permission of instructor\". Requirements may be a pre-requisite" diff --git a/pydantic_schemaorg/CourseInstance.py b/pydantic_schemaorg/CourseInstance.py index c6135bda..c3df4e68 100644 --- a/pydantic_schemaorg/CourseInstance.py +++ b/pydantic_schemaorg/CourseInstance.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Event import Event @@ -19,7 +19,7 @@ class CourseInstance(Event): "per week or per month, and may be broken down by type. For example, \"2 hours of lectures," "1 hour of lab work and 3 hours of independent study per week\".", ) - instructor: Optional[Union[List[Person], Person]] = Field( + instructor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person assigned to instruct or provide instructional assistance for the [[CourseInstance]].", ) diff --git a/pydantic_schemaorg/CreativeWork.py b/pydantic_schemaorg/CreativeWork.py index 894e8e45..78d1ac33 100644 --- a/pydantic_schemaorg/CreativeWork.py +++ b/pydantic_schemaorg/CreativeWork.py @@ -1,9 +1,38 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field, StrictBool +from pydantic_schemaorg.DefinedTerm import DefinedTerm +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.Demand import Demand +from pydantic_schemaorg.Offer import Offer +from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from datetime import datetime, date from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.AggregateRating import AggregateRating +from pydantic_schemaorg.ItemList import ItemList +from pydantic_schemaorg.AlignmentObject import AlignmentObject +from pydantic_schemaorg.Comment import Comment +from pydantic_schemaorg.MusicRecording import MusicRecording +from pydantic_schemaorg.AudioObject import AudioObject +from pydantic_schemaorg.Clip import Clip +from pydantic_schemaorg.VideoObject import VideoObject +from pydantic_schemaorg.Country import Country +from pydantic_schemaorg.InteractionCounter import InteractionCounter +from pydantic_schemaorg.PublicationEvent import PublicationEvent +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.SizeSpecification import SizeSpecification from decimal import Decimal +from pydantic_schemaorg.MediaObject import MediaObject +from pydantic_schemaorg.Rating import Rating +from pydantic_schemaorg.CorrectionComment import CorrectionComment +from pydantic_schemaorg.Duration import Duration +from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Language import Language +from pydantic_schemaorg.Review import Review +from pydantic_schemaorg.Claim import Claim +from pydantic_schemaorg.WebPage import WebPage class CreativeWork(Thing): @@ -14,7 +43,7 @@ class CreativeWork(Thing): """ type_: str = Field("CreativeWork", const=True, alias='@type') - pattern: Union[List[Union[str, Any]], Union[str, Any]] = Field( + pattern: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="A pattern that something has, for example 'polka dot', 'striped', 'Canadian flag'." "Values are typically expressed as text, although links to controlled value schemes" @@ -25,7 +54,7 @@ class CreativeWork(Thing): description="Text that can be used to credit person(s) and/or organization(s) associated with a published" "Creative Work.", ) - about: Optional[Union[List[Thing], Thing]] = Field( + about: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The subject matter of the content.", ) @@ -33,11 +62,11 @@ class CreativeWork(Thing): None, description="The textual content of this CreativeWork.", ) - character: Any = Field( + character: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Fictional person connected with a creative work.", ) - offers: Any = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -46,32 +75,32 @@ class CreativeWork(Thing): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - locationCreated: Any = Field( + locationCreated: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The location where the CreativeWork was created, which may not be the same as the location" "depicted in the CreativeWork.", ) - isBasedOnUrl: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + isBasedOnUrl: Optional[Union[List[Union[AnyUrl, Product, 'CreativeWork', str]], Union[AnyUrl, Product, 'CreativeWork', str]]] = Field( None, description="A resource that was used in the creation of this resource. This term can be repeated for" "multiple sources. For example, http://example.com/great-multiplication-intro.html.", ) - isPartOf: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + isPartOf: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="Indicates an item or CreativeWork that this item, or CreativeWork (in some sense), is" "part of.", ) - materialExtent: Union[List[Union[str, Any]], Union[str, Any]] = Field( + materialExtent: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="The quantity of the materials being described or an expression of the physical space" "they occupy.", ) - contentReferenceTime: Optional[Union[List[datetime], datetime]] = Field( + contentReferenceTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The specific time described by a creative work, for works (e.g. articles, video objects" "etc.) that emphasise a particular moment within an Event.", ) - maintainer: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + maintainer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A maintainer of a [[Dataset]], software package ([[SoftwareApplication]]), or other" "[[Project]]. A maintainer is a [[Person]] or [[Organization]] that manages contributions" @@ -88,18 +117,18 @@ class CreativeWork(Thing): None, description="The typical expected age range, e.g. '7-9', '11-'.", ) - author: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + author: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The author of this content or rating. Please note that author is special in that HTML 5" "provides a special mechanism for indicating authorship via the rel tag. That is equivalent" "to this and may be used interchangeably.", ) - funder: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + funder: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports (sponsors) something through some kind of financial" "contribution.", ) - expires: Optional[Union[List[date], date]] = Field( + expires: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date the content expires and is no longer useful or available. For example a [[VideoObject]]" "or [[NewsArticle]] whose availability or relevance is time-limited, or a [[ClaimReview]]" @@ -110,13 +139,13 @@ class CreativeWork(Thing): None, description="Genre of the creative work, broadcast channel or group.", ) - workTranslation: Any = Field( + workTranslation: Optional[Union[List[Union['CreativeWork', str]], Union['CreativeWork', str]]] = Field( None, description="A work that is a translation of the content of this work. e.g. 西遊記 has an English workTranslation" "“Journey to the West”,a German workTranslation “Monkeys Pilgerfahrt” and a Vietnamese" "translation Tây du ký bình khảo.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) @@ -139,7 +168,7 @@ class CreativeWork(Thing): "\"2015-11/..\" indicates a range beginning in November 2015 and with no specified final" "date. This is tentative and might be updated in future when ISO 8601 is officially updated.", ) - hasPart: Any = Field( + hasPart: Optional[Union[List[Union['CreativeWork', str]], Union['CreativeWork', str]]] = Field( None, description="Indicates an item or CreativeWork that is part of this item, or CreativeWork (in some" "sense).", @@ -151,7 +180,7 @@ class CreativeWork(Thing): "are present but long descriptions will be needed for non-visual users\" or \"short descriptions" "are present and no long descriptions are needed.\"", ) - accessModeSufficient: Any = Field( + accessModeSufficient: Optional[Union[List[Union[ItemList, str]], Union[ItemList, str]]] = Field( None, description="A list of single or combined accessModes that are sufficient to understand all the intellectual" "content of a resource. Expected values include: auditory, tactile, textual, visual.", @@ -160,13 +189,13 @@ class CreativeWork(Thing): None, description="Headline of the article.", ) - educationalAlignment: Any = Field( + educationalAlignment: Optional[Union[List[Union[AlignmentObject, str]], Union[AlignmentObject, str]]] = Field( None, description="An alignment to an established educational framework. This property should not be used" "where the nature of the alignment can be described using a simple property, for example" "to express that a resource [[teaches]] or [[assesses]] a competency.", ) - publishingPrinciples: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + publishingPrinciples: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing" "the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing" @@ -176,23 +205,23 @@ class CreativeWork(Thing): "such policies are most typically expressed in natural language, sometimes related" "information (e.g. indicating a [[funder]]) can be expressed using schema.org terminology.", ) - comment: Any = Field( + comment: Optional[Union[List[Union[Comment, str]], Union[Comment, str]]] = Field( None, description="Comments, typically from users.", ) - audio: Any = Field( + audio: Optional[Union[List[Union[MusicRecording, AudioObject, Clip, str]], Union[MusicRecording, AudioObject, Clip, str]]] = Field( None, description="An embedded audio object.", ) - video: Any = Field( + video: Optional[Union[List[Union[VideoObject, Clip, str]], Union[VideoObject, Clip, str]]] = Field( None, description="An embedded video object.", ) - sourceOrganization: Optional[Union[List[Organization], Organization]] = Field( + sourceOrganization: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The Organization on whose behalf the creator was working.", ) - translator: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + translator: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Organization or person who adapts a creative work to different languages, regional" "differences and technical requirements of a target market, or that translates during" @@ -202,12 +231,12 @@ class CreativeWork(Thing): None, description="The position of an item in a series or sequence of items.", ) - translationOfWork: Any = Field( + translationOfWork: Optional[Union[List[Union['CreativeWork', str]], Union['CreativeWork', str]]] = Field( None, description="The work that this work has been translated from. e.g. 物种起源 is a translationOf “On the" "Origin of Species”", ) - isBasedOn: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + isBasedOn: Optional[Union[List[Union[AnyUrl, Product, 'CreativeWork', str]], Union[AnyUrl, Product, 'CreativeWork', str]]] = Field( None, description="A resource from which this work is derived or from which it is a modification or adaption.", ) @@ -220,7 +249,7 @@ class CreativeWork(Thing): "e.g. ```http://dublincore.org/specifications/dublin-core/dces/1999-07-02/```" "but this has not been carefully explored in the community.", ) - countryOfOrigin: Any = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -240,7 +269,7 @@ class CreativeWork(Thing): "their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general" "description), or alongside [[editEIDR]] for a more edit-specific description.", ) - sdPublisher: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + sdPublisher: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Indicates the party responsible for generating and publishing the current structured" "data markup, typically in cases where the structured data is derived automatically" @@ -249,11 +278,11 @@ class CreativeWork(Thing): "structured metadata. The [[sdPublisher]] property helps make such practices more" "explicit.", ) - license: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + license: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="A license document that applies to this content, typically indicated by URL.", ) - interactionStatistic: Any = Field( + interactionStatistic: Optional[Union[List[Union[InteractionCounter, str]], Union[InteractionCounter, str]]] = Field( None, description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication." "The most specific child type of InteractionCounter should be used.", @@ -263,7 +292,7 @@ class CreativeWork(Thing): description="Content features of the resource, such as accessible media, alternatives and supported" "enhancements for accessibility ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)).", ) - mentions: Optional[Union[List[Thing], Thing]] = Field( + mentions: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="Indicates that the CreativeWork contains a reference to, but is not necessarily about" "a concept.", @@ -274,7 +303,7 @@ class CreativeWork(Thing): "[[temporalCoverage]], [[dateCreated]], [[dateModified]], [[datePublished]])" "are not known to be appropriate.", ) - usageInfo: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + usageInfo: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="The schema.org [[usageInfo]] property indicates further information about a [[CreativeWork]]." "This property is applicable both to works that are freely available and to those that" @@ -287,17 +316,17 @@ class CreativeWork(Thing): "e.g. acquiring commercial usage rights for an image that is also available under non-commercial" "creative commons licenses.", ) - creativeWorkStatus: Union[List[Union[str, Any]], Union[str, Any]] = Field( + creativeWorkStatus: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The status of a creative work in terms of its stage in a lifecycle. Example terms include" "Incomplete, Draft, Published, Obsolete. Some organizations define a set of terms for" "the stages of their publication lifecycle.", ) - publisher: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + publisher: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The publisher of the creative work.", ) - releasedEvent: Any = Field( + releasedEvent: Optional[Union[List[Union[PublicationEvent, str]], Union[PublicationEvent, str]]] = Field( None, description="The place and time the release was issued, expressed as a PublicationEvent.", ) @@ -305,11 +334,11 @@ class CreativeWork(Thing): None, description="A secondary title of the CreativeWork.", ) - sdLicense: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + sdLicense: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="A license document that applies to this structured data, typically indicated by URL.", ) - accountablePerson: Any = Field( + accountablePerson: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Specifies the Person that is legally accountable for the CreativeWork.", ) @@ -318,16 +347,16 @@ class CreativeWork(Thing): description="Text of a notice appropriate for describing the copyright aspects of this Creative Work," "ideally indicating the owner of the copyright for the Work.", ) - teaches: Union[List[Union[str, Any]], Union[str, Any]] = Field( + teaches: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The item being described is intended to help a person learn the competency or learning" "outcome defined by the referenced term.", ) - exampleOfWork: Any = Field( + exampleOfWork: Optional[Union[List[Union['CreativeWork', str]], Union['CreativeWork', str]]] = Field( None, description="A creative work that this work is an example/instance/realization/derivation of.", ) - recordedAt: Any = Field( + recordedAt: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="The Event where the CreativeWork was recorded. The CreativeWork may capture all or part" "of the event.", @@ -340,12 +369,12 @@ class CreativeWork(Thing): "expressed only in natural language. For example \"Available by appointment from the" "Reading Room\" or \"Accessible only from logged-in accounts \".", ) - workExample: Any = Field( + workExample: Optional[Union[List[Union['CreativeWork', str]], Union['CreativeWork', str]]] = Field( None, description="Example/instance/realization/derivation of the concept of this creative work. eg." "The paperback edition, first edition, or eBook.", ) - size: Union[List[Union[str, Any]], Union[str, Any]] = Field( + size: Optional[Union[List[Union[str, SizeSpecification, DefinedTerm, QuantitativeValue]], Union[str, SizeSpecification, DefinedTerm, QuantitativeValue]]] = Field( None, description="A standardized size of a product or creative work, specified either through a simple" "textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode," @@ -357,15 +386,15 @@ class CreativeWork(Thing): description="A characteristic of the described resource that is physiologically dangerous to some" "users. Related to WCAG 2.0 guideline 2.3 ([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)).", ) - copyrightYear: Optional[Union[List[Decimal], Decimal]] = Field( + copyrightYear: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The year during which the claimed copyright for the CreativeWork was first asserted.", ) - encodings: Any = Field( + encodings: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="A media object that encodes this CreativeWork.", ) - creator: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + creator: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The creator/author of this CreativeWork. This is the same as the Author property for" "CreativeWork.", @@ -381,16 +410,16 @@ class CreativeWork(Thing): None, description="An abstract is a short description that summarizes a [[CreativeWork]].", ) - thumbnailUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + thumbnailUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A thumbnail image relevant to the Thing.", ) - acquireLicensePage: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + acquireLicensePage: Optional[Union[List[Union[AnyUrl, 'CreativeWork', str]], Union[AnyUrl, 'CreativeWork', str]]] = Field( None, description="Indicates a page documenting how licenses can be purchased or otherwise acquired, for" "the current item.", ) - contentRating: Union[List[Union[str, Any]], Union[str, Any]] = Field( + contentRating: Optional[Union[List[Union[str, Rating]], Union[str, Rating]]] = Field( None, description="Official rating of a piece of content—for example,'MPAA PG-13'.", ) @@ -398,68 +427,68 @@ class CreativeWork(Thing): None, description="Awards won by or for this item.", ) - isFamilyFriendly: Optional[Union[List[StrictBool], StrictBool]] = Field( + isFamilyFriendly: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether this content is family friendly.", ) - editor: Any = Field( + editor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Specifies the Person who edited the CreativeWork.", ) - datePublished: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + datePublished: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Date of first broadcast/publication.", ) - educationalLevel: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + educationalLevel: Optional[Union[List[Union[AnyUrl, str, DefinedTerm]], Union[AnyUrl, str, DefinedTerm]]] = Field( None, description="The level in terms of progression through an educational or training context. Examples" "of educational levels include 'beginner', 'intermediate' or 'advanced', and formal" "sets of level indicators.", ) - assesses: Union[List[Union[str, Any]], Union[str, Any]] = Field( + assesses: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The item being described is intended to assess the competency or learning outcome defined" "by the referenced term.", ) - mainEntity: Optional[Union[List[Thing], Thing]] = Field( + mainEntity: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="Indicates the primary entity described in some page or other CreativeWork.", ) - correction: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + correction: Optional[Union[List[Union[AnyUrl, str, CorrectionComment]], Union[AnyUrl, str, CorrectionComment]]] = Field( None, description="Indicates a correction to a [[CreativeWork]], either via a [[CorrectionComment]]," "textually or in another document.", ) - timeRequired: Any = Field( + timeRequired: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="Approximate or typical time it takes to work with or through this learning resource for" "the typical intended target audience, e.g. 'PT30M', 'PT1H25M'.", ) - keywords: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + keywords: Optional[Union[List[Union[AnyUrl, str, DefinedTerm]], Union[AnyUrl, str, DefinedTerm]]] = Field( None, description="Keywords or tags used to describe this content. Multiple entries in a keywords list are" "typically delimited by commas.", ) - audience: Any = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) - sponsor: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + sponsor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", ) - educationalUse: Union[List[Union[str, Any]], Union[str, Any]] = Field( + educationalUse: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The purpose of a work in the context of education; for example, 'assignment', 'group" "work'.", ) - sdDatePublished: Optional[Union[List[date], date]] = Field( + sdDatePublished: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Indicates the date on which the current structured data was generated / published. Typically" "used alongside [[sdPublisher]]", ) - spatialCoverage: Any = Field( + spatialCoverage: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The spatialCoverage of a CreativeWork indicates the place(s) which are the focus of" "the content. It is a subproperty of contentLocation intended primarily for more technical" @@ -467,11 +496,11 @@ class CreativeWork(Thing): "describes: a dataset of New York weather would have spatialCoverage which was the place:" "the state of New York.", ) - material: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + material: Optional[Union[List[Union[AnyUrl, str, Product]], Union[AnyUrl, str, Product]]] = Field( None, description="A material that something is made from, e.g. leather, wool, cotton, paper.", ) - publication: Any = Field( + publication: Optional[Union[List[Union[PublicationEvent, str]], Union[PublicationEvent, str]]] = Field( None, description="A publication event associated with the item.", ) @@ -485,40 +514,40 @@ class CreativeWork(Thing): "information. Unregistered or niche encoding and file formats can be indicated instead" "via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.", ) - inLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + inLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="The language of the content or performance or used in an action. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" "[[availableLanguage]].", ) - dateModified: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateModified: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date on which the CreativeWork was most recently modified or when the item's entry" "was modified within a DataFeed.", ) - reviews: Any = Field( + reviews: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="Review of the item.", ) - dateCreated: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateCreated: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date on which the CreativeWork was created or the item was added to a DataFeed.", ) - associatedMedia: Any = Field( + associatedMedia: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="A media object that encodes this CreativeWork. This property is a synonym for encoding.", ) - interpretedAsClaim: Any = Field( + interpretedAsClaim: Optional[Union[List[Union[Claim, str]], Union[Claim, str]]] = Field( None, description="Used to indicate a specific claim contained, implied, translated or refined from the" "content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can" "be indicated using [[claimInterpreter]].", ) - review: Any = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - publisherImprint: Optional[Union[List[Organization], Organization]] = Field( + publisherImprint: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The publishing division which published the comic.", ) @@ -531,16 +560,16 @@ class CreativeWork(Thing): None, description="The version of the CreativeWork embodied by a specified resource.", ) - learningResourceType: Union[List[Union[str, Any]], Union[str, Any]] = Field( + learningResourceType: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The predominant type or kind characterizing the learning resource. For example, 'presentation'," "'handout'.", ) - discussionUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + discussionUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A link to the page containing the comments of the CreativeWork.", ) - provider: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." @@ -555,24 +584,24 @@ class CreativeWork(Thing): "file formats can be indicated instead via the most appropriate URL, e.g. defining Web" "page or a Wikipedia entry.", ) - producer: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + producer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization who produced the work (e.g. music album, movie, tv/radio" "series etc.).", ) - citation: Union[List[Union[str, Any]], Union[str, Any]] = Field( + citation: Optional[Union[List[Union[str, 'CreativeWork']], Union[str, 'CreativeWork']]] = Field( None, description="A citation or reference to another creative work, such as another publication, web page," "scholarly article, etc.", ) - archivedAt: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + archivedAt: Optional[Union[List[Union[AnyUrl, WebPage, str]], Union[AnyUrl, WebPage, str]]] = Field( None, description="Indicates a page or other link involved in archival of a [[CreativeWork]]. In the case" "of [[MediaReview]], the items in a [[MediaReviewItem]] may often become inaccessible," "but be archived by archival, journalistic, activist, or law enforcement organizations." "In such cases, the referenced page may not directly publish the content.", ) - encoding: Any = Field( + encoding: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="A media object that encodes this CreativeWork. This property is a synonym for associatedMedia.", ) @@ -581,25 +610,25 @@ class CreativeWork(Thing): description="The predominant mode of learning supported by the learning resource. Acceptable values" "are 'active', 'expositive', or 'mixed'.", ) - spatial: Any = Field( + spatial: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The \"spatial\" property can be used in cases when more specific properties (e.g. [[locationCreated]]," "[[spatialCoverage]], [[contentLocation]]) are not known to be appropriate.", ) - contentLocation: Any = Field( + contentLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The location depicted or described in the content. For example, the location in a photograph" "or painting.", ) - copyrightHolder: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + copyrightHolder: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The party holding the legal copyright to the CreativeWork.", ) - contributor: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + contributor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A secondary contributor to the CreativeWork or Event.", ) - isAccessibleForFree: Optional[Union[List[StrictBool], StrictBool]] = Field( + isAccessibleForFree: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A flag to signal that the item, event, or place is accessible for free.", ) @@ -608,7 +637,7 @@ class CreativeWork(Thing): description="Identifies input methods that are sufficient to fully control the described resource" "([WebSchemas wiki lists possible values](http://www.w3.org/wiki/WebSchemas/Accessibility)).", ) - commentCount: Optional[Union[List[int], int]] = Field( + commentCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of comments this CreativeWork (e.g. Article, Question or Answer) has received." "This is most applicable to works published in Web sites with commenting system; additional" diff --git a/pydantic_schemaorg/CreativeWorkSeason.py b/pydantic_schemaorg/CreativeWorkSeason.py index 6657694f..6c952ded 100644 --- a/pydantic_schemaorg/CreativeWorkSeason.py +++ b/pydantic_schemaorg/CreativeWorkSeason.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.VideoObject import VideoObject +from typing import List, Optional, Union from pydantic_schemaorg.Episode import Episode from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Organization import Organization @@ -15,37 +16,37 @@ class CreativeWorkSeason(CreativeWork): """ type_: str = Field("CreativeWorkSeason", const=True, alias='@type') - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - episodes: Optional[Union[List[Episode], Episode]] = Field( + episodes: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a TV/radio series or season.", ) - numberOfEpisodes: Optional[Union[List[int], int]] = Field( + numberOfEpisodes: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of episodes in this season or series.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - partOfSeries: Optional[Union[List[CreativeWorkSeries], CreativeWorkSeries]] = Field( + partOfSeries: Optional[Union[List[Union[CreativeWorkSeries, str]], Union[CreativeWorkSeries, str]]] = Field( None, description="The series to which this episode or season belongs.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", @@ -54,11 +55,11 @@ class CreativeWorkSeason(CreativeWork): None, description="Position of the season within an ordered group of seasons.", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - episode: Optional[Union[List[Episode], Episode]] = Field( + episode: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a tv, radio or game media within a series or season.", ) diff --git a/pydantic_schemaorg/CreativeWorkSeries.py b/pydantic_schemaorg/CreativeWorkSeries.py index c93e0e94..e81ad665 100644 --- a/pydantic_schemaorg/CreativeWorkSeries.py +++ b/pydantic_schemaorg/CreativeWorkSeries.py @@ -1,11 +1,11 @@ from pydantic import Field from datetime import datetime, date -from typing import Any, Optional, Union, List -from pydantic_schemaorg.CreativeWork import CreativeWork +from typing import List, Optional, Any, Union from pydantic_schemaorg.Series import Series +from pydantic_schemaorg.CreativeWork import CreativeWork -class CreativeWorkSeries(CreativeWork, Series): +class CreativeWorkSeries(Series, CreativeWork): """A CreativeWorkSeries in schema.org is a group of related items, typically but not necessarily" "of the same kind. CreativeWorkSeries are usually organized into some order, often chronological." "Unlike [[ItemList]] which is a general purpose data structure for lists of things, the" @@ -24,11 +24,11 @@ class CreativeWorkSeries(CreativeWork, Series): """ type_: str = Field("CreativeWorkSeries", const=True, alias='@type') - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) diff --git a/pydantic_schemaorg/DDxElement.py b/pydantic_schemaorg/DDxElement.py index bdbe2a66..722d1b53 100644 --- a/pydantic_schemaorg/DDxElement.py +++ b/pydantic_schemaorg/DDxElement.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalCondition import MedicalCondition -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalSignOrSymptom import MedicalSignOrSymptom from pydantic_schemaorg.MedicalIntangible import MedicalIntangible @@ -13,12 +13,12 @@ class DDxElement(MedicalIntangible): """ type_: str = Field("DDxElement", const=True, alias='@type') - diagnosis: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + diagnosis: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="One or more alternative conditions considered in the differential diagnosis process" "as output of a diagnosis process.", ) - distinguishingSign: Optional[Union[List[MedicalSignOrSymptom], MedicalSignOrSymptom]] = Field( + distinguishingSign: Optional[Union[List[Union[MedicalSignOrSymptom, str]], Union[MedicalSignOrSymptom, str]]] = Field( None, description="One of a set of signs and symptoms that can be used to distinguish this diagnosis from others" "in the differential diagnosis.", diff --git a/pydantic_schemaorg/DataCatalog.py b/pydantic_schemaorg/DataCatalog.py index e4486062..4872a501 100644 --- a/pydantic_schemaorg/DataCatalog.py +++ b/pydantic_schemaorg/DataCatalog.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.Dataset import Dataset from pydantic_schemaorg.CreativeWork import CreativeWork @@ -24,7 +25,7 @@ class DataCatalog(CreativeWork): "several [[variableMeasured]] properties recorded for some given data object, use" "a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]].", ) - dataset: Any = Field( + dataset: Optional[Union[List[Union[Dataset, str]], Union[Dataset, str]]] = Field( None, description="A dataset contained in this catalog.", ) diff --git a/pydantic_schemaorg/DataDownload.py b/pydantic_schemaorg/DataDownload.py index bfa6f8e0..c77a26de 100644 --- a/pydantic_schemaorg/DataDownload.py +++ b/pydantic_schemaorg/DataDownload.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.MediaObject import MediaObject diff --git a/pydantic_schemaorg/DataFeed.py b/pydantic_schemaorg/DataFeed.py index f5028c6a..209447e2 100644 --- a/pydantic_schemaorg/DataFeed.py +++ b/pydantic_schemaorg/DataFeed.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.DataFeedItem import DataFeedItem from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from pydantic_schemaorg.DataFeedItem import DataFeedItem +from typing import List, Optional, Union from pydantic_schemaorg.Dataset import Dataset @@ -12,7 +12,7 @@ class DataFeed(Dataset): """ type_: str = Field("DataFeed", const=True, alias='@type') - dataFeedElement: Optional[Union[List[Union[str, DataFeedItem, Thing]], Union[str, DataFeedItem, Thing]]] = Field( + dataFeedElement: Optional[Union[List[Union[str, Thing, DataFeedItem]], Union[str, Thing, DataFeedItem]]] = Field( None, description="An item within in a data feed. Data feeds may have many elements.", ) diff --git a/pydantic_schemaorg/DataFeedItem.py b/pydantic_schemaorg/DataFeedItem.py index a0a12012..ec02e030 100644 --- a/pydantic_schemaorg/DataFeedItem.py +++ b/pydantic_schemaorg/DataFeedItem.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.Intangible import Intangible @@ -12,20 +12,20 @@ class DataFeedItem(Intangible): """ type_: str = Field("DataFeedItem", const=True, alias='@type') - dateDeleted: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateDeleted: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The datetime the item was removed from the DataFeed.", ) - item: Optional[Union[List[Thing], Thing]] = Field( + item: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="An entity represented by an entry in a list or data feed (e.g. an 'artist' in a list of 'artists')’.", ) - dateModified: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateModified: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date on which the CreativeWork was most recently modified or when the item's entry" "was modified within a DataFeed.", ) - dateCreated: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateCreated: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date on which the CreativeWork was created or the item was added to a DataFeed.", ) diff --git a/pydantic_schemaorg/Dataset.py b/pydantic_schemaorg/Dataset.py index e8ad2bf1..7f566ec0 100644 --- a/pydantic_schemaorg/Dataset.py +++ b/pydantic_schemaorg/Dataset.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.DataCatalog import DataCatalog -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime from pydantic_schemaorg.DataDownload import DataDownload from pydantic_schemaorg.PropertyValue import PropertyValue @@ -14,12 +14,12 @@ class Dataset(CreativeWork): """ type_: str = Field("Dataset", const=True, alias='@type') - includedDataCatalog: Optional[Union[List[DataCatalog], DataCatalog]] = Field( + includedDataCatalog: Optional[Union[List[Union[DataCatalog, str]], Union[DataCatalog, str]]] = Field( None, description="A data catalog which contains this dataset (this property was previously 'catalog'," "preferred name is now 'includedInDataCatalog').", ) - datasetTimeInterval: Optional[Union[List[datetime], datetime]] = Field( + datasetTimeInterval: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The range of temporal applicability of a dataset, e.g. for a 2011 census dataset, the" "year 2011 (in ISO 8601 time interval format).", @@ -38,15 +38,15 @@ class Dataset(CreativeWork): "several [[variableMeasured]] properties recorded for some given data object, use" "a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]].", ) - catalog: Optional[Union[List[DataCatalog], DataCatalog]] = Field( + catalog: Optional[Union[List[Union[DataCatalog, str]], Union[DataCatalog, str]]] = Field( None, description="A data catalog which contains this dataset.", ) - distribution: Optional[Union[List[DataDownload], DataDownload]] = Field( + distribution: Optional[Union[List[Union[DataDownload, str]], Union[DataDownload, str]]] = Field( None, description="A downloadable form of this dataset, at a specific location, in a specific format.", ) - includedInDataCatalog: Optional[Union[List[DataCatalog], DataCatalog]] = Field( + includedInDataCatalog: Optional[Union[List[Union[DataCatalog, str]], Union[DataCatalog, str]]] = Field( None, description="A data catalog which contains this dataset.", ) diff --git a/pydantic_schemaorg/DatedMoneySpecification.py b/pydantic_schemaorg/DatedMoneySpecification.py index 0f2bdd80..e6d14685 100644 --- a/pydantic_schemaorg/DatedMoneySpecification.py +++ b/pydantic_schemaorg/DatedMoneySpecification.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Any, Union from datetime import datetime, date from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,15 +16,15 @@ class DatedMoneySpecification(StructuredValue): """ type_: str = Field("DatedMoneySpecification", const=True, alias='@type') - amount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + amount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The amount of money.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) diff --git a/pydantic_schemaorg/DefinedRegion.py b/pydantic_schemaorg/DefinedRegion.py index 65f327dd..63c6203a 100644 --- a/pydantic_schemaorg/DefinedRegion.py +++ b/pydantic_schemaorg/DefinedRegion.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union +from pydantic_schemaorg.Country import Country +from pydantic_schemaorg.PostalCodeRangeSpecification import PostalCodeRangeSpecification from pydantic_schemaorg.StructuredValue import StructuredValue @@ -25,12 +27,12 @@ class DefinedRegion(StructuredValue): description="A defined range of postal codes indicated by a common textual prefix. Used for non-numeric" "systems such as UK.", ) - addressCountry: Union[List[Union[str, Any]], Union[str, Any]] = Field( + addressCountry: Optional[Union[List[Union[str, Country]], Union[str, Country]]] = Field( None, description="The country. For example, USA. You can also provide the two-letter [ISO 3166-1 alpha-2" "country code](http://en.wikipedia.org/wiki/ISO_3166-1).", ) - postalCodeRange: Any = Field( + postalCodeRange: Optional[Union[List[Union[PostalCodeRangeSpecification, str]], Union[PostalCodeRangeSpecification, str]]] = Field( None, description="A defined range of postal codes.", ) diff --git a/pydantic_schemaorg/DefinedTerm.py b/pydantic_schemaorg/DefinedTerm.py index 21aee125..3cdb07f7 100644 --- a/pydantic_schemaorg/DefinedTerm.py +++ b/pydantic_schemaorg/DefinedTerm.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.DefinedTermSet import DefinedTermSet from pydantic_schemaorg.Intangible import Intangible @@ -18,7 +19,7 @@ class DefinedTerm(Intangible): None, description="A code that identifies this [[DefinedTerm]] within a [[DefinedTermSet]]", ) - inDefinedTermSet: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + inDefinedTermSet: Optional[Union[List[Union[AnyUrl, DefinedTermSet, str]], Union[AnyUrl, DefinedTermSet, str]]] = Field( None, description="A [[DefinedTermSet]] that contains this term.", ) diff --git a/pydantic_schemaorg/DefinedTermSet.py b/pydantic_schemaorg/DefinedTermSet.py index f2b04dc1..5f96ed8e 100644 --- a/pydantic_schemaorg/DefinedTermSet.py +++ b/pydantic_schemaorg/DefinedTermSet.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.DefinedTerm import DefinedTerm -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,7 +12,7 @@ class DefinedTermSet(CreativeWork): """ type_: str = Field("DefinedTermSet", const=True, alias='@type') - hasDefinedTerm: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + hasDefinedTerm: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="A Defined Term contained in this term set.", ) diff --git a/pydantic_schemaorg/DeliveryChargeSpecification.py b/pydantic_schemaorg/DeliveryChargeSpecification.py index e0c0da12..6a9d2910 100644 --- a/pydantic_schemaorg/DeliveryChargeSpecification.py +++ b/pydantic_schemaorg/DeliveryChargeSpecification.py @@ -1,7 +1,8 @@ from pydantic import Field from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DeliveryMethod import DeliveryMethod from pydantic_schemaorg.PriceSpecification import PriceSpecification @@ -13,22 +14,22 @@ class DeliveryChargeSpecification(PriceSpecification): """ type_: str = Field("DeliveryChargeSpecification", const=True, alias='@type') - areaServed: Union[List[Union[str, AdministrativeArea, Place, Any]], Union[str, AdministrativeArea, Place, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) - eligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + eligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "valid. See also [[ineligibleRegion]].", ) - appliesToDeliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + appliesToDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="The delivery method(s) to which the delivery charge or payment charge specification" "applies.", ) - ineligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + ineligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" diff --git a/pydantic_schemaorg/DeliveryEvent.py b/pydantic_schemaorg/DeliveryEvent.py index e562a56b..dac441b7 100644 --- a/pydantic_schemaorg/DeliveryEvent.py +++ b/pydantic_schemaorg/DeliveryEvent.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime from pydantic_schemaorg.DeliveryMethod import DeliveryMethod from pydantic_schemaorg.Event import Event @@ -16,15 +16,15 @@ class DeliveryEvent(Event): None, description="Password, PIN, or access code needed for delivery (e.g. from a locker).", ) - availableThrough: Optional[Union[List[datetime], datetime]] = Field( + availableThrough: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="After this date, the item will no longer be available for pickup.", ) - hasDeliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + hasDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="Method used for delivery or shipping.", ) - availableFrom: Optional[Union[List[datetime], datetime]] = Field( + availableFrom: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="When the item is available for pickup from the store, locker, etc.", ) diff --git a/pydantic_schemaorg/DeliveryTimeSettings.py b/pydantic_schemaorg/DeliveryTimeSettings.py index c692b76b..186024d9 100644 --- a/pydantic_schemaorg/DeliveryTimeSettings.py +++ b/pydantic_schemaorg/DeliveryTimeSettings.py @@ -1,6 +1,7 @@ from pydantic import StrictBool, Field from pydantic_schemaorg.DefinedRegion import DefinedRegion -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union +from pydantic_schemaorg.ShippingDeliveryTime import ShippingDeliveryTime from pydantic_schemaorg.StructuredValue import StructuredValue @@ -14,12 +15,12 @@ class DeliveryTimeSettings(StructuredValue): """ type_: str = Field("DeliveryTimeSettings", const=True, alias='@type') - shippingDestination: Optional[Union[List[DefinedRegion], DefinedRegion]] = Field( + shippingDestination: Optional[Union[List[Union[DefinedRegion, str]], Union[DefinedRegion, str]]] = Field( None, description="indicates (possibly multiple) shipping destinations. These can be defined in several" "ways e.g. postalCode ranges.", ) - isUnlabelledFallback: Optional[Union[List[StrictBool], StrictBool]] = Field( + isUnlabelledFallback: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="This can be marked 'true' to indicate that some published [[DeliveryTimeSettings]]" "or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]]" @@ -28,7 +29,7 @@ class DeliveryTimeSettings(StructuredValue): "(for [[DeliveryTimeSettings]]) or shippingLabel (for [[ShippingRateSettings]])," "since this property is for use with unlabelled settings.", ) - deliveryTime: Any = Field( + deliveryTime: Optional[Union[List[Union[ShippingDeliveryTime, str]], Union[ShippingDeliveryTime, str]]] = Field( None, description="The total delay between the receipt of the order and the goods reaching the final customer.", ) diff --git a/pydantic_schemaorg/Demand.py b/pydantic_schemaorg/Demand.py index 2ef17d2a..9f1295f1 100644 --- a/pydantic_schemaorg/Demand.py +++ b/pydantic_schemaorg/Demand.py @@ -1,11 +1,28 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.TypeAndQuantityNode import TypeAndQuantityNode +from typing import List, Optional, Union +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.DeliveryMethod import DeliveryMethod +from pydantic_schemaorg.BusinessEntityType import BusinessEntityType +from pydantic_schemaorg.ItemAvailability import ItemAvailability +from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.LoanOrCredit import LoanOrCredit +from pydantic_schemaorg.PaymentMethod import PaymentMethod +from pydantic_schemaorg.BusinessFunction import BusinessFunction +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from datetime import datetime, time, date from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.WarrantyPromise import WarrantyPromise from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.MenuItem import MenuItem +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.AggregateOffer import AggregateOffer +from pydantic_schemaorg.Service import Service +from pydantic_schemaorg.Trip import Trip from pydantic_schemaorg.OfferItemCondition import OfferItemCondition from pydantic_schemaorg.Intangible import Intangible @@ -19,16 +36,16 @@ class Demand(Intangible): """ type_: str = Field("Demand", const=True, alias='@type') - includesObject: Any = Field( + includesObject: Optional[Union[List[Union[TypeAndQuantityNode, str]], Union[TypeAndQuantityNode, str]]] = Field( None, description="This links to a node or nodes indicating the exact quantity of the products included in" "an [[Offer]] or [[ProductCollection]].", ) - areaServed: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) - availableDeliveryMethod: Any = Field( + availableDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="The delivery method(s) available for this offer.", ) @@ -44,11 +61,11 @@ class Demand(Intangible): "a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - eligibleCustomerType: Any = Field( + eligibleCustomerType: Optional[Union[List[Union[BusinessEntityType, str]], Union[BusinessEntityType, str]]] = Field( None, description="The type(s) of customers for which the given offer is valid.", ) - availability: Any = Field( + availability: Optional[Union[List[Union[ItemAvailability, str]], Union[ItemAvailability, str]]] = Field( None, description="The availability of this item—for example In stock, Out of stock, Pre-order," "etc.", @@ -59,46 +76,46 @@ class Demand(Intangible): "known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - eligibleTransactionVolume: Any = Field( + eligibleTransactionVolume: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="The transaction volume, in a monetary unit, for which the offer or price specification" "is valid, e.g. for indicating a minimal purchasing volume, to express free shipping" "above a certain order volume, or to limit the acceptance of credit cards to purchases" "to a certain minimal amount.", ) - acceptedPaymentMethod: Any = Field( + acceptedPaymentMethod: Optional[Union[List[Union[LoanOrCredit, PaymentMethod, str]], Union[LoanOrCredit, PaymentMethod, str]]] = Field( None, description="The payment method(s) accepted by seller for this offer.", ) - businessFunction: Any = Field( + businessFunction: Optional[Union[List[Union[BusinessFunction, str]], Union[BusinessFunction, str]]] = Field( None, description="The business function (e.g. sell, lease, repair, dispose) of the offer or component" "of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.", ) - eligibleDuration: Any = Field( + eligibleDuration: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The duration for which the given offer is valid.", ) - availabilityStarts: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityStarts: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The beginning of the availability of the product or service included in the offer.", ) - eligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + eligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "valid. See also [[ineligibleRegion]].", ) - seller: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + seller: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity which offers (sells / leases / lends / loans) the services / goods. A seller may" "also be a provider.", ) - warranty: Any = Field( + warranty: Optional[Union[List[Union[WarrantyPromise, str]], Union[WarrantyPromise, str]]] = Field( None, description="The warranty promise(s) included in the offer.", ) - deliveryLeadTime: Any = Field( + deliveryLeadTime: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The typical delay between the receipt of the order and the goods either leaving the warehouse" "or being prepared for pickup, in case the delivery method is on site pickup.", @@ -114,15 +131,15 @@ class Demand(Intangible): "and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - availableAtOrFrom: Optional[Union[List[Place], Place]] = Field( + availableAtOrFrom: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The place(s) from which the offer can be obtained (e.g. store locations).", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - itemOffered: Union[List[Union[CreativeWork, Product, Any]], Union[CreativeWork, Product, Any]] = Field( + itemOffered: Optional[Union[List[Union[Product, MenuItem, Event, CreativeWork, AggregateOffer, Service, Trip, str]], Union[Product, MenuItem, Event, CreativeWork, AggregateOffer, Service, Trip, str]]] = Field( None, description="An item being offered (or demanded). The transactional nature of the offer or demand" "is documented using [[businessFunction]], e.g. sell, lease etc. While several common" @@ -134,11 +151,11 @@ class Demand(Intangible): description="The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN" "Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.", ) - availabilityEnds: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityEnds: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The end of the availability of the product or service included in the offer.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", @@ -161,33 +178,33 @@ class Demand(Intangible): "and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for" "more details. Left-padding of the gtin values is not required or encouraged.", ) - itemCondition: Optional[Union[List[OfferItemCondition], OfferItemCondition]] = Field( + itemCondition: Optional[Union[List[Union[OfferItemCondition, str]], Union[OfferItemCondition, str]]] = Field( None, description="A predefined value from OfferItemCondition specifying the condition of the product" "or service, or the products or services included in the offer. Also used for product return" "policies to specify the condition of products accepted for returns.", ) - inventoryLevel: Any = Field( + inventoryLevel: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The current approximate inventory level for the item or items.", ) - advanceBookingRequirement: Any = Field( + advanceBookingRequirement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The amount of time that is required between accepting the offer and the actual usage of" "the resource or service.", ) - priceSpecification: Any = Field( + priceSpecification: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="One or more detailed price specifications, indicating the unit price and delivery or" "payment charges.", ) - ineligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + ineligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]].", ) - eligibleQuantity: Any = Field( + eligibleQuantity: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The interval and unit of measurement of ordering quantities for which the offer or price" "specification is valid. This allows e.g. specifying that a certain freight charge is" diff --git a/pydantic_schemaorg/Dentist.py b/pydantic_schemaorg/Dentist.py index ec9bbe4c..de8a6e58 100644 --- a/pydantic_schemaorg/Dentist.py +++ b/pydantic_schemaorg/Dentist.py @@ -1,10 +1,10 @@ from pydantic import Field -from pydantic_schemaorg.LocalBusiness import LocalBusiness from pydantic_schemaorg.MedicalBusiness import MedicalBusiness +from pydantic_schemaorg.LocalBusiness import LocalBusiness from pydantic_schemaorg.MedicalOrganization import MedicalOrganization -class Dentist(LocalBusiness, MedicalBusiness, MedicalOrganization): +class Dentist(MedicalBusiness, LocalBusiness, MedicalOrganization): """A dentist. See https://schema.org/Dentist. diff --git a/pydantic_schemaorg/DiagnosticLab.py b/pydantic_schemaorg/DiagnosticLab.py index fb6bb2d6..aa79f416 100644 --- a/pydantic_schemaorg/DiagnosticLab.py +++ b/pydantic_schemaorg/DiagnosticLab.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalTest import MedicalTest -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalOrganization import MedicalOrganization @@ -11,7 +11,7 @@ class DiagnosticLab(MedicalOrganization): """ type_: str = Field("DiagnosticLab", const=True, alias='@type') - availableTest: Optional[Union[List[MedicalTest], MedicalTest]] = Field( + availableTest: Optional[Union[List[Union[MedicalTest, str]], Union[MedicalTest, str]]] = Field( None, description="A diagnostic test or procedure offered by this lab.", ) diff --git a/pydantic_schemaorg/Diet.py b/pydantic_schemaorg/Diet.py index b4d00ee8..27aa0e86 100644 --- a/pydantic_schemaorg/Diet.py +++ b/pydantic_schemaorg/Diet.py @@ -1,12 +1,12 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.CreativeWork import CreativeWork from pydantic_schemaorg.LifestyleModification import LifestyleModification +from pydantic_schemaorg.CreativeWork import CreativeWork -class Diet(CreativeWork, LifestyleModification): +class Diet(LifestyleModification, CreativeWork): """A strategy of regulating the intake of food to achieve or maintain a specific health-related" "goal. @@ -18,7 +18,7 @@ class Diet(CreativeWork, LifestyleModification): None, description="Specific physiologic risks associated to the diet plan.", ) - endorsers: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + endorsers: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="People or organizations that endorse the plan.", ) diff --git a/pydantic_schemaorg/DietarySupplement.py b/pydantic_schemaorg/DietarySupplement.py index 3865f80b..a6f48783 100644 --- a/pydantic_schemaorg/DietarySupplement.py +++ b/pydantic_schemaorg/DietarySupplement.py @@ -1,9 +1,10 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.RecommendedDoseSchedule import RecommendedDoseSchedule from pydantic_schemaorg.Organization import Organization -from pydantic_schemaorg.MedicalEnumeration import MedicalEnumeration +from pydantic_schemaorg.MaximumDoseSchedule import MaximumDoseSchedule from pydantic_schemaorg.DrugLegalStatus import DrugLegalStatus +from pydantic_schemaorg.MedicalEnumeration import MedicalEnumeration from pydantic_schemaorg.Substance import Substance @@ -22,7 +23,7 @@ class DietarySupplement(Substance): "with other drugs and foods, pregnancy, breastfeeding, known adverse reactions, and" "documented efficacy of the supplement.", ) - recommendedIntake: Optional[Union[List[RecommendedDoseSchedule], RecommendedDoseSchedule]] = Field( + recommendedIntake: Optional[Union[List[Union[RecommendedDoseSchedule, str]], Union[RecommendedDoseSchedule, str]]] = Field( None, description="Recommended intake of this supplement for a given population as defined by a specific" "recommending authority.", @@ -40,11 +41,11 @@ class DietarySupplement(Substance): None, description="Proprietary name given to the diet plan, typically by its originator or creator.", ) - manufacturer: Optional[Union[List[Organization], Organization]] = Field( + manufacturer: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The manufacturer of the product.", ) - maximumIntake: Any = Field( + maximumIntake: Optional[Union[List[Union[MaximumDoseSchedule, str]], Union[MaximumDoseSchedule, str]]] = Field( None, description="Recommended intake of this supplement for a given population as defined by a specific" "recommending authority.", @@ -58,12 +59,12 @@ class DietarySupplement(Substance): description="The specific biochemical interaction through which this drug or supplement produces" "its pharmacological effect.", ) - legalStatus: Optional[Union[List[Union[str, MedicalEnumeration, DrugLegalStatus]], Union[str, MedicalEnumeration, DrugLegalStatus]]] = Field( + legalStatus: Optional[Union[List[Union[str, DrugLegalStatus, MedicalEnumeration]], Union[str, DrugLegalStatus, MedicalEnumeration]]] = Field( None, description="The drug or supplement's legal status, including any controlled substance schedules" "that apply.", ) - isProprietary: Optional[Union[List[StrictBool], StrictBool]] = Field( + isProprietary: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="True if this item's name is a proprietary/brand name (vs. generic name).", ) diff --git a/pydantic_schemaorg/DigitalDocument.py b/pydantic_schemaorg/DigitalDocument.py index db47f2d3..2cee16ac 100644 --- a/pydantic_schemaorg/DigitalDocument.py +++ b/pydantic_schemaorg/DigitalDocument.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.DigitalDocumentPermission import DigitalDocumentPermission +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -10,7 +11,7 @@ class DigitalDocument(CreativeWork): """ type_: str = Field("DigitalDocument", const=True, alias='@type') - hasDigitalDocumentPermission: Any = Field( + hasDigitalDocumentPermission: Optional[Union[List[Union[DigitalDocumentPermission, str]], Union[DigitalDocumentPermission, str]]] = Field( None, description="A permission related to the access to this document (e.g. permission to read or write" "an electronic document). For a public document, specify a grantee with an Audience with" diff --git a/pydantic_schemaorg/DigitalDocumentPermission.py b/pydantic_schemaorg/DigitalDocumentPermission.py index 56803041..09075b17 100644 --- a/pydantic_schemaorg/DigitalDocumentPermission.py +++ b/pydantic_schemaorg/DigitalDocumentPermission.py @@ -1,10 +1,10 @@ from pydantic import Field from pydantic_schemaorg.DigitalDocumentPermissionType import DigitalDocumentPermissionType -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ContactPoint import ContactPoint +from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.Audience import Audience -from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Intangible import Intangible @@ -15,11 +15,11 @@ class DigitalDocumentPermission(Intangible): """ type_: str = Field("DigitalDocumentPermission", const=True, alias='@type') - permissionType: Optional[Union[List[DigitalDocumentPermissionType], DigitalDocumentPermissionType]] = Field( + permissionType: Optional[Union[List[Union[DigitalDocumentPermissionType, str]], Union[DigitalDocumentPermissionType, str]]] = Field( None, description="The type of permission granted the person, organization, or audience.", ) - grantee: Optional[Union[List[Union[Organization, Person, Audience, ContactPoint]], Union[Organization, Person, Audience, ContactPoint]]] = Field( + grantee: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="The person, organization, contact point, or audience that has been granted this permission.", ) diff --git a/pydantic_schemaorg/DonateAction.py b/pydantic_schemaorg/DonateAction.py index 2de93a61..ea86fd80 100644 --- a/pydantic_schemaorg/DonateAction.py +++ b/pydantic_schemaorg/DonateAction.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.ContactPoint import ContactPoint -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TradeAction import TradeAction @@ -15,7 +15,7 @@ class DonateAction(TradeAction): """ type_: str = Field("DonateAction", const=True, alias='@type') - recipient: Optional[Union[List[Union[Organization, Audience, Person, ContactPoint]], Union[Organization, Audience, Person, ContactPoint]]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/DoseSchedule.py b/pydantic_schemaorg/DoseSchedule.py index 9fde20ac..4ccde5de 100644 --- a/pydantic_schemaorg/DoseSchedule.py +++ b/pydantic_schemaorg/DoseSchedule.py @@ -1,6 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from decimal import Decimal +from pydantic_schemaorg.QualitativeValue import QualitativeValue from pydantic_schemaorg.MedicalIntangible import MedicalIntangible @@ -16,7 +17,7 @@ class DoseSchedule(MedicalIntangible): description="Characteristics of the population for which this is intended, or which typically uses" "it, e.g. 'adults'.", ) - doseValue: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + doseValue: Optional[Union[List[Union[Decimal, QualitativeValue, str]], Union[Decimal, QualitativeValue, str]]] = Field( None, description="The value of the dose, e.g. 500.", ) diff --git a/pydantic_schemaorg/Drug.py b/pydantic_schemaorg/Drug.py index 9db68d99..76ff96f2 100644 --- a/pydantic_schemaorg/Drug.py +++ b/pydantic_schemaorg/Drug.py @@ -1,8 +1,14 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field, StrictBool +from typing import List, Optional, Union +from pydantic_schemaorg.DrugStrength import DrugStrength from pydantic_schemaorg.DrugPregnancyCategory import DrugPregnancyCategory from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.DoseSchedule import DoseSchedule +from pydantic_schemaorg.MaximumDoseSchedule import MaximumDoseSchedule +from pydantic_schemaorg.DrugPrescriptionStatus import DrugPrescriptionStatus +from pydantic_schemaorg.HealthInsurancePlan import HealthInsurancePlan +from pydantic_schemaorg.DrugClass import DrugClass +from pydantic_schemaorg.DrugLegalStatus import DrugLegalStatus from pydantic_schemaorg.MedicalEnumeration import MedicalEnumeration from pydantic_schemaorg.Substance import Substance @@ -16,7 +22,7 @@ class Drug(Substance): """ type_: str = Field("Drug", const=True, alias='@type') - prescribingInfo: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + prescribingInfo: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Link to prescribing information for the drug.", ) @@ -34,7 +40,7 @@ class Drug(Substance): description="Description of the absorption and elimination of drugs, including their concentration" "(pharmacokinetics, pK) and biological effects (pharmacodynamics, pD).", ) - availableStrength: Any = Field( + availableStrength: Optional[Union[List[Union[DrugStrength, str]], Union[DrugStrength, str]]] = Field( None, description="An available dosage strength for the drug.", ) @@ -52,7 +58,7 @@ class Drug(Substance): description="Any precaution, guidance, contraindication, etc. related to this drug's use by breastfeeding" "mothers.", ) - pregnancyCategory: Optional[Union[List[DrugPregnancyCategory], DrugPregnancyCategory]] = Field( + pregnancyCategory: Optional[Union[List[Union[DrugPregnancyCategory, str]], Union[DrugPregnancyCategory, str]]] = Field( None, description="Pregnancy category of this drug.", ) @@ -69,7 +75,7 @@ class Drug(Substance): None, description="Proprietary name given to the diet plan, typically by its originator or creator.", ) - manufacturer: Optional[Union[List[Organization], Organization]] = Field( + manufacturer: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The manufacturer of the product.", ) @@ -82,21 +88,21 @@ class Drug(Substance): description="Any precaution, guidance, contraindication, etc. related to consumption of specific" "foods while taking this drug.", ) - doseSchedule: Optional[Union[List[DoseSchedule], DoseSchedule]] = Field( + doseSchedule: Optional[Union[List[Union[DoseSchedule, str]], Union[DoseSchedule, str]]] = Field( None, description="A dosing schedule for the drug for a given population, either observed, recommended," "or maximum dose based on the type used.", ) - maximumIntake: Any = Field( + maximumIntake: Optional[Union[List[Union[MaximumDoseSchedule, str]], Union[MaximumDoseSchedule, str]]] = Field( None, description="Recommended intake of this supplement for a given population as defined by a specific" "recommending authority.", ) - isAvailableGenerically: Optional[Union[List[StrictBool], StrictBool]] = Field( + isAvailableGenerically: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="True if the drug is available in a generic form (regardless of name).", ) - prescriptionStatus: Union[List[Union[str, Any]], Union[str, Any]] = Field( + prescriptionStatus: Optional[Union[List[Union[str, DrugPrescriptionStatus]], Union[str, DrugPrescriptionStatus]]] = Field( None, description="Indicates the status of drug prescription eg. local catalogs classifications or whether" "the drug is available by prescription or over-the-counter, etc.", @@ -106,7 +112,7 @@ class Drug(Substance): description="Any information related to overdose on a drug, including signs or symptoms, treatments," "contact information for emergency response.", ) - includedInHealthInsurancePlan: Any = Field( + includedInHealthInsurancePlan: Optional[Union[List[Union[HealthInsurancePlan, str]], Union[HealthInsurancePlan, str]]] = Field( None, description="The insurance plans that cover this drug.", ) @@ -119,21 +125,21 @@ class Drug(Substance): description="A dosage form in which this drug/supplement is available, e.g. 'tablet', 'suspension'," "'injection'.", ) - labelDetails: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + labelDetails: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Link to the drug's label details.", ) - interactingDrug: Any = Field( + interactingDrug: Optional[Union[List[Union['Drug', str]], Union['Drug', str]]] = Field( None, description="Another drug that is known to interact with this drug in a way that impacts the effect of" "this drug or causes a risk to the patient. Note: disease interactions are typically captured" "as contraindications.", ) - relatedDrug: Any = Field( + relatedDrug: Optional[Union[List[Union['Drug', str]], Union['Drug', str]]] = Field( None, description="Any other drug related to this one, for example commonly-prescribed alternatives.", ) - drugClass: Any = Field( + drugClass: Optional[Union[List[Union[DrugClass, str]], Union[DrugClass, str]]] = Field( None, description="The class of drug this belongs to (e.g., statins).", ) @@ -142,12 +148,12 @@ class Drug(Substance): description="The specific biochemical interaction through which this drug or supplement produces" "its pharmacological effect.", ) - legalStatus: Union[List[Union[str, MedicalEnumeration, Any]], Union[str, MedicalEnumeration, Any]] = Field( + legalStatus: Optional[Union[List[Union[str, DrugLegalStatus, MedicalEnumeration]], Union[str, DrugLegalStatus, MedicalEnumeration]]] = Field( None, description="The drug or supplement's legal status, including any controlled substance schedules" "that apply.", ) - isProprietary: Optional[Union[List[StrictBool], StrictBool]] = Field( + isProprietary: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="True if this item's name is a proprietary/brand name (vs. generic name).", ) diff --git a/pydantic_schemaorg/DrugClass.py b/pydantic_schemaorg/DrugClass.py index 7a5e8c14..19764e9f 100644 --- a/pydantic_schemaorg/DrugClass.py +++ b/pydantic_schemaorg/DrugClass.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Drug import Drug -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -12,7 +12,7 @@ class DrugClass(MedicalEntity): """ type_: str = Field("DrugClass", const=True, alias='@type') - drug: Optional[Union[List[Drug], Drug]] = Field( + drug: Optional[Union[List[Union[Drug, str]], Union[Drug, str]]] = Field( None, description="Specifying a drug or medicine used in a medication procedure.", ) diff --git a/pydantic_schemaorg/DrugCost.py b/pydantic_schemaorg/DrugCost.py index 060c9ba2..eee3bb86 100644 --- a/pydantic_schemaorg/DrugCost.py +++ b/pydantic_schemaorg/DrugCost.py @@ -1,7 +1,9 @@ from pydantic import Field from pydantic_schemaorg.DrugCostCategory import DrugCostCategory -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from decimal import Decimal +from pydantic_schemaorg.QualitativeValue import QualitativeValue from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -17,7 +19,7 @@ class DrugCost(MedicalEntity): """ type_: str = Field("DrugCost", const=True, alias='@type') - costCategory: Optional[Union[List[DrugCostCategory], DrugCostCategory]] = Field( + costCategory: Optional[Union[List[Union[DrugCostCategory, str]], Union[DrugCostCategory, str]]] = Field( None, description="The category of cost, such as wholesale, retail, reimbursement cap, etc.", ) @@ -25,7 +27,7 @@ class DrugCost(MedicalEntity): None, description="The unit in which the drug is measured, e.g. '5 mg tablet'.", ) - applicableLocation: Any = Field( + applicableLocation: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The location in which the status applies.", ) @@ -33,7 +35,7 @@ class DrugCost(MedicalEntity): None, description="The currency (in 3-letter of the drug cost. See: http://en.wikipedia.org/wiki/ISO_4217.", ) - costPerUnit: Union[List[Union[Decimal, str, Any]], Union[Decimal, str, Any]] = Field( + costPerUnit: Optional[Union[List[Union[Decimal, str, QualitativeValue]], Union[Decimal, str, QualitativeValue]]] = Field( None, description="The cost per unit of the drug.", ) diff --git a/pydantic_schemaorg/DrugLegalStatus.py b/pydantic_schemaorg/DrugLegalStatus.py index 6b41ad49..6235d6da 100644 --- a/pydantic_schemaorg/DrugLegalStatus.py +++ b/pydantic_schemaorg/DrugLegalStatus.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.AdministrativeArea import AdministrativeArea -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalIntangible import MedicalIntangible @@ -11,7 +11,7 @@ class DrugLegalStatus(MedicalIntangible): """ type_: str = Field("DrugLegalStatus", const=True, alias='@type') - applicableLocation: Optional[Union[List[AdministrativeArea], AdministrativeArea]] = Field( + applicableLocation: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The location in which the status applies.", ) diff --git a/pydantic_schemaorg/DrugStrength.py b/pydantic_schemaorg/DrugStrength.py index c3298043..92ab5ce4 100644 --- a/pydantic_schemaorg/DrugStrength.py +++ b/pydantic_schemaorg/DrugStrength.py @@ -1,7 +1,8 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from decimal import Decimal +from pydantic_schemaorg.MaximumDoseSchedule import MaximumDoseSchedule from pydantic_schemaorg.MedicalIntangible import MedicalIntangible @@ -16,7 +17,7 @@ class DrugStrength(MedicalIntangible): None, description="An active ingredient, typically chemical compounds and/or biologic substances.", ) - availableIn: Optional[Union[List[AdministrativeArea], AdministrativeArea]] = Field( + availableIn: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The location in which the strength is available.", ) @@ -24,11 +25,11 @@ class DrugStrength(MedicalIntangible): None, description="The units of an active ingredient's strength, e.g. mg.", ) - strengthValue: Optional[Union[List[Decimal], Decimal]] = Field( + strengthValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The value of an active ingredient's strength, e.g. 325.", ) - maximumIntake: Any = Field( + maximumIntake: Optional[Union[List[Union[MaximumDoseSchedule, str]], Union[MaximumDoseSchedule, str]]] = Field( None, description="Recommended intake of this supplement for a given population as defined by a specific" "recommending authority.", diff --git a/pydantic_schemaorg/EducationEvent.py b/pydantic_schemaorg/EducationEvent.py index f5995d04..3fbb3c9b 100644 --- a/pydantic_schemaorg/EducationEvent.py +++ b/pydantic_schemaorg/EducationEvent.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.DefinedTerm import DefinedTerm -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Event import Event diff --git a/pydantic_schemaorg/EducationalAudience.py b/pydantic_schemaorg/EducationalAudience.py index b3918dde..bdf72d1c 100644 --- a/pydantic_schemaorg/EducationalAudience.py +++ b/pydantic_schemaorg/EducationalAudience.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Audience import Audience diff --git a/pydantic_schemaorg/EducationalOccupationalCredential.py b/pydantic_schemaorg/EducationalOccupationalCredential.py index 36a22b71..1078b0d4 100644 --- a/pydantic_schemaorg/EducationalOccupationalCredential.py +++ b/pydantic_schemaorg/EducationalOccupationalCredential.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.Duration import Duration +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTerm import DefinedTerm from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.AdministrativeArea import AdministrativeArea @@ -15,7 +16,7 @@ class EducationalOccupationalCredential(CreativeWork): """ type_: str = Field("EducationalOccupationalCredential", const=True, alias='@type') - validFor: Any = Field( + validFor: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of validity of a permit or similar thing.", ) @@ -31,12 +32,12 @@ class EducationalOccupationalCredential(CreativeWork): "of educational levels include 'beginner', 'intermediate' or 'advanced', and formal" "sets of level indicators.", ) - recognizedBy: Optional[Union[List[Organization], Organization]] = Field( + recognizedBy: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="An organization that acknowledges the validity, value or utility of a credential. Note:" "recognition may include a process of quality assurance or accreditation.", ) - validIn: Optional[Union[List[AdministrativeArea], AdministrativeArea]] = Field( + validIn: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The geographic area where a permit or similar thing is valid.", ) diff --git a/pydantic_schemaorg/EducationalOccupationalProgram.py b/pydantic_schemaorg/EducationalOccupationalProgram.py index 74a29275..3f0e8709 100644 --- a/pydantic_schemaorg/EducationalOccupationalProgram.py +++ b/pydantic_schemaorg/EducationalOccupationalProgram.py @@ -1,10 +1,15 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.Duration import Duration +from typing import List, Optional, Union from pydantic_schemaorg.Demand import Demand +from pydantic_schemaorg.Offer import Offer from pydantic_schemaorg.StructuredValue import StructuredValue from datetime import datetime, date from pydantic_schemaorg.AlignmentObject import AlignmentObject +from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential +from pydantic_schemaorg.Course import Course from pydantic_schemaorg.DefinedTerm import DefinedTerm +from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution from decimal import Decimal from pydantic_schemaorg.DayOfWeek import DayOfWeek from pydantic_schemaorg.Organization import Organization @@ -24,11 +29,11 @@ class EducationalOccupationalProgram(Intangible): """ type_: str = Field("EducationalOccupationalProgram", const=True, alias='@type') - timeToComplete: Any = Field( + timeToComplete: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The expected length of time to complete the program if attending full-time.", ) - offers: Union[List[Union[Demand, Any]], Union[Demand, Any]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -37,21 +42,21 @@ class EducationalOccupationalProgram(Intangible): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - typicalCreditsPerTerm: Optional[Union[List[Union[int, StructuredValue]], Union[int, StructuredValue]]] = Field( + typicalCreditsPerTerm: Optional[Union[List[Union[int, StructuredValue, str]], Union[int, StructuredValue, str]]] = Field( None, description="The number of credits or units a full-time student would be expected to take in 1 term however" "'term' is defined by the institution.", ) - applicationStartDate: Optional[Union[List[date], date]] = Field( + applicationStartDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date at which the program begins collecting applications for the next enrollment" "cycle.", ) - programPrerequisites: Union[List[Union[str, AlignmentObject, Any]], Union[str, AlignmentObject, Any]] = Field( + programPrerequisites: Optional[Union[List[Union[str, AlignmentObject, EducationalOccupationalCredential, Course]], Union[str, AlignmentObject, EducationalOccupationalCredential, Course]]] = Field( None, description="Prerequisites for enrolling in the program.", ) - numberOfCredits: Optional[Union[List[Union[int, StructuredValue]], Union[int, StructuredValue]]] = Field( + numberOfCredits: Optional[Union[List[Union[int, StructuredValue, str]], Union[int, StructuredValue, str]]] = Field( None, description="The number of credits or units awarded by a Course or required to complete an EducationalOccupationalProgram.", ) @@ -68,34 +73,34 @@ class EducationalOccupationalProgram(Intangible): description="The type of educational or occupational program. For example, classroom, internship," "alternance, etc..", ) - applicationDeadline: Optional[Union[List[date], date]] = Field( + applicationDeadline: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date at which the program stops collecting applications for the next enrollment" "cycle.", ) - educationalCredentialAwarded: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + educationalCredentialAwarded: Optional[Union[List[Union[AnyUrl, str, EducationalOccupationalCredential]], Union[AnyUrl, str, EducationalOccupationalCredential]]] = Field( None, description="A description of the qualification, award, certificate, diploma or other educational" "credential awarded as a consequence of successful completion of this course or program.", ) - maximumEnrollment: Optional[Union[List[int], int]] = Field( + maximumEnrollment: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The maximum number of students who may be enrolled in the program.", ) - termDuration: Any = Field( + termDuration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The amount of time in a term as defined by the institution. A term is a length of time where" "students take one or more classes. Semesters and quarters are common units for term.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - trainingSalary: Any = Field( + trainingSalary: Optional[Union[List[Union[MonetaryAmountDistribution, str]], Union[MonetaryAmountDistribution, str]]] = Field( None, description="The estimated salary earned while in the program.", ) - salaryUponCompletion: Any = Field( + salaryUponCompletion: Optional[Union[List[Union[MonetaryAmountDistribution, str]], Union[MonetaryAmountDistribution, str]]] = Field( None, description="The expected salary upon completing the training.", ) @@ -103,22 +108,22 @@ class EducationalOccupationalProgram(Intangible): None, description="The time of day the program normally runs. For example, \"evenings\".", ) - termsPerYear: Optional[Union[List[Decimal], Decimal]] = Field( + termsPerYear: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The number of times terms of study are offered per year. Semesters and quarters are common" "units for term. For example, if the student can only take 2 semesters for the program in" "one year, then termsPerYear should be 2.", ) - occupationalCredentialAwarded: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + occupationalCredentialAwarded: Optional[Union[List[Union[AnyUrl, str, EducationalOccupationalCredential]], Union[AnyUrl, str, EducationalOccupationalCredential]]] = Field( None, description="A description of the qualification, award, certificate, diploma or other occupational" "credential awarded as a consequence of successful completion of this course or program.", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - dayOfWeek: Optional[Union[List[DayOfWeek], DayOfWeek]] = Field( + dayOfWeek: Optional[Union[List[Union[DayOfWeek, str]], Union[DayOfWeek, str]]] = Field( None, description="The day of the week for which these opening hours are valid.", ) @@ -127,7 +132,7 @@ class EducationalOccupationalProgram(Intangible): description="A financial aid type or program which students may use to pay for tuition or fees associated" "with the program.", ) - provider: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." @@ -142,7 +147,7 @@ class EducationalOccupationalProgram(Intangible): "be provided. Note: for historical reasons, any textual label and formal code provided" "as a literal may be assumed to be from O*NET-SOC.", ) - hasCourse: Any = Field( + hasCourse: Optional[Union[List[Union[Course, str]], Union[Course, str]]] = Field( None, description="A course or class that is one of the learning opportunities that constitute an educational" "/ occupational program. No information is implied about whether the course is mandatory" diff --git a/pydantic_schemaorg/EducationalOrganization.py b/pydantic_schemaorg/EducationalOrganization.py index 8d99f726..e34a19ad 100644 --- a/pydantic_schemaorg/EducationalOrganization.py +++ b/pydantic_schemaorg/EducationalOrganization.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CivicStructure import CivicStructure from pydantic_schemaorg.Organization import Organization @@ -12,7 +12,7 @@ class EducationalOrganization(CivicStructure, Organization): """ type_: str = Field("EducationalOrganization", const=True, alias='@type') - alumni: Optional[Union[List[Person], Person]] = Field( + alumni: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Alumni of an organization.", ) diff --git a/pydantic_schemaorg/EmployeeRole.py b/pydantic_schemaorg/EmployeeRole.py index 8210e718..856d78f1 100644 --- a/pydantic_schemaorg/EmployeeRole.py +++ b/pydantic_schemaorg/EmployeeRole.py @@ -1,7 +1,8 @@ from pydantic import Field -from typing import Any, Optional, Union, List -from pydantic_schemaorg.PriceSpecification import PriceSpecification +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.OrganizationRole import OrganizationRole @@ -17,7 +18,7 @@ class EmployeeRole(OrganizationRole): description="The currency (coded using [ISO 4217](http://en.wikipedia.org/wiki/ISO_4217) )" "used for the main salary information in this job posting or for this employee.", ) - baseSalary: Union[List[Union[Decimal, PriceSpecification, Any]], Union[Decimal, PriceSpecification, Any]] = Field( + baseSalary: Optional[Union[List[Union[Decimal, PriceSpecification, MonetaryAmount, str]], Union[Decimal, PriceSpecification, MonetaryAmount, str]]] = Field( None, description="The base salary of the job or of an employee in an EmployeeRole.", ) diff --git a/pydantic_schemaorg/EndorseAction.py b/pydantic_schemaorg/EndorseAction.py index f307a552..34addc50 100644 --- a/pydantic_schemaorg/EndorseAction.py +++ b/pydantic_schemaorg/EndorseAction.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.ReactAction import ReactAction @@ -12,7 +12,7 @@ class EndorseAction(ReactAction): """ type_: str = Field("EndorseAction", const=True, alias='@type') - endorsee: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + endorsee: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A sub property of participant. The person/organization being supported.", ) diff --git a/pydantic_schemaorg/EnergyConsumptionDetails.py b/pydantic_schemaorg/EnergyConsumptionDetails.py index ed33329b..90bc6c7e 100644 --- a/pydantic_schemaorg/EnergyConsumptionDetails.py +++ b/pydantic_schemaorg/EnergyConsumptionDetails.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.EUEnergyEfficiencyEnumeration import EUEnergyEfficiencyEnumeration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.EnergyEfficiencyEnumeration import EnergyEfficiencyEnumeration from pydantic_schemaorg.Intangible import Intangible @@ -16,19 +16,19 @@ class EnergyConsumptionDetails(Intangible): """ type_: str = Field("EnergyConsumptionDetails", const=True, alias='@type') - energyEfficiencyScaleMax: Optional[Union[List[EUEnergyEfficiencyEnumeration], EUEnergyEfficiencyEnumeration]] = Field( + energyEfficiencyScaleMax: Optional[Union[List[Union[EUEnergyEfficiencyEnumeration, str]], Union[EUEnergyEfficiencyEnumeration, str]]] = Field( None, description="Specifies the most energy efficient class on the regulated EU energy consumption scale" "for the product category a product belongs to. For example, energy consumption for televisions" "placed on the market after January 1, 2020 is scaled from D to A+++.", ) - energyEfficiencyScaleMin: Optional[Union[List[EUEnergyEfficiencyEnumeration], EUEnergyEfficiencyEnumeration]] = Field( + energyEfficiencyScaleMin: Optional[Union[List[Union[EUEnergyEfficiencyEnumeration, str]], Union[EUEnergyEfficiencyEnumeration, str]]] = Field( None, description="Specifies the least energy efficient class on the regulated EU energy consumption scale" "for the product category a product belongs to. For example, energy consumption for televisions" "placed on the market after January 1, 2020 is scaled from D to A+++.", ) - hasEnergyEfficiencyCategory: Optional[Union[List[EnergyEfficiencyEnumeration], EnergyEfficiencyEnumeration]] = Field( + hasEnergyEfficiencyCategory: Optional[Union[List[Union[EnergyEfficiencyEnumeration, str]], Union[EnergyEfficiencyEnumeration, str]]] = Field( None, description="Defines the energy efficiency Category (which could be either a rating out of range of" "values or a yes/no certification) for a product according to an international energy" diff --git a/pydantic_schemaorg/EngineSpecification.py b/pydantic_schemaorg/EngineSpecification.py index 22655717..ab1ab74b 100644 --- a/pydantic_schemaorg/EngineSpecification.py +++ b/pydantic_schemaorg/EngineSpecification.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QualitativeValue import QualitativeValue from pydantic_schemaorg.StructuredValue import StructuredValue @@ -13,7 +13,7 @@ class EngineSpecification(StructuredValue): """ type_: str = Field("EngineSpecification", const=True, alias='@type') - torque: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + torque: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The torque (turning force) of the vehicle's engine. Typical unit code(s): NU for newton" "metre (N m), F17 for pound-force per foot, or F48 for pound-force per inch * Note 1: You" @@ -30,7 +30,7 @@ class EngineSpecification(StructuredValue): description="The type of fuel suitable for the engine or engines of the vehicle. If the vehicle has only" "one engine, this property can be attached directly to the vehicle.", ) - engineDisplacement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + engineDisplacement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The volume swept by all of the pistons inside the cylinders of an internal combustion" "engine in a single movement. Typical unit code(s): CMQ for cubic centimeter, LTR for" @@ -38,7 +38,7 @@ class EngineSpecification(StructuredValue): "has been determined using the [[valueReference]] property. * Note 2: You can use [[minValue]]" "and [[maxValue]] to indicate ranges.", ) - enginePower: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + enginePower: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The power of the vehicle's engine. Typical unit code(s): KWT for kilowatt, BHP for brake" "horsepower, N12 for metric horsepower (PS, with 1 PS = 735,49875 W) * Note 1: There are" diff --git a/pydantic_schemaorg/EntryPoint.py b/pydantic_schemaorg/EntryPoint.py index 5cafe255..085daa6a 100644 --- a/pydantic_schemaorg/EntryPoint.py +++ b/pydantic_schemaorg/EntryPoint.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Any, Union from pydantic_schemaorg.SoftwareApplication import SoftwareApplication from pydantic_schemaorg.Intangible import Intangible @@ -15,11 +15,11 @@ class EntryPoint(Intangible): None, description="The supported content type(s) for an EntryPoint response.", ) - actionApplication: Optional[Union[List[SoftwareApplication], SoftwareApplication]] = Field( + actionApplication: Optional[Union[List[Union[SoftwareApplication, str]], Union[SoftwareApplication, str]]] = Field( None, description="An application that can complete the request.", ) - application: Optional[Union[List[SoftwareApplication], SoftwareApplication]] = Field( + application: Optional[Union[List[Union[SoftwareApplication, str]], Union[SoftwareApplication, str]]] = Field( None, description="An application that can complete the request.", ) diff --git a/pydantic_schemaorg/Enumeration.py b/pydantic_schemaorg/Enumeration.py index 06d97d6f..d933dab4 100644 --- a/pydantic_schemaorg/Enumeration.py +++ b/pydantic_schemaorg/Enumeration.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Class import Class +from pydantic_schemaorg.Property import Property +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -10,7 +12,7 @@ class Enumeration(Intangible): """ type_: str = Field("Enumeration", const=True, alias='@type') - supersededBy: Any = Field( + supersededBy: Optional[Union[List[Union[Class, 'Enumeration', Property, str]], Union[Class, 'Enumeration', Property, str]]] = Field( None, description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.", ) diff --git a/pydantic_schemaorg/Episode.py b/pydantic_schemaorg/Episode.py index 695a7f2e..16ed30ed 100644 --- a/pydantic_schemaorg/Episode.py +++ b/pydantic_schemaorg/Episode.py @@ -1,8 +1,12 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.VideoObject import VideoObject +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWork import CreativeWork @@ -13,11 +17,11 @@ class Episode(CreativeWork): """ type_: str = Field("Episode", const=True, alias='@type') - partOfSeason: Any = Field( + partOfSeason: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="The season to which this episode belongs.", ) - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", @@ -26,39 +30,39 @@ class Episode(CreativeWork): None, description="Position of the episode within an ordered group of episodes.", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - partOfSeries: Optional[Union[List[CreativeWorkSeries], CreativeWorkSeries]] = Field( + partOfSeries: Optional[Union[List[Union[CreativeWorkSeries, str]], Union[CreativeWorkSeries, str]]] = Field( None, description="The series to which this episode or season belongs.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/Event.py b/pydantic_schemaorg/Event.py index e08bfb2a..83e0f945 100644 --- a/pydantic_schemaorg/Event.py +++ b/pydantic_schemaorg/Event.py @@ -1,15 +1,23 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.Demand import Demand +from pydantic_schemaorg.Offer import Offer from datetime import datetime, time, date from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.AggregateRating import AggregateRating +from pydantic_schemaorg.Duration import Duration +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.VirtualLocation import VirtualLocation from pydantic_schemaorg.Place import Place from pydantic_schemaorg.EventStatusType import EventStatusType from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.EventAttendanceModeEnumeration import EventAttendanceModeEnumeration +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Review import Review +from pydantic_schemaorg.Schedule import Schedule class Event(Thing): @@ -21,16 +29,16 @@ class Event(Thing): """ type_: str = Field("Event", const=True, alias='@type') - subEvent: Any = Field( + subEvent: Optional[Union[List[Union['Event', str]], Union['Event', str]]] = Field( None, description="An Event that is part of this event. For example, a conference event includes many presentations," "each of which is a subEvent of the conference.", ) - about: Optional[Union[List[Thing], Thing]] = Field( + about: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The subject matter of the content.", ) - offers: Union[List[Union[Demand, Any]], Union[Demand, Any]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -39,7 +47,7 @@ class Event(Thing): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - doorTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + doorTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The time admission will commence.", ) @@ -47,153 +55,153 @@ class Event(Thing): None, description="The typical expected age range, e.g. '7-9', '11-'.", ) - funder: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + funder: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports (sponsors) something through some kind of financial" "contribution.", ) - maximumAttendeeCapacity: Optional[Union[List[int], int]] = Field( + maximumAttendeeCapacity: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The total number of individuals that may attend an event or venue.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) - attendees: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + attendees: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person attending the event.", ) - composer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + composer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization who wrote a composition, or who is the composer of a work performed" "at some event.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - translator: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + translator: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Organization or person who adapts a creative work to different languages, regional" "differences and technical requirements of a target market, or that translates during" "some event.", ) - previousStartDate: Optional[Union[List[date], date]] = Field( + previousStartDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Used in conjunction with eventStatus for rescheduled or cancelled events. This property" "contains the previously scheduled start date. For rescheduled events, the startDate" "property should be used for the newly scheduled start date. In the (rare) case of an event" "that has been postponed and rescheduled multiple times, this field may be repeated.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - location: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + location: Optional[Union[List[Union[str, PostalAddress, VirtualLocation, Place]], Union[str, PostalAddress, VirtualLocation, Place]]] = Field( None, description="The location of, for example, where an event is happening, where an organization is located," "or where an action takes place.", ) - eventStatus: Optional[Union[List[EventStatusType], EventStatusType]] = Field( + eventStatus: Optional[Union[List[Union[EventStatusType, str]], Union[EventStatusType, str]]] = Field( None, description="An eventStatus of an event represents its status; particularly useful when an event" "is cancelled or rescheduled.", ) - maximumPhysicalAttendeeCapacity: Optional[Union[List[int], int]] = Field( + maximumPhysicalAttendeeCapacity: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]]" "is [[OfflineEventAttendanceMode]] (or the offline aspects, in the case of a [[MixedEventAttendanceMode]]).", ) - remainingAttendeeCapacity: Optional[Union[List[int], int]] = Field( + remainingAttendeeCapacity: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of attendee places for an event that remain unallocated.", ) - attendee: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + attendee: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization attending the event.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - audience: Optional[Union[List[Audience], Audience]] = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) - sponsor: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + sponsor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", ) - organizer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + organizer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An organizer of an Event.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - workFeatured: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + workFeatured: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="A work featured in some event, e.g. exhibited in an ExhibitionEvent. Specific subproperties" "are available for workPerformed (e.g. a play), or a workPresented (a Movie at a ScreeningEvent).", ) - eventAttendanceMode: Any = Field( + eventAttendanceMode: Optional[Union[List[Union[EventAttendanceModeEnumeration, str]], Union[EventAttendanceModeEnumeration, str]]] = Field( None, description="The eventAttendanceMode of an event indicates whether it occurs online, offline, or" "a mix.", ) - superEvent: Any = Field( + superEvent: Optional[Union[List[Union['Event', str]], Union['Event', str]]] = Field( None, description="An event that this event is a part of. For example, a collection of individual music performances" "might each have a music festival as their superEvent.", ) - workPerformed: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + workPerformed: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="A work performed in some event, for example a play performed in a TheaterEvent.", ) - recordedIn: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + recordedIn: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="The CreativeWork that captured all or part of this Event.", ) - performers: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + performers: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The main performer or performers of the event—for example, a presenter, musician," "or actor.", ) - maximumVirtualAttendeeCapacity: Optional[Union[List[int], int]] = Field( + maximumVirtualAttendeeCapacity: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The maximum physical attendee capacity of an [[Event]] whose [[eventAttendanceMode]]" "is [[OnlineEventAttendanceMode]] (or the online aspects, in the case of a [[MixedEventAttendanceMode]]).", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - inLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + inLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="The language of the content or performance or used in an action. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" "[[availableLanguage]].", ) - performer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + performer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A performer at the event—for example, a presenter, musician, musical group" "or actor.", ) - review: Optional[Union[List[Review], Review]] = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - subEvents: Any = Field( + subEvents: Optional[Union[List[Union['Event', str]], Union['Event', str]]] = Field( None, description="Events that are a part of this event. For example, a conference event includes many presentations," "each subEvents of the conference.", ) - eventSchedule: Any = Field( + eventSchedule: Optional[Union[List[Union[Schedule, str]], Union[Schedule, str]]] = Field( None, description="Associates an [[Event]] with a [[Schedule]]. There are circumstances where it is preferable" "to share a schedule for a series of repeating events rather than data on the individual" @@ -205,11 +213,11 @@ class Event(Thing): "any ambiguity for clients using the data. The property might have repeated values to" "specify different schedules, e.g. for different months or seasons.", ) - contributor: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + contributor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A secondary contributor to the CreativeWork or Event.", ) - isAccessibleForFree: Optional[Union[List[StrictBool], StrictBool]] = Field( + isAccessibleForFree: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A flag to signal that the item, event, or place is accessible for free.", ) diff --git a/pydantic_schemaorg/ExchangeRateSpecification.py b/pydantic_schemaorg/ExchangeRateSpecification.py index 189680b0..5c657727 100644 --- a/pydantic_schemaorg/ExchangeRateSpecification.py +++ b/pydantic_schemaorg/ExchangeRateSpecification.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Any, Union from pydantic_schemaorg.UnitPriceSpecification import UnitPriceSpecification from pydantic_schemaorg.StructuredValue import StructuredValue @@ -12,12 +13,12 @@ class ExchangeRateSpecification(StructuredValue): """ type_: str = Field("ExchangeRateSpecification", const=True, alias='@type') - exchangeRateSpread: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + exchangeRateSpread: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The difference between the price at which a broker or other intermediary buys and sells" "foreign currency.", ) - currentExchangeRate: Optional[Union[List[UnitPriceSpecification], UnitPriceSpecification]] = Field( + currentExchangeRate: Optional[Union[List[Union[UnitPriceSpecification, str]], Union[UnitPriceSpecification, str]]] = Field( None, description="The current price of a currency.", ) diff --git a/pydantic_schemaorg/ExerciseAction.py b/pydantic_schemaorg/ExerciseAction.py index 6e7b7af3..62e87777 100644 --- a/pydantic_schemaorg/ExerciseAction.py +++ b/pydantic_schemaorg/ExerciseAction.py @@ -1,9 +1,13 @@ from pydantic import Field from pydantic_schemaorg.ExercisePlan import ExercisePlan -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.Distance import Distance +from pydantic_schemaorg.Diet import Diet from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Place import Place from pydantic_schemaorg.SportsActivityLocation import SportsActivityLocation +from pydantic_schemaorg.SportsEvent import SportsEvent +from pydantic_schemaorg.SportsTeam import SportsTeam from pydantic_schemaorg.PlayAction import PlayAction @@ -15,32 +19,32 @@ class ExerciseAction(PlayAction): """ type_: str = Field("ExerciseAction", const=True, alias='@type') - exercisePlan: Optional[Union[List[ExercisePlan], ExercisePlan]] = Field( + exercisePlan: Optional[Union[List[Union[ExercisePlan, str]], Union[ExercisePlan, str]]] = Field( None, description="A sub property of instrument. The exercise plan used on this action.", ) - distance: Any = Field( + distance: Optional[Union[List[Union[Distance, str]], Union[Distance, str]]] = Field( None, description="The distance travelled, e.g. exercising or travelling.", ) - diet: Any = Field( + diet: Optional[Union[List[Union[Diet, str]], Union[Diet, str]]] = Field( None, description="A sub property of instrument. The diet used in this action.", ) - opponent: Optional[Union[List[Person], Person]] = Field( + opponent: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A sub property of participant. The opponent on this action.", ) - fromLocation: Optional[Union[List[Place], Place]] = Field( + fromLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The original location of the object or the agent before the" "action.", ) - sportsActivityLocation: Optional[Union[List[SportsActivityLocation], SportsActivityLocation]] = Field( + sportsActivityLocation: Optional[Union[List[Union[SportsActivityLocation, str]], Union[SportsActivityLocation, str]]] = Field( None, description="A sub property of location. The sports activity location where this action occurred.", ) - exerciseRelatedDiet: Any = Field( + exerciseRelatedDiet: Optional[Union[List[Union[Diet, str]], Union[Diet, str]]] = Field( None, description="A sub property of instrument. The diet used in this action.", ) @@ -49,23 +53,23 @@ class ExerciseAction(PlayAction): description="Type(s) of exercise or activity, such as strength training, flexibility training," "aerobics, cardiac rehabilitation, etc.", ) - toLocation: Optional[Union[List[Place], Place]] = Field( + toLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The final location of the object or the agent after the action.", ) - sportsEvent: Any = Field( + sportsEvent: Optional[Union[List[Union[SportsEvent, str]], Union[SportsEvent, str]]] = Field( None, description="A sub property of location. The sports event where this action occurred.", ) - course: Optional[Union[List[Place], Place]] = Field( + course: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The course where this action was taken.", ) - exerciseCourse: Optional[Union[List[Place], Place]] = Field( + exerciseCourse: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The course where this action was taken.", ) - sportsTeam: Any = Field( + sportsTeam: Optional[Union[List[Union[SportsTeam, str]], Union[SportsTeam, str]]] = Field( None, description="A sub property of participant. The sports team that participated on this action.", ) diff --git a/pydantic_schemaorg/ExercisePlan.py b/pydantic_schemaorg/ExercisePlan.py index 8830efee..6acb793b 100644 --- a/pydantic_schemaorg/ExercisePlan.py +++ b/pydantic_schemaorg/ExercisePlan.py @@ -1,12 +1,14 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Energy import Energy -from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.PhysicalActivity import PhysicalActivity +from pydantic_schemaorg.CreativeWork import CreativeWork -class ExercisePlan(CreativeWork, PhysicalActivity): +class ExercisePlan(PhysicalActivity, CreativeWork): """Fitness-related activity designed for a specific health-related purpose, including" "defined exercise routines as well as activity prescribed by a clinician. @@ -14,20 +16,20 @@ class ExercisePlan(CreativeWork, PhysicalActivity): """ type_: str = Field("ExercisePlan", const=True, alias='@type') - repetitions: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + repetitions: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="Number of times one should repeat the activity.", ) - restPeriods: Union[List[Union[str, Any]], Union[str, Any]] = Field( + restPeriods: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="How often one should break from the activity.", ) - intensity: Union[List[Union[str, Any]], Union[str, Any]] = Field( + intensity: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="Quantitative measure gauging the degree of force involved in the exercise, for example," "heartbeats per minute. May include the velocity of the movement.", ) - workload: Union[List[Union[Energy, Any]], Union[Energy, Any]] = Field( + workload: Optional[Union[List[Union[Energy, QuantitativeValue, str]], Union[Energy, QuantitativeValue, str]]] = Field( None, description="Quantitative measure of the physiologic output of the exercise; also referred to as" "energy expenditure.", @@ -43,11 +45,11 @@ class ExercisePlan(CreativeWork, PhysicalActivity): description="Type(s) of exercise or activity, such as strength training, flexibility training," "aerobics, cardiac rehabilitation, etc.", ) - activityDuration: Any = Field( + activityDuration: Optional[Union[List[Union[Duration, QuantitativeValue, str]], Union[Duration, QuantitativeValue, str]]] = Field( None, description="Length of time to engage in the activity.", ) - activityFrequency: Union[List[Union[str, Any]], Union[str, Any]] = Field( + activityFrequency: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="How often one should engage in the activity.", ) diff --git a/pydantic_schemaorg/FinancialProduct.py b/pydantic_schemaorg/FinancialProduct.py index 70d05ee4..478fcd42 100644 --- a/pydantic_schemaorg/FinancialProduct.py +++ b/pydantic_schemaorg/FinancialProduct.py @@ -1,6 +1,7 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Service import Service @@ -13,7 +14,7 @@ class FinancialProduct(Service): """ type_: str = Field("FinancialProduct", const=True, alias='@type') - annualPercentageRate: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + annualPercentageRate: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The annual rate that is charged for borrowing (or made by investing), expressed as a single" "percentage number that represents the actual yearly cost of funds over the term of a loan." @@ -24,7 +25,7 @@ class FinancialProduct(Service): description="Description of fees, commissions, and other terms applied either to a class of financial" "product, or by a financial service organization.", ) - interestRate: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + interestRate: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The interest rate, charged or paid, applicable to the financial product. Note: This" "is different from the calculated annualPercentageRate.", diff --git a/pydantic_schemaorg/FinancialService.py b/pydantic_schemaorg/FinancialService.py index e7358f88..fed3fb38 100644 --- a/pydantic_schemaorg/FinancialService.py +++ b/pydantic_schemaorg/FinancialService.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.LocalBusiness import LocalBusiness diff --git a/pydantic_schemaorg/Flight.py b/pydantic_schemaorg/Flight.py index eff89e25..04359241 100644 --- a/pydantic_schemaorg/Flight.py +++ b/pydantic_schemaorg/Flight.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.BoardingPolicyType import BoardingPolicyType +from typing import List, Optional, Union +from pydantic_schemaorg.Distance import Distance from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Duration import Duration @@ -16,11 +18,11 @@ class Flight(Trip): """ type_: str = Field("Flight", const=True, alias='@type') - boardingPolicy: Any = Field( + boardingPolicy: Optional[Union[List[Union[BoardingPolicyType, str]], Union[BoardingPolicyType, str]]] = Field( None, description="The type of boarding policy used by the airline (e.g. zone-based or group-based).", ) - flightDistance: Union[List[Union[str, Any]], Union[str, Any]] = Field( + flightDistance: Optional[Union[List[Union[str, Distance]], Union[str, Distance]]] = Field( None, description="The distance of the flight.", ) @@ -33,7 +35,7 @@ class Flight(Trip): description="The unique identifier for a flight including the airline IATA code. For example, if describing" "United flight 110, where the IATA code for United is 'UA', the flightNumber is 'UA110'.", ) - seller: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + seller: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity which offers (sells / leases / lends / loans) the services / goods. A seller may" "also be a provider.", @@ -46,7 +48,7 @@ class Flight(Trip): None, description="The kind of aircraft (e.g., \"Boeing 747\").", ) - carrier: Optional[Union[List[Organization], Organization]] = Field( + carrier: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="'carrier' is an out-dated term indicating the 'provider' for parcel delivery and flights.", ) @@ -54,7 +56,7 @@ class Flight(Trip): None, description="Identifier of the flight's arrival terminal.", ) - webCheckinTime: Optional[Union[List[datetime], datetime]] = Field( + webCheckinTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The time when a passenger can check into the flight online.", ) @@ -62,7 +64,7 @@ class Flight(Trip): None, description="Identifier of the flight's departure terminal.", ) - departureAirport: Optional[Union[List[Airport], Airport]] = Field( + departureAirport: Optional[Union[List[Union[Airport, str]], Union[Airport, str]]] = Field( None, description="The airport where the flight originates.", ) @@ -74,7 +76,7 @@ class Flight(Trip): None, description="Identifier of the flight's arrival gate.", ) - arrivalAirport: Optional[Union[List[Airport], Airport]] = Field( + arrivalAirport: Optional[Union[List[Union[Airport, str]], Union[Airport, str]]] = Field( None, description="The airport where the flight terminates.", ) diff --git a/pydantic_schemaorg/FlightReservation.py b/pydantic_schemaorg/FlightReservation.py index 14b7558c..9b3a1338 100644 --- a/pydantic_schemaorg/FlightReservation.py +++ b/pydantic_schemaorg/FlightReservation.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.QualitativeValue import QualitativeValue from pydantic_schemaorg.Reservation import Reservation diff --git a/pydantic_schemaorg/FloorPlan.py b/pydantic_schemaorg/FloorPlan.py index d40eeebb..75413b42 100644 --- a/pydantic_schemaorg/FloorPlan.py +++ b/pydantic_schemaorg/FloorPlan.py @@ -1,7 +1,7 @@ -from pydantic import StrictBool, Field, AnyUrl -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic import AnyUrl, Field, StrictBool from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.LocationFeatureSpecification import LocationFeatureSpecification from pydantic_schemaorg.Accommodation import Accommodation @@ -21,65 +21,65 @@ class FloorPlan(Intangible): """ type_: str = Field("FloorPlan", const=True, alias='@type') - numberOfBedrooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfBedrooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The total integer number of bedrooms in a some [[Accommodation]], [[ApartmentComplex]]" "or [[FloorPlan]].", ) - numberOfBathroomsTotal: Optional[Union[List[int], int]] = Field( + numberOfBathroomsTotal: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The total integer number of bathrooms in a some [[Accommodation]], following real estate" "conventions as [documented in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsTotalInteger+Field):" "\"The simple sum of the number of bathrooms. For example for a property with two Full Bathrooms" "and one Half Bathroom, the Bathrooms Total Integer will be 3.\". See also [[numberOfRooms]].", ) - numberOfPartialBathrooms: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfPartialBathrooms: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Number of partial bathrooms - The total number of half and ¼ bathrooms in an [[Accommodation]]." "This corresponds to the [BathroomsPartial field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsPartial+Field).", ) - layoutImage: Optional[Union[List[Union[AnyUrl, ImageObject]], Union[AnyUrl, ImageObject]]] = Field( + layoutImage: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="A schematic image showing the floorplan layout.", ) - amenityFeature: Optional[Union[List[LocationFeatureSpecification], LocationFeatureSpecification]] = Field( + amenityFeature: Optional[Union[List[Union[LocationFeatureSpecification, str]], Union[LocationFeatureSpecification, str]]] = Field( None, description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic" "property does not make a statement about whether the feature is included in an offer for" "the main accommodation or available at extra costs.", ) - numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - numberOfAccommodationUnits: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + numberOfAccommodationUnits: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicates the total (available plus unavailable) number of accommodation units in" "an [[ApartmentComplex]], or the number of accommodation units for a specific [[FloorPlan]]" "(within its specific [[ApartmentComplex]]). See also [[numberOfAvailableAccommodationUnits]].", ) - petsAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( + petsAllowed: Optional[Union[List[Union[str, StrictBool]], Union[str, StrictBool]]] = Field( None, description="Indicates whether pets are allowed to enter the accommodation or lodging business." "More detailed information can be put in a text value.", ) - floorSize: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + floorSize: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The size of the accommodation, e.g. in square meter or squarefoot. Typical unit code(s):" "MTK for square meter, FTK for square foot, or YDK for square yard", ) - isPlanForApartment: Optional[Union[List[Accommodation], Accommodation]] = Field( + isPlanForApartment: Optional[Union[List[Union[Accommodation, str]], Union[Accommodation, str]]] = Field( None, description="Indicates some accommodation that this floor plan describes.", ) - numberOfFullBathrooms: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfFullBathrooms: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Number of full bathrooms - The total number of full and ¾ bathrooms in an [[Accommodation]]." "This corresponds to the [BathroomsFull field in RESO](https://ddwiki.reso.org/display/DDW17/BathroomsFull+Field).", ) - numberOfAvailableAccommodationUnits: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + numberOfAvailableAccommodationUnits: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicates the number of available accommodation units in an [[ApartmentComplex]]," "or the number of accommodation units for a specific [[FloorPlan]] (within its specific" diff --git a/pydantic_schemaorg/FollowAction.py b/pydantic_schemaorg/FollowAction.py index 8e0e9291..b54b9401 100644 --- a/pydantic_schemaorg/FollowAction.py +++ b/pydantic_schemaorg/FollowAction.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.InteractAction import InteractAction @@ -22,7 +22,7 @@ class FollowAction(InteractAction): """ type_: str = Field("FollowAction", const=True, alias='@type') - followee: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + followee: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A sub property of object. The person or organization being followed.", ) diff --git a/pydantic_schemaorg/FoodEstablishment.py b/pydantic_schemaorg/FoodEstablishment.py index 6cb0bf40..46e930de 100644 --- a/pydantic_schemaorg/FoodEstablishment.py +++ b/pydantic_schemaorg/FoodEstablishment.py @@ -1,5 +1,7 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field, StrictBool +from pydantic_schemaorg.Menu import Menu +from typing import List, Optional, Any, Union +from pydantic_schemaorg.Rating import Rating from pydantic_schemaorg.LocalBusiness import LocalBusiness @@ -10,23 +12,23 @@ class FoodEstablishment(LocalBusiness): """ type_: str = Field("FoodEstablishment", const=True, alias='@type') - menu: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + menu: Optional[Union[List[Union[AnyUrl, str, Menu]], Union[AnyUrl, str, Menu]]] = Field( None, description="Either the actual menu as a structured representation, as text, or a URL of the menu.", ) - starRating: Any = Field( + starRating: Optional[Union[List[Union[Rating, str]], Union[Rating, str]]] = Field( None, description="An official rating for a lodging business or food establishment, e.g. from national" "associations or standards bodies. Use the author property to indicate the rating organization," "e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).", ) - acceptsReservations: Optional[Union[List[Union[AnyUrl, StrictBool, str]], Union[AnyUrl, StrictBool, str]]] = Field( + acceptsReservations: Optional[Union[List[Union[AnyUrl, str, StrictBool]], Union[AnyUrl, str, StrictBool]]] = Field( None, description="Indicates whether a FoodEstablishment accepts reservations. Values can be Boolean," "an URL at which reservations can be made or (for backwards compatibility) the strings" "```Yes``` or ```No```.", ) - hasMenu: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + hasMenu: Optional[Union[List[Union[AnyUrl, str, Menu]], Union[AnyUrl, str, Menu]]] = Field( None, description="Either the actual menu as a structured representation, as text, or a URL of the menu.", ) diff --git a/pydantic_schemaorg/FoodEstablishmentReservation.py b/pydantic_schemaorg/FoodEstablishmentReservation.py index d51a53f1..2a91b099 100644 --- a/pydantic_schemaorg/FoodEstablishmentReservation.py +++ b/pydantic_schemaorg/FoodEstablishmentReservation.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime, time from pydantic_schemaorg.Reservation import Reservation @@ -14,11 +14,11 @@ class FoodEstablishmentReservation(Reservation): """ type_: str = Field("FoodEstablishmentReservation", const=True, alias='@type') - partySize: Optional[Union[List[Union[int, QuantitativeValue]], Union[int, QuantitativeValue]]] = Field( + partySize: Optional[Union[List[Union[int, QuantitativeValue, str]], Union[int, QuantitativeValue, str]]] = Field( None, description="Number of people the reservation should accommodate.", ) - endTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + endTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to end. For actions that span a period of time, when the action" @@ -27,7 +27,7 @@ class FoodEstablishmentReservation(Reservation): "Event uses startDate/endDate instead of startTime/endTime, even when describing" "dates with times. This situation may be clarified in future revisions.", ) - startTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + startTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to start. For actions that span a period of time, when the action" diff --git a/pydantic_schemaorg/Game.py b/pydantic_schemaorg/Game.py index 5a711e49..f6fd1e35 100644 --- a/pydantic_schemaorg/Game.py +++ b/pydantic_schemaorg/Game.py @@ -1,7 +1,7 @@ -from pydantic import Field, AnyUrl -from pydantic_schemaorg.Place import Place +from pydantic import AnyUrl, Field from pydantic_schemaorg.PostalAddress import PostalAddress -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Place import Place +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.CreativeWork import CreativeWork @@ -16,26 +16,26 @@ class Game(CreativeWork): """ type_: str = Field("Game", const=True, alias='@type') - gameLocation: Optional[Union[List[Union[AnyUrl, Place, PostalAddress]], Union[AnyUrl, Place, PostalAddress]]] = Field( + gameLocation: Optional[Union[List[Union[AnyUrl, PostalAddress, Place, str]], Union[AnyUrl, PostalAddress, Place, str]]] = Field( None, description="Real or fictional location of the game (or part of game).", ) - characterAttribute: Optional[Union[List[Thing], Thing]] = Field( + characterAttribute: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A piece of data that represents a particular aspect of a fictional character (skill," "power, character points, advantage, disadvantage).", ) - quest: Optional[Union[List[Thing], Thing]] = Field( + quest: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The task that a player-controlled character, or group of characters may complete in" "order to gain a reward.", ) - gameItem: Optional[Union[List[Thing], Thing]] = Field( + gameItem: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="An item is an object within the game world that can be collected by a player or, occasionally," "a non-player character.", ) - numberOfPlayers: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + numberOfPlayers: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicate how many people can play this game (minimum, maximum, or range).", ) diff --git a/pydantic_schemaorg/GameServer.py b/pydantic_schemaorg/GameServer.py index 20a5a3c0..e4f194c3 100644 --- a/pydantic_schemaorg/GameServer.py +++ b/pydantic_schemaorg/GameServer.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.GameServerStatus import GameServerStatus -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.VideoGame import VideoGame from pydantic_schemaorg.Intangible import Intangible @@ -12,15 +12,15 @@ class GameServer(Intangible): """ type_: str = Field("GameServer", const=True, alias='@type') - serverStatus: Optional[Union[List[GameServerStatus], GameServerStatus]] = Field( + serverStatus: Optional[Union[List[Union[GameServerStatus, str]], Union[GameServerStatus, str]]] = Field( None, description="Status of a game server.", ) - playersOnline: Optional[Union[List[int], int]] = Field( + playersOnline: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Number of players on the server.", ) - game: Optional[Union[List[VideoGame], VideoGame]] = Field( + game: Optional[Union[List[Union[VideoGame, str]], Union[VideoGame, str]]] = Field( None, description="Video game which is played on this server.", ) diff --git a/pydantic_schemaorg/Gene.py b/pydantic_schemaorg/Gene.py index a4a336b7..601d3f3c 100644 --- a/pydantic_schemaorg/Gene.py +++ b/pydantic_schemaorg/Gene.py @@ -1,8 +1,8 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.BioChemEntity import BioChemEntity -from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure from pydantic_schemaorg.DefinedTerm import DefinedTerm +from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem @@ -21,15 +21,15 @@ class Gene(BioChemEntity): description="A symbolic representation of a BioChemEnity. For example, a nucleotide sequence of" "a Gene or an amino acid sequence of a Protein.", ) - encodesBioChemEntity: Optional[Union[List[BioChemEntity], BioChemEntity]] = Field( + encodesBioChemEntity: Optional[Union[List[Union[BioChemEntity, str]], Union[BioChemEntity, str]]] = Field( None, description="Another BioChemEntity encoded by this one.", ) - alternativeOf: Any = Field( + alternativeOf: Optional[Union[List[Union['Gene', str]], Union['Gene', str]]] = Field( None, description="Another gene which is a variation of this one.", ) - expressedIn: Optional[Union[List[Union[AnatomicalStructure, DefinedTerm, BioChemEntity, AnatomicalSystem]], Union[AnatomicalStructure, DefinedTerm, BioChemEntity, AnatomicalSystem]]] = Field( + expressedIn: Optional[Union[List[Union[BioChemEntity, DefinedTerm, AnatomicalStructure, AnatomicalSystem, str]], Union[BioChemEntity, DefinedTerm, AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="Tissue, organ, biological sample, etc in which activity of this gene has been observed" "experimentally. For example brain, digestive system.", diff --git a/pydantic_schemaorg/GeoCircle.py b/pydantic_schemaorg/GeoCircle.py index dd775b9c..b31399f8 100644 --- a/pydantic_schemaorg/GeoCircle.py +++ b/pydantic_schemaorg/GeoCircle.py @@ -1,8 +1,8 @@ from pydantic import Field from pydantic_schemaorg.GeoCoordinates import GeoCoordinates -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Distance import Distance +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.Distance import Distance from pydantic_schemaorg.GeoShape import GeoShape @@ -16,7 +16,7 @@ class GeoCircle(GeoShape): """ type_: str = Field("GeoCircle", const=True, alias='@type') - geoMidpoint: Optional[Union[List[GeoCoordinates], GeoCoordinates]] = Field( + geoMidpoint: Optional[Union[List[Union[GeoCoordinates, str]], Union[GeoCoordinates, str]]] = Field( None, description="Indicates the GeoCoordinates at the centre of a GeoShape e.g. GeoCircle.", ) diff --git a/pydantic_schemaorg/GeoCoordinates.py b/pydantic_schemaorg/GeoCoordinates.py index 16b2cb1d..06c41744 100644 --- a/pydantic_schemaorg/GeoCoordinates.py +++ b/pydantic_schemaorg/GeoCoordinates.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Country import Country diff --git a/pydantic_schemaorg/GeoShape.py b/pydantic_schemaorg/GeoShape.py index df874029..2de7adf5 100644 --- a/pydantic_schemaorg/GeoShape.py +++ b/pydantic_schemaorg/GeoShape.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Country import Country diff --git a/pydantic_schemaorg/GeospatialGeometry.py b/pydantic_schemaorg/GeospatialGeometry.py index 811d33ee..ba6f9859 100644 --- a/pydantic_schemaorg/GeospatialGeometry.py +++ b/pydantic_schemaorg/GeospatialGeometry.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -12,7 +12,7 @@ class GeospatialGeometry(Intangible): """ type_: str = Field("GeospatialGeometry", const=True, alias='@type') - geoEquals: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoEquals: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)." @@ -20,55 +20,55 @@ class GeospatialGeometry(Intangible): "the interior or boundary of one geometry intersects the exterior of the other\" (a symmetric" "relationship)", ) - geoDisjoint: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoDisjoint: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "are topologically disjoint: they have no point in common. They form a set of disconnected" "geometries.\" (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))", ) - geoTouches: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoTouches: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "touch: they have at least one boundary point in common, but no interior points.\" (a symmetric" "relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )", ) - geoCovers: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoCovers: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a covering geometry to a covered geometry. \"Every point of b is a point of (the interior" "or boundary of) a\". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoContains: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoContains: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a containing geometry to a contained geometry. \"a contains b iff no points of b lie in" "the exterior of a, and at least one point of the interior of b lies in the interior of a\"." "As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoCoveredBy: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoCoveredBy: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoCrosses: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoCrosses: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that crosses it: \"a crosses b: they have some but not all interior" "points in common, and the dimension of the intersection is less than that of at least one" "of them\". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoWithin: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoWithin: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined" "in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoIntersects: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoIntersects: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoOverlaps: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + geoOverlaps: Optional[Union[List[Union['GeospatialGeometry', Place, str]], Union['GeospatialGeometry', Place, str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that geospatially overlaps it, i.e. they have some but not all points" diff --git a/pydantic_schemaorg/GiveAction.py b/pydantic_schemaorg/GiveAction.py index 2e8b1956..edfcc3ca 100644 --- a/pydantic_schemaorg/GiveAction.py +++ b/pydantic_schemaorg/GiveAction.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.ContactPoint import ContactPoint -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TransferAction import TransferAction @@ -17,7 +17,7 @@ class GiveAction(TransferAction): """ type_: str = Field("GiveAction", const=True, alias='@type') - recipient: Optional[Union[List[Union[Organization, Audience, Person, ContactPoint]], Union[Organization, Audience, Person, ContactPoint]]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/GovernmentService.py b/pydantic_schemaorg/GovernmentService.py index 44edbb0c..6dd2065f 100644 --- a/pydantic_schemaorg/GovernmentService.py +++ b/pydantic_schemaorg/GovernmentService.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.AdministrativeArea import AdministrativeArea -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Service import Service @@ -18,7 +18,7 @@ class GovernmentService(Service): description="Indicates a legal jurisdiction, e.g. of some legislation, or where some government" "service is based.", ) - serviceOperator: Optional[Union[List[Organization], Organization]] = Field( + serviceOperator: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The operating organization, if different from the provider. This enables the representation" "of services that are provided by an organization, but operated by another organization" diff --git a/pydantic_schemaorg/Grant.py b/pydantic_schemaorg/Grant.py index cfc8c397..0ff23142 100644 --- a/pydantic_schemaorg/Grant.py +++ b/pydantic_schemaorg/Grant.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Intangible import Intangible @@ -22,11 +22,11 @@ class Grant(Intangible): """ type_: str = Field("Grant", const=True, alias='@type') - fundedItem: Optional[Union[List[Thing], Thing]] = Field( + fundedItem: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="Indicates an item funded or sponsored through a [[Grant]].", ) - sponsor: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + sponsor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", diff --git a/pydantic_schemaorg/Guide.py b/pydantic_schemaorg/Guide.py index f52f9e15..2f172434 100644 --- a/pydantic_schemaorg/Guide.py +++ b/pydantic_schemaorg/Guide.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/HealthClub.py b/pydantic_schemaorg/HealthClub.py index 1433e41d..9ad43a59 100644 --- a/pydantic_schemaorg/HealthClub.py +++ b/pydantic_schemaorg/HealthClub.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.SportsActivityLocation import SportsActivityLocation from pydantic_schemaorg.HealthAndBeautyBusiness import HealthAndBeautyBusiness +from pydantic_schemaorg.SportsActivityLocation import SportsActivityLocation -class HealthClub(SportsActivityLocation, HealthAndBeautyBusiness): +class HealthClub(HealthAndBeautyBusiness, SportsActivityLocation): """A health club. See https://schema.org/HealthClub. diff --git a/pydantic_schemaorg/HealthInsurancePlan.py b/pydantic_schemaorg/HealthInsurancePlan.py index b44e2b0f..6be72968 100644 --- a/pydantic_schemaorg/HealthInsurancePlan.py +++ b/pydantic_schemaorg/HealthInsurancePlan.py @@ -1,7 +1,8 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.ContactPoint import ContactPoint -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.HealthPlanNetwork import HealthPlanNetwork +from pydantic_schemaorg.HealthPlanFormulary import HealthPlanFormulary from pydantic_schemaorg.Intangible import Intangible @@ -12,7 +13,7 @@ class HealthInsurancePlan(Intangible): """ type_: str = Field("HealthInsurancePlan", const=True, alias='@type') - contactPoint: Optional[Union[List[ContactPoint], ContactPoint]] = Field( + contactPoint: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="A contact point for a person or organization.", ) @@ -20,7 +21,7 @@ class HealthInsurancePlan(Intangible): None, description="TODO.", ) - healthPlanMarketingUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + healthPlanMarketingUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The URL that goes directly to the plan brochure for the specific standard plan or plan" "variation.", @@ -30,7 +31,7 @@ class HealthInsurancePlan(Intangible): description="The standard for interpreting thePlan ID. The preferred is \"HIOS\". See the Centers" "for Medicare & Medicaid Services for more details.", ) - benefitsSummaryUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + benefitsSummaryUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The URL that goes directly to the summary of benefits and coverage for the specific standard" "plan or plan variation.", @@ -40,7 +41,7 @@ class HealthInsurancePlan(Intangible): description="The 14-character, HIOS-generated Plan ID number. (Plan IDs must be unique, even across" "different markets.)", ) - includesHealthPlanNetwork: Optional[Union[List[HealthPlanNetwork], HealthPlanNetwork]] = Field( + includesHealthPlanNetwork: Optional[Union[List[Union[HealthPlanNetwork, str]], Union[HealthPlanNetwork, str]]] = Field( None, description="Networks covered by this plan.", ) @@ -48,7 +49,7 @@ class HealthInsurancePlan(Intangible): None, description="The tier(s) of drugs offered by this formulary or insurance plan.", ) - includesHealthPlanFormulary: Any = Field( + includesHealthPlanFormulary: Optional[Union[List[Union[HealthPlanFormulary, str]], Union[HealthPlanFormulary, str]]] = Field( None, description="Formularies covered by this plan.", ) diff --git a/pydantic_schemaorg/HealthPlanCostSharingSpecification.py b/pydantic_schemaorg/HealthPlanCostSharingSpecification.py index 16bb1147..7d39f92d 100644 --- a/pydantic_schemaorg/HealthPlanCostSharingSpecification.py +++ b/pydantic_schemaorg/HealthPlanCostSharingSpecification.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PriceSpecification import PriceSpecification from decimal import Decimal from pydantic_schemaorg.Intangible import Intangible @@ -21,7 +21,7 @@ class HealthPlanCostSharingSpecification(Intangible): None, description="The category or type of pharmacy associated with this cost sharing.", ) - healthPlanCopay: Optional[Union[List[PriceSpecification], PriceSpecification]] = Field( + healthPlanCopay: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="Whether The copay amount.", ) @@ -29,7 +29,7 @@ class HealthPlanCostSharingSpecification(Intangible): None, description="Whether the copay is before or after deductible, etc. TODO: Is this a closed set?", ) - healthPlanCoinsuranceRate: Optional[Union[List[Decimal], Decimal]] = Field( + healthPlanCoinsuranceRate: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Whether The rate of coinsurance expressed as a number between 0.0 and 1.0.", ) diff --git a/pydantic_schemaorg/HealthPlanFormulary.py b/pydantic_schemaorg/HealthPlanFormulary.py index 6e9911dc..19b0c501 100644 --- a/pydantic_schemaorg/HealthPlanFormulary.py +++ b/pydantic_schemaorg/HealthPlanFormulary.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -11,7 +11,7 @@ class HealthPlanFormulary(Intangible): """ type_: str = Field("HealthPlanFormulary", const=True, alias='@type') - offersPrescriptionByMail: Optional[Union[List[StrictBool], StrictBool]] = Field( + offersPrescriptionByMail: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether prescriptions can be delivered by mail.", ) @@ -19,7 +19,7 @@ class HealthPlanFormulary(Intangible): None, description="The tier(s) of drugs offered by this formulary or insurance plan.", ) - healthPlanCostSharing: Optional[Union[List[StrictBool], StrictBool]] = Field( + healthPlanCostSharing: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether The costs to the patient for services under this network or formulary.", ) diff --git a/pydantic_schemaorg/HealthPlanNetwork.py b/pydantic_schemaorg/HealthPlanNetwork.py index 2347a980..2d7a4224 100644 --- a/pydantic_schemaorg/HealthPlanNetwork.py +++ b/pydantic_schemaorg/HealthPlanNetwork.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -19,7 +19,7 @@ class HealthPlanNetwork(Intangible): description="Name or unique ID of network. (Networks are often reused across different insurance" "plans).", ) - healthPlanCostSharing: Optional[Union[List[StrictBool], StrictBool]] = Field( + healthPlanCostSharing: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether The costs to the patient for services under this network or formulary.", ) diff --git a/pydantic_schemaorg/HealthTopicContent.py b/pydantic_schemaorg/HealthTopicContent.py index 83a29af5..c938f5ce 100644 --- a/pydantic_schemaorg/HealthTopicContent.py +++ b/pydantic_schemaorg/HealthTopicContent.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.HealthAspectEnumeration import HealthAspectEnumeration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.WebContent import WebContent @@ -16,7 +16,7 @@ class HealthTopicContent(WebContent): """ type_: str = Field("HealthTopicContent", const=True, alias='@type') - hasHealthAspect: Optional[Union[List[HealthAspectEnumeration], HealthAspectEnumeration]] = Field( + hasHealthAspect: Optional[Union[List[Union[HealthAspectEnumeration, str]], Union[HealthAspectEnumeration, str]]] = Field( None, description="Indicates the aspect or aspects specifically addressed in some [[HealthTopicContent]]." "For example, that the content is an overview, or that it talks about treatment, self-care," diff --git a/pydantic_schemaorg/Hospital.py b/pydantic_schemaorg/Hospital.py index a2ef4c4a..3831d637 100644 --- a/pydantic_schemaorg/Hospital.py +++ b/pydantic_schemaorg/Hospital.py @@ -1,32 +1,33 @@ from pydantic import Field from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.CDCPMDRecord import CDCPMDRecord from pydantic_schemaorg.Dataset import Dataset -from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalTest import MedicalTest from pydantic_schemaorg.MedicalProcedure import MedicalProcedure +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.CivicStructure import CivicStructure -from pydantic_schemaorg.MedicalOrganization import MedicalOrganization from pydantic_schemaorg.EmergencyService import EmergencyService +from pydantic_schemaorg.MedicalOrganization import MedicalOrganization -class Hospital(CivicStructure, MedicalOrganization, EmergencyService): +class Hospital(CivicStructure, EmergencyService, MedicalOrganization): """A hospital. See https://schema.org/Hospital. """ type_: str = Field("Hospital", const=True, alias='@type') - medicalSpecialty: Optional[Union[List[MedicalSpecialty], MedicalSpecialty]] = Field( + medicalSpecialty: Optional[Union[List[Union[MedicalSpecialty, str]], Union[MedicalSpecialty, str]]] = Field( None, description="A medical specialty of the provider.", ) - healthcareReportingData: Union[List[Union[Dataset, Any]], Union[Dataset, Any]] = Field( + healthcareReportingData: Optional[Union[List[Union[CDCPMDRecord, Dataset, str]], Union[CDCPMDRecord, Dataset, str]]] = Field( None, description="Indicates data describing a hospital, e.g. a CDC [[CDCPMDRecord]] or as some kind of" "[[Dataset]].", ) - availableService: Optional[Union[List[Union[MedicalTherapy, MedicalTest, MedicalProcedure]], Union[MedicalTherapy, MedicalTest, MedicalProcedure]]] = Field( + availableService: Optional[Union[List[Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]], Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]]] = Field( None, description="A medical service available from this provider.", ) diff --git a/pydantic_schemaorg/HotelRoom.py b/pydantic_schemaorg/HotelRoom.py index 205bfa59..f71f6aec 100644 --- a/pydantic_schemaorg/HotelRoom.py +++ b/pydantic_schemaorg/HotelRoom.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.BedDetails import BedDetails -from typing import Any, Optional, Union, List +from pydantic_schemaorg.BedType import BedType +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Room import Room @@ -13,14 +14,14 @@ class HotelRoom(Room): """ type_: str = Field("HotelRoom", const=True, alias='@type') - bed: Union[List[Union[str, BedDetails, Any]], Union[str, BedDetails, Any]] = Field( + bed: Optional[Union[List[Union[str, BedDetails, BedType]], Union[str, BedDetails, BedType]]] = Field( None, description="The type of bed or beds included in the accommodation. For the single case of just one bed" "of a certain type, you use bed directly with a text. If you want to indicate the quantity" "of a certain kind of bed, use an instance of BedDetails. For more detailed information," "use the amenityFeature property.", ) - occupancy: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + occupancy: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The allowed total occupancy for the accommodation in persons (including infants etc)." "For individual accommodations, this is not necessarily the legal maximum but defines" diff --git a/pydantic_schemaorg/House.py b/pydantic_schemaorg/House.py index d59af608..51c92828 100644 --- a/pydantic_schemaorg/House.py +++ b/pydantic_schemaorg/House.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Accommodation import Accommodation @@ -13,7 +13,7 @@ class House(Accommodation): """ type_: str = Field("House", const=True, alias='@type') - numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" diff --git a/pydantic_schemaorg/HowTo.py b/pydantic_schemaorg/HowTo.py index 1fc7435b..d84bf2c8 100644 --- a/pydantic_schemaorg/HowTo.py +++ b/pydantic_schemaorg/HowTo.py @@ -1,10 +1,14 @@ from pydantic import Field from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.Duration import Duration -from pydantic_schemaorg.HowToSection import HowToSection from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.HowToStep import HowToStep +from pydantic_schemaorg.HowToSection import HowToSection +from pydantic_schemaorg.HowToTool import HowToTool from pydantic_schemaorg.ItemList import ItemList +from pydantic_schemaorg.HowToSupply import HowToSupply class HowTo(CreativeWork): @@ -19,30 +23,30 @@ class HowTo(CreativeWork): description="The quantity that results by performing instructions. For example, a paper airplane," "10 personalized candles.", ) - estimatedCost: Union[List[Union[str, Any]], Union[str, Any]] = Field( + estimatedCost: Optional[Union[List[Union[str, MonetaryAmount]], Union[str, MonetaryAmount]]] = Field( None, description="The estimated cost of the supply or supplies consumed when performing instructions.", ) - prepTime: Optional[Union[List[Duration], Duration]] = Field( + prepTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The length of time it takes to prepare the items to be used in instructions or a direction," "in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - step: Union[List[Union[str, HowToSection, CreativeWork, Any]], Union[str, HowToSection, CreativeWork, Any]] = Field( + step: Optional[Union[List[Union[str, CreativeWork, HowToStep, HowToSection]], Union[str, CreativeWork, HowToStep, HowToSection]]] = Field( None, description="A single step item (as HowToStep, text, document, video, etc.) or a HowToSection.", ) - totalTime: Optional[Union[List[Duration], Duration]] = Field( + totalTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The total time required to perform instructions or a direction (including time to prepare" "the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - performTime: Optional[Union[List[Duration], Duration]] = Field( + performTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The length of time it takes to perform instructions or a direction (not including time" "to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - tool: Union[List[Union[str, Any]], Union[str, Any]] = Field( + tool: Optional[Union[List[Union[str, HowToTool]], Union[str, HowToTool]]] = Field( None, description="A sub property of instrument. An object used (but not consumed) when performing instructions" "or a direction.", @@ -52,7 +56,7 @@ class HowTo(CreativeWork): description="A single step item (as HowToStep, text, document, video, etc.) or a HowToSection (originally" "misnamed 'steps'; 'step' is preferred).", ) - supply: Union[List[Union[str, Any]], Union[str, Any]] = Field( + supply: Optional[Union[List[Union[str, HowToSupply]], Union[str, HowToSupply]]] = Field( None, description="A sub-property of instrument. A supply consumed when performing instructions or a direction.", ) diff --git a/pydantic_schemaorg/HowToDirection.py b/pydantic_schemaorg/HowToDirection.py index afd4d431..af4ded63 100644 --- a/pydantic_schemaorg/HowToDirection.py +++ b/pydantic_schemaorg/HowToDirection.py @@ -1,51 +1,53 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.MediaObject import MediaObject -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Duration import Duration -from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.HowToTool import HowToTool +from pydantic_schemaorg.HowToSupply import HowToSupply from pydantic_schemaorg.ListItem import ListItem +from pydantic_schemaorg.CreativeWork import CreativeWork -class HowToDirection(CreativeWork, ListItem): +class HowToDirection(ListItem, CreativeWork): """A direction indicating a single action to do in the instructions for how to achieve a result. See https://schema.org/HowToDirection. """ type_: str = Field("HowToDirection", const=True, alias='@type') - duringMedia: Optional[Union[List[Union[AnyUrl, MediaObject]], Union[AnyUrl, MediaObject]]] = Field( + duringMedia: Optional[Union[List[Union[AnyUrl, MediaObject, str]], Union[AnyUrl, MediaObject, str]]] = Field( None, description="A media object representing the circumstances while performing this direction.", ) - beforeMedia: Optional[Union[List[Union[AnyUrl, MediaObject]], Union[AnyUrl, MediaObject]]] = Field( + beforeMedia: Optional[Union[List[Union[AnyUrl, MediaObject, str]], Union[AnyUrl, MediaObject, str]]] = Field( None, description="A media object representing the circumstances before performing this direction.", ) - prepTime: Optional[Union[List[Duration], Duration]] = Field( + prepTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The length of time it takes to prepare the items to be used in instructions or a direction," "in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - totalTime: Optional[Union[List[Duration], Duration]] = Field( + totalTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The total time required to perform instructions or a direction (including time to prepare" "the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - performTime: Optional[Union[List[Duration], Duration]] = Field( + performTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The length of time it takes to perform instructions or a direction (not including time" "to prepare the supplies), in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) - tool: Union[List[Union[str, Any]], Union[str, Any]] = Field( + tool: Optional[Union[List[Union[str, HowToTool]], Union[str, HowToTool]]] = Field( None, description="A sub property of instrument. An object used (but not consumed) when performing instructions" "or a direction.", ) - afterMedia: Optional[Union[List[Union[AnyUrl, MediaObject]], Union[AnyUrl, MediaObject]]] = Field( + afterMedia: Optional[Union[List[Union[AnyUrl, MediaObject, str]], Union[AnyUrl, MediaObject, str]]] = Field( None, description="A media object representing the circumstances after performing this direction.", ) - supply: Union[List[Union[str, Any]], Union[str, Any]] = Field( + supply: Optional[Union[List[Union[str, HowToSupply]], Union[str, HowToSupply]]] = Field( None, description="A sub-property of instrument. A supply consumed when performing instructions or a direction.", ) diff --git a/pydantic_schemaorg/HowToItem.py b/pydantic_schemaorg/HowToItem.py index 0b9ac876..35b9796e 100644 --- a/pydantic_schemaorg/HowToItem.py +++ b/pydantic_schemaorg/HowToItem.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.ListItem import ListItem diff --git a/pydantic_schemaorg/HowToSection.py b/pydantic_schemaorg/HowToSection.py index 5c416e31..d9643e1f 100644 --- a/pydantic_schemaorg/HowToSection.py +++ b/pydantic_schemaorg/HowToSection.py @@ -1,11 +1,11 @@ from pydantic import Field from pydantic_schemaorg.ItemList import ItemList from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.ListItem import ListItem -class HowToSection(CreativeWork, ListItem, ItemList): +class HowToSection(ItemList, ListItem, CreativeWork): """A sub-grouping of steps in the instructions for how to achieve a result (e.g. steps for" "making a pie crust within a pie recipe). diff --git a/pydantic_schemaorg/HowToStep.py b/pydantic_schemaorg/HowToStep.py index 0be6f742..337822ce 100644 --- a/pydantic_schemaorg/HowToStep.py +++ b/pydantic_schemaorg/HowToStep.py @@ -1,10 +1,10 @@ from pydantic import Field -from pydantic_schemaorg.CreativeWork import CreativeWork -from pydantic_schemaorg.ListItem import ListItem from pydantic_schemaorg.ItemList import ItemList +from pydantic_schemaorg.ListItem import ListItem +from pydantic_schemaorg.CreativeWork import CreativeWork -class HowToStep(CreativeWork, ListItem, ItemList): +class HowToStep(ItemList, ListItem, CreativeWork): """A step in the instructions for how to achieve a result. It is an ordered list with HowToDirection" "and/or HowToTip items. diff --git a/pydantic_schemaorg/HowToSupply.py b/pydantic_schemaorg/HowToSupply.py index 261f0737..8b5a2de8 100644 --- a/pydantic_schemaorg/HowToSupply.py +++ b/pydantic_schemaorg/HowToSupply.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Union from pydantic_schemaorg.HowToItem import HowToItem @@ -10,7 +11,7 @@ class HowToSupply(HowToItem): """ type_: str = Field("HowToSupply", const=True, alias='@type') - estimatedCost: Union[List[Union[str, Any]], Union[str, Any]] = Field( + estimatedCost: Optional[Union[List[Union[str, MonetaryAmount]], Union[str, MonetaryAmount]]] = Field( None, description="The estimated cost of the supply or supplies consumed when performing instructions.", ) diff --git a/pydantic_schemaorg/HowToTip.py b/pydantic_schemaorg/HowToTip.py index cab93e1c..99d57151 100644 --- a/pydantic_schemaorg/HowToTip.py +++ b/pydantic_schemaorg/HowToTip.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.CreativeWork import CreativeWork from pydantic_schemaorg.ListItem import ListItem +from pydantic_schemaorg.CreativeWork import CreativeWork -class HowToTip(CreativeWork, ListItem): +class HowToTip(ListItem, CreativeWork): """An explanation in the instructions for how to achieve a result. It provides supplementary" "information about a technique, supply, author's preference, etc. It can explain what" "could be done, or what should not be done, but doesn't specify what should be done (see" diff --git a/pydantic_schemaorg/HyperToc.py b/pydantic_schemaorg/HyperToc.py index 9de0704c..2d5c5385 100644 --- a/pydantic_schemaorg/HyperToc.py +++ b/pydantic_schemaorg/HyperToc.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MediaObject import MediaObject -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.HyperTocEntry import HyperTocEntry from pydantic_schemaorg.CreativeWork import CreativeWork @@ -16,11 +16,11 @@ class HyperToc(CreativeWork): """ type_: str = Field("HyperToc", const=True, alias='@type') - associatedMedia: Optional[Union[List[MediaObject], MediaObject]] = Field( + associatedMedia: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="A media object that encodes this CreativeWork. This property is a synonym for encoding.", ) - tocEntry: Optional[Union[List[HyperTocEntry], HyperTocEntry]] = Field( + tocEntry: Optional[Union[List[Union[HyperTocEntry, str]], Union[HyperTocEntry, str]]] = Field( None, description="Indicates a [[HyperTocEntry]] in a [[HyperToc]].", ) diff --git a/pydantic_schemaorg/HyperTocEntry.py b/pydantic_schemaorg/HyperTocEntry.py index aa64458d..9f29723d 100644 --- a/pydantic_schemaorg/HyperTocEntry.py +++ b/pydantic_schemaorg/HyperTocEntry.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MediaObject import MediaObject from pydantic_schemaorg.CreativeWork import CreativeWork @@ -22,12 +22,12 @@ class HyperTocEntry(CreativeWork): description="Text of an utterances (spoken words, lyrics etc.) that occurs at a certain section of" "a media object, represented as a [[HyperTocEntry]].", ) - tocContinuation: Any = Field( + tocContinuation: Optional[Union[List[Union['HyperTocEntry', str]], Union['HyperTocEntry', str]]] = Field( None, description="A [[HyperTocEntry]] can have a [[tocContinuation]] indicated, which is another [[HyperTocEntry]]" "that would be the default next item to play or render.", ) - associatedMedia: Optional[Union[List[MediaObject], MediaObject]] = Field( + associatedMedia: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="A media object that encodes this CreativeWork. This property is a synonym for encoding.", ) diff --git a/pydantic_schemaorg/ImageObject.py b/pydantic_schemaorg/ImageObject.py index d894d052..10e2e6bb 100644 --- a/pydantic_schemaorg/ImageObject.py +++ b/pydantic_schemaorg/ImageObject.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PropertyValue import PropertyValue from pydantic_schemaorg.MediaObject import MediaObject @@ -11,7 +11,7 @@ class ImageObject(MediaObject): """ type_: str = Field("ImageObject", const=True, alias='@type') - thumbnail: Any = Field( + thumbnail: Optional[Union[List[Union['ImageObject', str]], Union['ImageObject', str]]] = Field( None, description="Thumbnail image for an image or video.", ) @@ -19,7 +19,7 @@ class ImageObject(MediaObject): None, description="Represents textual captioning from a [[MediaObject]], e.g. text of a 'meme'.", ) - representativeOfPage: Optional[Union[List[StrictBool], StrictBool]] = Field( + representativeOfPage: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether this image is representative of the content of the page.", ) diff --git a/pydantic_schemaorg/ImagingTest.py b/pydantic_schemaorg/ImagingTest.py index 715814fa..e40d9078 100644 --- a/pydantic_schemaorg/ImagingTest.py +++ b/pydantic_schemaorg/ImagingTest.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalImagingTechnique import MedicalImagingTechnique -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalTest import MedicalTest @@ -11,7 +11,7 @@ class ImagingTest(MedicalTest): """ type_: str = Field("ImagingTest", const=True, alias='@type') - imagingTechnique: Optional[Union[List[MedicalImagingTechnique], MedicalImagingTechnique]] = Field( + imagingTechnique: Optional[Union[List[Union[MedicalImagingTechnique, str]], Union[MedicalImagingTechnique, str]]] = Field( None, description="Imaging technique used.", ) diff --git a/pydantic_schemaorg/IndividualProduct.py b/pydantic_schemaorg/IndividualProduct.py index 2c5f82b5..3a547ea5 100644 --- a/pydantic_schemaorg/IndividualProduct.py +++ b/pydantic_schemaorg/IndividualProduct.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Product import Product diff --git a/pydantic_schemaorg/InfectiousDisease.py b/pydantic_schemaorg/InfectiousDisease.py index b048ddcb..cd745d23 100644 --- a/pydantic_schemaorg/InfectiousDisease.py +++ b/pydantic_schemaorg/InfectiousDisease.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.InfectiousAgentClass import InfectiousAgentClass from pydantic_schemaorg.MedicalCondition import MedicalCondition @@ -22,7 +23,7 @@ class InfectiousDisease(MedicalCondition): None, description="The actual infectious agent, such as a specific bacterium.", ) - infectiousAgentClass: Any = Field( + infectiousAgentClass: Optional[Union[List[Union[InfectiousAgentClass, str]], Union[InfectiousAgentClass, str]]] = Field( None, description="The class of infectious agent (bacteria, prion, etc.) that causes the disease.", ) diff --git a/pydantic_schemaorg/InformAction.py b/pydantic_schemaorg/InformAction.py index 17f7222c..22827d37 100644 --- a/pydantic_schemaorg/InformAction.py +++ b/pydantic_schemaorg/InformAction.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Event import Event +from typing import List, Optional, Union from pydantic_schemaorg.CommunicateAction import CommunicateAction @@ -11,7 +12,7 @@ class InformAction(CommunicateAction): """ type_: str = Field("InformAction", const=True, alias='@type') - event: Any = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) diff --git a/pydantic_schemaorg/InsertAction.py b/pydantic_schemaorg/InsertAction.py index b0d01f7b..ed3a9480 100644 --- a/pydantic_schemaorg/InsertAction.py +++ b/pydantic_schemaorg/InsertAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AddAction import AddAction @@ -11,7 +11,7 @@ class InsertAction(AddAction): """ type_: str = Field("InsertAction", const=True, alias='@type') - toLocation: Optional[Union[List[Place], Place]] = Field( + toLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The final location of the object or the agent after the action.", ) diff --git a/pydantic_schemaorg/InteractionCounter.py b/pydantic_schemaorg/InteractionCounter.py index 21f66556..fc843f73 100644 --- a/pydantic_schemaorg/InteractionCounter.py +++ b/pydantic_schemaorg/InteractionCounter.py @@ -1,9 +1,12 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Action import Action +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.VirtualLocation import VirtualLocation from pydantic_schemaorg.Place import Place from datetime import datetime, time from pydantic_schemaorg.SoftwareApplication import SoftwareApplication +from pydantic_schemaorg.WebSite import WebSite from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,21 +18,21 @@ class InteractionCounter(StructuredValue): """ type_: str = Field("InteractionCounter", const=True, alias='@type') - userInteractionCount: Optional[Union[List[int], int]] = Field( + userInteractionCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication.", ) - interactionType: Optional[Union[List[Action], Action]] = Field( + interactionType: Optional[Union[List[Union[Action, str]], Union[Action, str]]] = Field( None, description="The Action representing the type of interaction. For up votes, +1s, etc. use [[LikeAction]]." "For down votes use [[DislikeAction]]. Otherwise, use the most specific Action.", ) - location: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + location: Optional[Union[List[Union[str, PostalAddress, VirtualLocation, Place]], Union[str, PostalAddress, VirtualLocation, Place]]] = Field( None, description="The location of, for example, where an event is happening, where an organization is located," "or where an action takes place.", ) - endTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + endTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to end. For actions that span a period of time, when the action" @@ -38,11 +41,11 @@ class InteractionCounter(StructuredValue): "Event uses startDate/endDate instead of startTime/endTime, even when describing" "dates with times. This situation may be clarified in future revisions.", ) - interactionService: Union[List[Union[SoftwareApplication, Any]], Union[SoftwareApplication, Any]] = Field( + interactionService: Optional[Union[List[Union[SoftwareApplication, WebSite, str]], Union[SoftwareApplication, WebSite, str]]] = Field( None, description="The WebSite or SoftwareApplication where the interactions took place.", ) - startTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + startTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to start. For actions that span a period of time, when the action" diff --git a/pydantic_schemaorg/InvestmentOrDeposit.py b/pydantic_schemaorg/InvestmentOrDeposit.py index 8a2a9f86..f2812a53 100644 --- a/pydantic_schemaorg/InvestmentOrDeposit.py +++ b/pydantic_schemaorg/InvestmentOrDeposit.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Union from pydantic_schemaorg.FinancialProduct import FinancialProduct @@ -12,7 +13,7 @@ class InvestmentOrDeposit(FinancialProduct): """ type_: str = Field("InvestmentOrDeposit", const=True, alias='@type') - amount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + amount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The amount of money.", ) diff --git a/pydantic_schemaorg/InviteAction.py b/pydantic_schemaorg/InviteAction.py index f66640c4..bb8ca63f 100644 --- a/pydantic_schemaorg/InviteAction.py +++ b/pydantic_schemaorg/InviteAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Event import Event -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CommunicateAction import CommunicateAction @@ -11,7 +11,7 @@ class InviteAction(CommunicateAction): """ type_: str = Field("InviteAction", const=True, alias='@type') - event: Optional[Union[List[Event], Event]] = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) diff --git a/pydantic_schemaorg/Invoice.py b/pydantic_schemaorg/Invoice.py index 842083e9..b6121b82 100644 --- a/pydantic_schemaorg/Invoice.py +++ b/pydantic_schemaorg/Invoice.py @@ -1,13 +1,14 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from datetime import datetime, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Duration import Duration -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory from pydantic_schemaorg.PaymentStatusType import PaymentStatusType from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.Order import Order from pydantic_schemaorg.PaymentMethod import PaymentMethod from pydantic_schemaorg.Intangible import Intangible @@ -20,7 +21,7 @@ class Invoice(Intangible): """ type_: str = Field("Invoice", const=True, alias='@type') - paymentDue: Optional[Union[List[datetime], datetime]] = Field( + paymentDue: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date that payment is due.", ) @@ -32,11 +33,11 @@ class Invoice(Intangible): None, description="The identifier for the account the payment will be applied to.", ) - billingPeriod: Optional[Union[List[Duration], Duration]] = Field( + billingPeriod: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The time interval used to compute the invoice.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", @@ -45,23 +46,23 @@ class Invoice(Intangible): None, description="The status of payment; whether the invoice has been paid or not.", ) - customer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + customer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Party placing the order or paying the invoice.", ) - totalPaymentDue: Union[List[Union[PriceSpecification, Any]], Union[PriceSpecification, Any]] = Field( + totalPaymentDue: Optional[Union[List[Union[PriceSpecification, MonetaryAmount, str]], Union[PriceSpecification, MonetaryAmount, str]]] = Field( None, description="The total amount due.", ) - paymentDueDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + paymentDueDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date that payment is due.", ) - scheduledPaymentDate: Optional[Union[List[date], date]] = Field( + scheduledPaymentDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date the invoice is scheduled to be paid.", ) - referencesOrder: Optional[Union[List[Order], Order]] = Field( + referencesOrder: Optional[Union[List[Union[Order, str]], Union[Order, str]]] = Field( None, description="The Order(s) related to this Invoice. One or more Orders may be combined into a single" "Invoice.", @@ -70,21 +71,21 @@ class Invoice(Intangible): None, description="A number that confirms the given order or payment has been received.", ) - minimumPaymentDue: Union[List[Union[PriceSpecification, Any]], Union[PriceSpecification, Any]] = Field( + minimumPaymentDue: Optional[Union[List[Union[PriceSpecification, MonetaryAmount, str]], Union[PriceSpecification, MonetaryAmount, str]]] = Field( None, description="The minimum payment required at this time.", ) - provider: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." "A provider may also serve as the seller.", ) - paymentMethod: Optional[Union[List[PaymentMethod], PaymentMethod]] = Field( + paymentMethod: Optional[Union[List[Union[PaymentMethod, str]], Union[PaymentMethod, str]]] = Field( None, description="The name of the credit card or other method of payment for the order.", ) - broker: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + broker: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity that arranges for an exchange between a buyer and a seller. In most cases a broker" "never acquires or releases ownership of a product or service involved in an exchange." diff --git a/pydantic_schemaorg/ItemList.py b/pydantic_schemaorg/ItemList.py index 924be68f..72dff603 100644 --- a/pydantic_schemaorg/ItemList.py +++ b/pydantic_schemaorg/ItemList.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from pydantic_schemaorg.ListItem import ListItem +from typing import List, Optional, Union from pydantic_schemaorg.ItemListOrderType import ItemListOrderType from pydantic_schemaorg.Intangible import Intangible @@ -13,7 +14,7 @@ class ItemList(Intangible): """ type_: str = Field("ItemList", const=True, alias='@type') - itemListElement: Union[List[Union[str, Thing, Any]], Union[str, Thing, Any]] = Field( + itemListElement: Optional[Union[List[Union[str, Thing, ListItem]], Union[str, Thing, ListItem]]] = Field( None, description="For itemListElement values, you can use simple strings (e.g. \"Peter\", \"Paul\"," "\"Mary\"), existing entities, or use ListItem. Text values are best if the elements" @@ -24,7 +25,7 @@ class ItemList(Intangible): "for indicating the order or elements. Use ListItem with a 'position' property in such" "cases.", ) - numberOfItems: Optional[Union[List[int], int]] = Field( + numberOfItems: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of items in an ItemList. Note that some descriptions might not fully describe" "all items in a list (e.g., multi-page pagination); in such cases, the numberOfItems" diff --git a/pydantic_schemaorg/JobPosting.py b/pydantic_schemaorg/JobPosting.py index 3ac7024e..1a732a45 100644 --- a/pydantic_schemaorg/JobPosting.py +++ b/pydantic_schemaorg/JobPosting.py @@ -1,16 +1,19 @@ -from pydantic import StrictBool, Field, AnyUrl +from pydantic import AnyUrl, StrictBool, Field from pydantic_schemaorg.OccupationalExperienceRequirements import OccupationalExperienceRequirements -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.DefinedTerm import DefinedTerm -from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution from decimal import Decimal +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution from pydantic_schemaorg.Place import Place from datetime import datetime, date from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential from pydantic_schemaorg.PriceSpecification import PriceSpecification from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from pydantic_schemaorg.CategoryCode import CategoryCode +from pydantic_schemaorg.ContactPoint import ContactPoint +from pydantic_schemaorg.Occupation import Occupation from pydantic_schemaorg.Intangible import Intangible @@ -25,11 +28,11 @@ class JobPosting(Intangible): None, description="Description of skills and experience needed for the position or Occupation.", ) - hiringOrganization: Optional[Union[List[Organization], Organization]] = Field( + hiringOrganization: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="Organization offering the job position.", ) - directApply: Optional[Union[List[StrictBool], StrictBool]] = Field( + directApply: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether an [[url]] that is associated with a [[JobPosting]] enables direct" "application for the job, via the posting website. A job posting is considered to have" @@ -44,7 +47,7 @@ class JobPosting(Intangible): description="A statement of knowledge, skill, ability, task or any other assertion expressing a competency" "that is desired or required to fulfill this role or to work in this occupation.", ) - estimatedSalary: Union[List[Union[Decimal, MonetaryAmountDistribution, Any]], Union[Decimal, MonetaryAmountDistribution, Any]] = Field( + estimatedSalary: Optional[Union[List[Union[Decimal, MonetaryAmount, MonetaryAmountDistribution, str]], Union[Decimal, MonetaryAmount, MonetaryAmountDistribution, str]]] = Field( None, description="An estimated salary for a job posting or occupation, based on a variety of variables including," "but not limited to industry, job title, and location. Estimated salaries are often computed" @@ -62,7 +65,7 @@ class JobPosting(Intangible): "that there is no way to specify the level of ability as well as its nature when using a defined" "term.", ) - jobImmediateStart: Optional[Union[List[StrictBool], StrictBool]] = Field( + jobImmediateStart: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="An indicator as to whether a position is available for an immediate start.", ) @@ -72,7 +75,7 @@ class JobPosting(Intangible): "such as those in O*net may be used, but note that there is no way to specify the level of ability" "as well as its nature when using a defined term.", ) - jobLocation: Optional[Union[List[Place], Place]] = Field( + jobLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A (typically single) geographic location associated with the job position.", ) @@ -97,7 +100,7 @@ class JobPosting(Intangible): None, description="The title of the job.", ) - totalJobOpenings: Optional[Union[List[int], int]] = Field( + totalJobOpenings: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of positions open for this job posting. Use a positive integer. Do not use if" "the number of positions is unclear or not known.", @@ -115,7 +118,7 @@ class JobPosting(Intangible): None, description="A description of any security clearance requirements of the job.", ) - datePosted: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + datePosted: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Publication date of an online listing.", ) @@ -137,16 +140,16 @@ class JobPosting(Intangible): None, description="The industry associated with the job position.", ) - employmentUnit: Optional[Union[List[Organization], Organization]] = Field( + employmentUnit: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="Indicates the department, unit and/or facility where the employee reports and/or in" "which the job is to be performed.", ) - baseSalary: Union[List[Union[Decimal, PriceSpecification, Any]], Union[Decimal, PriceSpecification, Any]] = Field( + baseSalary: Optional[Union[List[Union[Decimal, PriceSpecification, MonetaryAmount, str]], Union[Decimal, PriceSpecification, MonetaryAmount, str]]] = Field( None, description="The base salary of the job or of an employee in an EmployeeRole.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", @@ -155,7 +158,7 @@ class JobPosting(Intangible): None, description="The typical working hours for this job (e.g. 1st shift, night shift, 8am-5pm).", ) - experienceInPlaceOfEducation: Optional[Union[List[StrictBool], StrictBool]] = Field( + experienceInPlaceOfEducation: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether a [[JobPosting]] will accept experience (as indicated by [[OccupationalExperienceRequirements]])" "in place of its formal educational qualifications (as indicated by [[educationRequirements]])." @@ -165,7 +168,7 @@ class JobPosting(Intangible): None, description="Description of benefits associated with the job.", ) - applicantLocationRequirements: Optional[Union[List[AdministrativeArea], AdministrativeArea]] = Field( + applicantLocationRequirements: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The location(s) applicants can apply from. This is usually used for telecommuting jobs" "where the applicant does not need to be in a physical office. Note: This should not be used" @@ -188,11 +191,11 @@ class JobPosting(Intangible): None, description="Educational background needed for the position or Occupation.", ) - applicationContact: Any = Field( + applicationContact: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="Contact details for further information relevant to this job posting.", ) - relevantOccupation: Any = Field( + relevantOccupation: Optional[Union[List[Union[Occupation, str]], Union[Occupation, str]]] = Field( None, description="The Occupation for the JobPosting.", ) diff --git a/pydantic_schemaorg/JoinAction.py b/pydantic_schemaorg/JoinAction.py index 05ce0f99..e280ff39 100644 --- a/pydantic_schemaorg/JoinAction.py +++ b/pydantic_schemaorg/JoinAction.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Event import Event +from typing import List, Optional, Union from pydantic_schemaorg.InteractAction import InteractAction @@ -14,7 +15,7 @@ class JoinAction(InteractAction): """ type_: str = Field("JoinAction", const=True, alias='@type') - event: Any = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) diff --git a/pydantic_schemaorg/Joint.py b/pydantic_schemaorg/Joint.py index 570f3fd1..316a022d 100644 --- a/pydantic_schemaorg/Joint.py +++ b/pydantic_schemaorg/Joint.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalEntity import MedicalEntity -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure diff --git a/pydantic_schemaorg/LearningResource.py b/pydantic_schemaorg/LearningResource.py index 1947985a..23f16b50 100644 --- a/pydantic_schemaorg/LearningResource.py +++ b/pydantic_schemaorg/LearningResource.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.AlignmentObject import AlignmentObject -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTerm import DefinedTerm from pydantic_schemaorg.CreativeWork import CreativeWork @@ -18,7 +18,7 @@ class LearningResource(CreativeWork): """ type_: str = Field("LearningResource", const=True, alias='@type') - educationalAlignment: Optional[Union[List[AlignmentObject], AlignmentObject]] = Field( + educationalAlignment: Optional[Union[List[Union[AlignmentObject, str]], Union[AlignmentObject, str]]] = Field( None, description="An alignment to an established educational framework. This property should not be used" "where the nature of the alignment can be described using a simple property, for example" diff --git a/pydantic_schemaorg/LeaveAction.py b/pydantic_schemaorg/LeaveAction.py index 4f4531e3..0e8cc291 100644 --- a/pydantic_schemaorg/LeaveAction.py +++ b/pydantic_schemaorg/LeaveAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Event import Event -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.InteractAction import InteractAction @@ -13,7 +13,7 @@ class LeaveAction(InteractAction): """ type_: str = Field("LeaveAction", const=True, alias='@type') - event: Optional[Union[List[Event], Event]] = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) diff --git a/pydantic_schemaorg/Legislation.py b/pydantic_schemaorg/Legislation.py index 7339ab7f..456c69d8 100644 --- a/pydantic_schemaorg/Legislation.py +++ b/pydantic_schemaorg/Legislation.py @@ -1,7 +1,7 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import date from pydantic_schemaorg.LegalForceStatus import LegalForceStatus from pydantic_schemaorg.AdministrativeArea import AdministrativeArea @@ -17,20 +17,20 @@ class Legislation(CreativeWork): """ type_: str = Field("Legislation", const=True, alias='@type') - legislationPassedBy: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + legislationPassedBy: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization that originally passed or made the law : typically parliament" "(for primary legislation) or government (for secondary legislation). This indicates" "the \"legal author\" of the law, as opposed to its physical author.", ) - legislationConsolidates: Any = Field( + legislationConsolidates: Optional[Union[List[Union['Legislation', str]], Union['Legislation', str]]] = Field( None, description="Indicates another legislation taken into account in this consolidated legislation" "(which is usually the product of an editorial process that revises the legislation)." "This property should be used multiple times to refer to both the original version or the" "previous consolidated version, and to the legislations making the change.", ) - legislationChanges: Any = Field( + legislationChanges: Optional[Union[List[Union['Legislation', str]], Union['Legislation', str]]] = Field( None, description="Another legislation that this legislation changes. This encompasses the notions of" "amendment, replacement, correction, repeal, or other types of change. This may be a" @@ -40,13 +40,13 @@ class Legislation(CreativeWork): "of the change. For consolidation relationships, use the legislationConsolidates" "property.", ) - legislationDate: Optional[Union[List[date], date]] = Field( + legislationDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date of adoption or signature of the legislation. This is the date at which the text" "is officially aknowledged to be a legislation, even though it might not even be published" "or in force.", ) - legislationLegalForce: Optional[Union[List[LegalForceStatus], LegalForceStatus]] = Field( + legislationLegalForce: Optional[Union[List[Union[LegalForceStatus, str]], Union[LegalForceStatus, str]]] = Field( None, description="Whether the legislation is currently in force, not in force, or partially in force.", ) @@ -56,7 +56,7 @@ class Legislation(CreativeWork): "the CELEX at EU level or the NOR in France, or a web-based, URL/URI identifier, like an" "ELI (European Legislation Identifier) or an URN-Lex.", ) - legislationTransposes: Any = Field( + legislationTransposes: Optional[Union[List[Union['Legislation', str]], Union['Legislation', str]]] = Field( None, description="Indicates that this legislation (or part of legislation) fulfills the objectives set" "by another legislation, by passing appropriate implementation measures. Typically," @@ -68,7 +68,7 @@ class Legislation(CreativeWork): description="Indicates a legal jurisdiction, e.g. of some legislation, or where some government" "service is based.", ) - legislationResponsible: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + legislationResponsible: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An individual or organization that has some kind of responsibility for the legislation." "Typically the ministry who is/was in charge of elaborating the legislation, or the adressee" @@ -84,7 +84,7 @@ class Legislation(CreativeWork): "\"decree\", \"regulation\", \"statutory instrument\", \"loi organique\", \"règlement" "grand-ducal\", etc., depending on the country.", ) - legislationApplies: Any = Field( + legislationApplies: Optional[Union[List[Union['Legislation', str]], Union['Legislation', str]]] = Field( None, description="Indicates that this legislation (or part of a legislation) somehow transfers another" "legislation in a different legislative context. This is an informative link, and it" @@ -93,7 +93,7 @@ class Legislation(CreativeWork): "state \"applies\" the consolidated version of the European Directive implemented" "in it.", ) - legislationDateVersion: Optional[Union[List[date], date]] = Field( + legislationDateVersion: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The point-in-time at which the provided description of the legislation is valid (e.g." ": when looking at the law on the 2016-04-07 (= dateVersion), I get the consolidation of" diff --git a/pydantic_schemaorg/LegislationObject.py b/pydantic_schemaorg/LegislationObject.py index 53b49def..9df63492 100644 --- a/pydantic_schemaorg/LegislationObject.py +++ b/pydantic_schemaorg/LegislationObject.py @@ -1,11 +1,11 @@ from pydantic import Field from pydantic_schemaorg.LegalValueLevel import LegalValueLevel -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Legislation import Legislation +from typing import List, Optional, Union from pydantic_schemaorg.MediaObject import MediaObject +from pydantic_schemaorg.Legislation import Legislation -class LegislationObject(Legislation, MediaObject): +class LegislationObject(MediaObject, Legislation): """A specific object or file containing a Legislation. Note that the same Legislation can" "be published in multiple files. For example, a digitally signed PDF, a plain PDF and an" "HTML version. @@ -14,7 +14,7 @@ class LegislationObject(Legislation, MediaObject): """ type_: str = Field("LegislationObject", const=True, alias='@type') - legislationLegalValue: Optional[Union[List[LegalValueLevel], LegalValueLevel]] = Field( + legislationLegalValue: Optional[Union[List[Union[LegalValueLevel, str]], Union[LegalValueLevel, str]]] = Field( None, description="The legal value of this legislation file. The same legislation can be written in multiple" "files with different legal values. Typically a digitally signed PDF have a \"stronger\"" diff --git a/pydantic_schemaorg/LendAction.py b/pydantic_schemaorg/LendAction.py index 2eb0483b..0b60153b 100644 --- a/pydantic_schemaorg/LendAction.py +++ b/pydantic_schemaorg/LendAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TransferAction import TransferAction @@ -12,7 +12,7 @@ class LendAction(TransferAction): """ type_: str = Field("LendAction", const=True, alias='@type') - borrower: Optional[Union[List[Person], Person]] = Field( + borrower: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A sub property of participant. The person that borrows the object being lent.", ) diff --git a/pydantic_schemaorg/LinkRole.py b/pydantic_schemaorg/LinkRole.py index 66e2e6ee..a4c2d865 100644 --- a/pydantic_schemaorg/LinkRole.py +++ b/pydantic_schemaorg/LinkRole.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Role import Role diff --git a/pydantic_schemaorg/ListItem.py b/pydantic_schemaorg/ListItem.py index 54368ecb..9bee6f46 100644 --- a/pydantic_schemaorg/ListItem.py +++ b/pydantic_schemaorg/ListItem.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.Intangible import Intangible @@ -15,15 +15,15 @@ class ListItem(Intangible): None, description="The position of an item in a series or sequence of items.", ) - nextItem: Any = Field( + nextItem: Optional[Union[List[Union['ListItem', str]], Union['ListItem', str]]] = Field( None, description="A link to the ListItem that follows the current one.", ) - previousItem: Any = Field( + previousItem: Optional[Union[List[Union['ListItem', str]], Union['ListItem', str]]] = Field( None, description="A link to the ListItem that preceeds the current one.", ) - item: Optional[Union[List[Thing], Thing]] = Field( + item: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="An entity represented by an entry in a list or data feed (e.g. an 'artist' in a list of 'artists')’.", ) diff --git a/pydantic_schemaorg/LiveBlogPosting.py b/pydantic_schemaorg/LiveBlogPosting.py index 750c1978..c15807ba 100644 --- a/pydantic_schemaorg/LiveBlogPosting.py +++ b/pydantic_schemaorg/LiveBlogPosting.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.BlogPosting import BlogPosting @@ -12,16 +12,16 @@ class LiveBlogPosting(BlogPosting): """ type_: str = Field("LiveBlogPosting", const=True, alias='@type') - coverageEndTime: Optional[Union[List[datetime], datetime]] = Field( + coverageEndTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The time when the live blog will stop covering the Event. Note that coverage may continue" "after the Event concludes.", ) - liveBlogUpdate: Optional[Union[List[BlogPosting], BlogPosting]] = Field( + liveBlogUpdate: Optional[Union[List[Union[BlogPosting, str]], Union[BlogPosting, str]]] = Field( None, description="An update to the LiveBlog.", ) - coverageStartTime: Optional[Union[List[datetime], datetime]] = Field( + coverageStartTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The time when the live blog will begin covering the Event. Note that coverage may begin" "before the Event's start time. The LiveBlogPosting may also be created before coverage" diff --git a/pydantic_schemaorg/LoanOrCredit.py b/pydantic_schemaorg/LoanOrCredit.py index 2e7aa4a1..396d91ae 100644 --- a/pydantic_schemaorg/LoanOrCredit.py +++ b/pydantic_schemaorg/LoanOrCredit.py @@ -1,7 +1,9 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, StrictBool, Field +from pydantic_schemaorg.RepaymentSpecification import RepaymentSpecification +from typing import List, Optional, Any, Union from pydantic_schemaorg.Thing import Thing from decimal import Decimal +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.FinancialProduct import FinancialProduct @@ -15,7 +17,7 @@ class LoanOrCredit(FinancialProduct): """ type_: str = Field("LoanOrCredit", const=True, alias='@type') - loanRepaymentForm: Any = Field( + loanRepaymentForm: Optional[Union[List[Union[RepaymentSpecification, str]], Union[RepaymentSpecification, str]]] = Field( None, description="A form of paying back money previously borrowed from a lender. Repayment usually takes" "the form of periodic payments that normally include part principal plus interest in" @@ -26,7 +28,7 @@ class LoanOrCredit(FinancialProduct): description="Assets required to secure loan or credit repayments. It may take form of third party pledge," "goods, financial instruments (cash, securities, etc.)", ) - renegotiableLoan: Optional[Union[List[StrictBool], StrictBool]] = Field( + renegotiableLoan: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether the terms for payment of interest can be renegotiated during the life of the loan.", ) @@ -34,21 +36,21 @@ class LoanOrCredit(FinancialProduct): None, description="The type of a loan or credit.", ) - amount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + amount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The amount of money.", ) - recourseLoan: Optional[Union[List[StrictBool], StrictBool]] = Field( + recourseLoan: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="The only way you get the money back in the event of default is the security. Recourse is" "where you still have the opportunity to go back to the borrower for the rest of the money.", ) - gracePeriod: Optional[Union[List[Duration], Duration]] = Field( + gracePeriod: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The period of time after any due date that the borrower has to fulfil its obligations before" "a default (failure to pay) is deemed to have occurred.", ) - loanTerm: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + loanTerm: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The duration of the loan or credit agreement.", ) diff --git a/pydantic_schemaorg/LocalBusiness.py b/pydantic_schemaorg/LocalBusiness.py index f0d092ec..018a303e 100644 --- a/pydantic_schemaorg/LocalBusiness.py +++ b/pydantic_schemaorg/LocalBusiness.py @@ -1,10 +1,10 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Place import Place -class LocalBusiness(Place, Organization): +class LocalBusiness(Organization, Place): """A particular physical business or branch of an organization. Examples of LocalBusiness" "include a restaurant, a particular branch of a restaurant chain, a branch of a bank, a" "medical practice, a club, a bowling alley, etc. @@ -30,7 +30,7 @@ class LocalBusiness(Place, Organization): "it can be specified as <time itemprop="openingHours" datetime="Mo-Su">Monday" "through Sunday, all day</time>.", ) - branchOf: Optional[Union[List[Organization], Organization]] = Field( + branchOf: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The larger organization that this local business is a branch of, if any. Not to be confused" "with (anatomical)[[branch]].", diff --git a/pydantic_schemaorg/LocationFeatureSpecification.py b/pydantic_schemaorg/LocationFeatureSpecification.py index b867a86e..307dcece 100644 --- a/pydantic_schemaorg/LocationFeatureSpecification.py +++ b/pydantic_schemaorg/LocationFeatureSpecification.py @@ -1,6 +1,7 @@ from pydantic import Field from datetime import datetime, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.OpeningHoursSpecification import OpeningHoursSpecification from pydantic_schemaorg.PropertyValue import PropertyValue @@ -12,16 +13,16 @@ class LocationFeatureSpecification(PropertyValue): """ type_: str = Field("LocationFeatureSpecification", const=True, alias='@type') - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", ) - hoursAvailable: Any = Field( + hoursAvailable: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="The hours during which this service or contact is available.", ) diff --git a/pydantic_schemaorg/LodgingBusiness.py b/pydantic_schemaorg/LodgingBusiness.py index a7030856..bdad4fc7 100644 --- a/pydantic_schemaorg/LodgingBusiness.py +++ b/pydantic_schemaorg/LodgingBusiness.py @@ -1,7 +1,12 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.LocationFeatureSpecification import LocationFeatureSpecification +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.Rating import Rating from datetime import datetime, time +from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.LocalBusiness import LocalBusiness @@ -12,44 +17,44 @@ class LodgingBusiness(LocalBusiness): """ type_: str = Field("LodgingBusiness", const=True, alias='@type') - amenityFeature: Any = Field( + amenityFeature: Optional[Union[List[Union[LocationFeatureSpecification, str]], Union[LocationFeatureSpecification, str]]] = Field( None, description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic" "property does not make a statement about whether the feature is included in an offer for" "the main accommodation or available at extra costs.", ) - numberOfRooms: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - starRating: Any = Field( + starRating: Optional[Union[List[Union[Rating, str]], Union[Rating, str]]] = Field( None, description="An official rating for a lodging business or food establishment, e.g. from national" "associations or standards bodies. Use the author property to indicate the rating organization," "e.g. as an Organization with name such as (e.g. HOTREC, DEHOGA, WHR, or Hotelstars).", ) - checkinTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + checkinTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The earliest someone may check into a lodging establishment.", ) - petsAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( + petsAllowed: Optional[Union[List[Union[str, StrictBool]], Union[str, StrictBool]]] = Field( None, description="Indicates whether pets are allowed to enter the accommodation or lodging business." "More detailed information can be put in a text value.", ) - audience: Any = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) - availableLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + availableLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="A language someone may use with or at the item, service or place. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" "[[inLanguage]]", ) - checkoutTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + checkoutTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The latest someone may check out of a lodging establishment.", ) diff --git a/pydantic_schemaorg/LodgingReservation.py b/pydantic_schemaorg/LodgingReservation.py index ea6b6ff7..4e6ecde2 100644 --- a/pydantic_schemaorg/LodgingReservation.py +++ b/pydantic_schemaorg/LodgingReservation.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from datetime import datetime, time from pydantic_schemaorg.QualitativeValue import QualitativeValue @@ -19,19 +19,19 @@ class LodgingReservation(Reservation): None, description="A full description of the lodging unit.", ) - numChildren: Optional[Union[List[Union[int, QuantitativeValue]], Union[int, QuantitativeValue]]] = Field( + numChildren: Optional[Union[List[Union[int, QuantitativeValue, str]], Union[int, QuantitativeValue, str]]] = Field( None, description="The number of children staying in the unit.", ) - checkinTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + checkinTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The earliest someone may check into a lodging establishment.", ) - numAdults: Optional[Union[List[Union[int, QuantitativeValue]], Union[int, QuantitativeValue]]] = Field( + numAdults: Optional[Union[List[Union[int, QuantitativeValue, str]], Union[int, QuantitativeValue, str]]] = Field( None, description="The number of adults staying in the unit.", ) - checkoutTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + checkoutTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The latest someone may check out of a lodging establishment.", ) diff --git a/pydantic_schemaorg/LoseAction.py b/pydantic_schemaorg/LoseAction.py index 37b3105a..5bed566e 100644 --- a/pydantic_schemaorg/LoseAction.py +++ b/pydantic_schemaorg/LoseAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AchieveAction import AchieveAction @@ -11,7 +11,7 @@ class LoseAction(AchieveAction): """ type_: str = Field("LoseAction", const=True, alias='@type') - winner: Optional[Union[List[Person], Person]] = Field( + winner: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A sub property of participant. The winner of the action.", ) diff --git a/pydantic_schemaorg/LymphaticVessel.py b/pydantic_schemaorg/LymphaticVessel.py index 2968921d..4f671bec 100644 --- a/pydantic_schemaorg/LymphaticVessel.py +++ b/pydantic_schemaorg/LymphaticVessel.py @@ -1,7 +1,8 @@ from pydantic import Field from pydantic_schemaorg.Vessel import Vessel -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem class LymphaticVessel(Vessel): @@ -12,15 +13,15 @@ class LymphaticVessel(Vessel): """ type_: str = Field("LymphaticVessel", const=True, alias='@type') - originatesFrom: Optional[Union[List[Vessel], Vessel]] = Field( + originatesFrom: Optional[Union[List[Union[Vessel, str]], Union[Vessel, str]]] = Field( None, description="The vasculature the lymphatic structure originates, or afferents, from.", ) - runsTo: Optional[Union[List[Vessel], Vessel]] = Field( + runsTo: Optional[Union[List[Union[Vessel, str]], Union[Vessel, str]]] = Field( None, description="The vasculature the lymphatic structure runs, or efferents, to.", ) - regionDrained: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + regionDrained: Optional[Union[List[Union[AnatomicalStructure, AnatomicalSystem, str]], Union[AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="The anatomical or organ system drained by this vessel; generally refers to a specific" "part of an organ.", diff --git a/pydantic_schemaorg/Map.py b/pydantic_schemaorg/Map.py index 3f0857f2..f0c29788 100644 --- a/pydantic_schemaorg/Map.py +++ b/pydantic_schemaorg/Map.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MapCategoryType import MapCategoryType -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -11,7 +11,7 @@ class Map(CreativeWork): """ type_: str = Field("Map", const=True, alias='@type') - mapType: Optional[Union[List[MapCategoryType], MapCategoryType]] = Field( + mapType: Optional[Union[List[Union[MapCategoryType, str]], Union[MapCategoryType, str]]] = Field( None, description="Indicates the kind of Map, from the MapCategoryType Enumeration.", ) diff --git a/pydantic_schemaorg/MathSolver.py b/pydantic_schemaorg/MathSolver.py index 2d6cc430..77ef8f64 100644 --- a/pydantic_schemaorg/MathSolver.py +++ b/pydantic_schemaorg/MathSolver.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.SolveMathAction import SolveMathAction +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -10,7 +11,7 @@ class MathSolver(CreativeWork): """ type_: str = Field("MathSolver", const=True, alias='@type') - mathExpression: Union[List[Union[str, Any]], Union[str, Any]] = Field( + mathExpression: Optional[Union[List[Union[str, SolveMathAction]], Union[str, SolveMathAction]]] = Field( None, description="A mathematical expression (e.g. 'x^2-3x=0') that may be solved for a specific variable," "simplified, or transformed. This can take many formats, e.g. LaTeX, Ascii-Math, or" diff --git a/pydantic_schemaorg/MediaObject.py b/pydantic_schemaorg/MediaObject.py index 395678b2..60ca5fdd 100644 --- a/pydantic_schemaorg/MediaObject.py +++ b/pydantic_schemaorg/MediaObject.py @@ -1,10 +1,16 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field, StrictBool +from typing import List, Optional, Union +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.MediaSubscription import MediaSubscription from datetime import datetime, time, date +from pydantic_schemaorg.Distance import Distance +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.CreativeWork import CreativeWork from pydantic_schemaorg.NewsArticle import NewsArticle +from pydantic_schemaorg.Claim import Claim +from pydantic_schemaorg.GeoShape import GeoShape class MediaObject(CreativeWork): @@ -21,38 +27,38 @@ class MediaObject(CreativeWork): None, description="The bitrate of the media object.", ) - contentUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + contentUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Actual bytes of the media object, for example the image file or video file.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - regionsAllowed: Optional[Union[List[Place], Place]] = Field( + regionsAllowed: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The regions where the media is allowed. If not specified, then it's assumed to be allowed" "everywhere. Specify the countries in [ISO 3166 format](http://en.wikipedia.org/wiki/ISO_3166).", ) - requiresSubscription: Union[List[Union[StrictBool, Any]], Union[StrictBool, Any]] = Field( + requiresSubscription: Optional[Union[List[Union[StrictBool, MediaSubscription, str]], Union[StrictBool, MediaSubscription, str]]] = Field( None, description="Indicates if use of the media require a subscription (either paid or free). Allowed values" "are ```true``` or ```false``` (note that an earlier version had 'yes', 'no').", ) - uploadDate: Optional[Union[List[date], date]] = Field( + uploadDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date when this media object was uploaded to this site.", ) - height: Any = Field( + height: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The height of the item.", ) - endTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + endTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to end. For actions that span a period of time, when the action" @@ -66,19 +72,19 @@ class MediaObject(CreativeWork): description="The [SHA-2](https://en.wikipedia.org/wiki/SHA-2) SHA256 hash of the content of" "the item. For example, a zero-length input has value 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'", ) - encodesCreativeWork: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + encodesCreativeWork: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="The CreativeWork encoded by this media object.", ) - associatedArticle: Optional[Union[List[NewsArticle], NewsArticle]] = Field( + associatedArticle: Optional[Union[List[Union[NewsArticle, str]], Union[NewsArticle, str]]] = Field( None, description="A NewsArticle associated with the Media Object.", ) - width: Any = Field( + width: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The width of the item.", ) - embedUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + embedUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A URL pointing to a player for a specific video. In general, this is the information in" "the ```src``` element of an ```embed``` tag and should not be the same as the content of" @@ -94,13 +100,13 @@ class MediaObject(CreativeWork): "information. Unregistered or niche encoding and file formats can be indicated instead" "via the most appropriate URL, e.g. defining Web page or a Wikipedia/Wikidata entry.", ) - interpretedAsClaim: Any = Field( + interpretedAsClaim: Optional[Union[List[Union[Claim, str]], Union[Claim, str]]] = Field( None, description="Used to indicate a specific claim contained, implied, translated or refined from the" "content of a [[MediaObject]] or other [[CreativeWork]]. The interpreting party can" "be indicated using [[claimInterpreter]].", ) - startTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + startTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to start. For actions that span a period of time, when the action" @@ -117,7 +123,7 @@ class MediaObject(CreativeWork): None, description="Player type required—for example, Flash or Silverlight.", ) - ineligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + ineligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" diff --git a/pydantic_schemaorg/MediaReview.py b/pydantic_schemaorg/MediaReview.py index 26dc6996..169aa426 100644 --- a/pydantic_schemaorg/MediaReview.py +++ b/pydantic_schemaorg/MediaReview.py @@ -1,5 +1,8 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.MediaObject import MediaObject +from pydantic_schemaorg.WebPage import WebPage +from typing import List, Optional, Any, Union +from pydantic_schemaorg.MediaManipulationRatingEnumeration import MediaManipulationRatingEnumeration from pydantic_schemaorg.Review import Review @@ -18,12 +21,12 @@ class MediaReview(Review): """ type_: str = Field("MediaReview", const=True, alias='@type') - originalMediaLink: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + originalMediaLink: Optional[Union[List[Union[AnyUrl, MediaObject, WebPage, str]], Union[AnyUrl, MediaObject, WebPage, str]]] = Field( None, description="Link to the page containing an original version of the content, or directly to an online" "copy of the original [[MediaObject]] content, e.g. video file.", ) - mediaAuthenticityCategory: Any = Field( + mediaAuthenticityCategory: Optional[Union[List[Union[MediaManipulationRatingEnumeration, str]], Union[MediaManipulationRatingEnumeration, str]]] = Field( None, description="Indicates a MediaManipulationRatingEnumeration classification of a media object" "(in the context of how it was published or shared).", diff --git a/pydantic_schemaorg/MediaReviewItem.py b/pydantic_schemaorg/MediaReviewItem.py index b7189d2c..0c8cc356 100644 --- a/pydantic_schemaorg/MediaReviewItem.py +++ b/pydantic_schemaorg/MediaReviewItem.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MediaObject import MediaObject +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,7 +13,7 @@ class MediaReviewItem(CreativeWork): """ type_: str = Field("MediaReviewItem", const=True, alias='@type') - mediaItemAppearance: Any = Field( + mediaItemAppearance: Optional[Union[List[Union[MediaObject, str]], Union[MediaObject, str]]] = Field( None, description="In the context of a [[MediaReview]], indicates specific media item(s) that are grouped" "using a [[MediaReviewItem]].", diff --git a/pydantic_schemaorg/MediaSubscription.py b/pydantic_schemaorg/MediaSubscription.py index a2e99bec..1f5fed87 100644 --- a/pydantic_schemaorg/MediaSubscription.py +++ b/pydantic_schemaorg/MediaSubscription.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Offer import Offer -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Intangible import Intangible @@ -12,12 +12,12 @@ class MediaSubscription(Intangible): """ type_: str = Field("MediaSubscription", const=True, alias='@type') - expectsAcceptanceOf: Optional[Union[List[Offer], Offer]] = Field( + expectsAcceptanceOf: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="An Offer which must be accepted before the user can perform the Action. For example, the" "user may need to buy a movie before being able to watch it.", ) - authenticator: Optional[Union[List[Organization], Organization]] = Field( + authenticator: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The Organization responsible for authenticating the user's subscription. For example," "many media apps require a cable/satellite provider to authenticate your subscription" diff --git a/pydantic_schemaorg/MedicalAudience.py b/pydantic_schemaorg/MedicalAudience.py index f8ed5214..9bdc8ed1 100644 --- a/pydantic_schemaorg/MedicalAudience.py +++ b/pydantic_schemaorg/MedicalAudience.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.PeopleAudience import PeopleAudience from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.PeopleAudience import PeopleAudience -class MedicalAudience(PeopleAudience, Audience): +class MedicalAudience(Audience, PeopleAudience): """Target audiences for medical web pages. See https://schema.org/MedicalAudience. diff --git a/pydantic_schemaorg/MedicalCause.py b/pydantic_schemaorg/MedicalCause.py index 522f4db6..735f82b4 100644 --- a/pydantic_schemaorg/MedicalCause.py +++ b/pydantic_schemaorg/MedicalCause.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalEntity import MedicalEntity -from typing import Any, Optional, Union, List +from typing import List, Optional, Union class MedicalCause(MedicalEntity): @@ -22,7 +22,7 @@ class MedicalCause(MedicalEntity): """ type_: str = Field("MedicalCause", const=True, alias='@type') - causeOf: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + causeOf: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="The condition, complication, symptom, sign, etc. caused.", ) diff --git a/pydantic_schemaorg/MedicalClinic.py b/pydantic_schemaorg/MedicalClinic.py index 113504a7..94037b80 100644 --- a/pydantic_schemaorg/MedicalClinic.py +++ b/pydantic_schemaorg/MedicalClinic.py @@ -1,9 +1,9 @@ from pydantic import Field from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty -from typing import Any, Optional, Union, List -from pydantic_schemaorg.MedicalTherapy import MedicalTherapy +from typing import List, Optional, Union from pydantic_schemaorg.MedicalTest import MedicalTest from pydantic_schemaorg.MedicalProcedure import MedicalProcedure +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalBusiness import MedicalBusiness from pydantic_schemaorg.MedicalOrganization import MedicalOrganization @@ -17,11 +17,11 @@ class MedicalClinic(MedicalBusiness, MedicalOrganization): """ type_: str = Field("MedicalClinic", const=True, alias='@type') - medicalSpecialty: Optional[Union[List[MedicalSpecialty], MedicalSpecialty]] = Field( + medicalSpecialty: Optional[Union[List[Union[MedicalSpecialty, str]], Union[MedicalSpecialty, str]]] = Field( None, description="A medical specialty of the provider.", ) - availableService: Optional[Union[List[Union[MedicalTherapy, MedicalTest, MedicalProcedure]], Union[MedicalTherapy, MedicalTest, MedicalProcedure]]] = Field( + availableService: Optional[Union[List[Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]], Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]]] = Field( None, description="A medical service available from this provider.", ) diff --git a/pydantic_schemaorg/MedicalCode.py b/pydantic_schemaorg/MedicalCode.py index 0c465e26..2b9fa1f4 100644 --- a/pydantic_schemaorg/MedicalCode.py +++ b/pydantic_schemaorg/MedicalCode.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CategoryCode import CategoryCode from pydantic_schemaorg.MedicalIntangible import MedicalIntangible diff --git a/pydantic_schemaorg/MedicalCondition.py b/pydantic_schemaorg/MedicalCondition.py index 061923cc..7486af6c 100644 --- a/pydantic_schemaorg/MedicalCondition.py +++ b/pydantic_schemaorg/MedicalCondition.py @@ -1,10 +1,17 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalTest import MedicalTest +from pydantic_schemaorg.MedicalRiskFactor import MedicalRiskFactor +from pydantic_schemaorg.MedicalConditionStage import MedicalConditionStage +from pydantic_schemaorg.DDxElement import DDxElement from pydantic_schemaorg.MedicalTherapy import MedicalTherapy -from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus from pydantic_schemaorg.EventStatusType import EventStatusType +from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus +from pydantic_schemaorg.Drug import Drug +from pydantic_schemaorg.SuperficialAnatomy import SuperficialAnatomy from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem +from pydantic_schemaorg.MedicalSignOrSymptom import MedicalSignOrSymptom from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -21,16 +28,16 @@ class MedicalCondition(MedicalEntity): None, description="The characteristics of associated patients, such as age, gender, race etc.", ) - typicalTest: Optional[Union[List[MedicalTest], MedicalTest]] = Field( + typicalTest: Optional[Union[List[Union[MedicalTest, str]], Union[MedicalTest, str]]] = Field( None, description="A medical test typically performed given this condition.", ) - riskFactor: Any = Field( + riskFactor: Optional[Union[List[Union[MedicalRiskFactor, str]], Union[MedicalRiskFactor, str]]] = Field( None, description="A modifiable or non-modifiable factor that increases the risk of a patient contracting" "this condition, e.g. age, coexisting condition.", ) - stage: Any = Field( + stage: Optional[Union[List[Union[MedicalConditionStage, str]], Union[MedicalConditionStage, str]]] = Field( None, description="The stage of the condition, if applicable.", ) @@ -43,7 +50,7 @@ class MedicalCondition(MedicalEntity): None, description="The likely outcome in either the short term or long term of the medical condition.", ) - differentialDiagnosis: Any = Field( + differentialDiagnosis: Optional[Union[List[Union[DDxElement, str]], Union[DDxElement, str]]] = Field( None, description="One of a set of differential diagnoses for the condition. Specifically, a closely-related" "or competing diagnosis typically considered later in the cognitive process whereby" @@ -51,16 +58,16 @@ class MedicalCondition(MedicalEntity): "collection of signs and symptoms to reach the most parsimonious diagnosis or diagnoses" "in a patient.", ) - primaryPrevention: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + primaryPrevention: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A preventative therapy used to prevent an initial occurrence of the medical condition," "such as vaccination.", ) - possibleTreatment: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + possibleTreatment: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A possible treatment to address this condition, sign or symptom.", ) - status: Optional[Union[List[Union[str, MedicalStudyStatus, EventStatusType]], Union[str, MedicalStudyStatus, EventStatusType]]] = Field( + status: Optional[Union[List[Union[str, EventStatusType, MedicalStudyStatus]], Union[str, EventStatusType, MedicalStudyStatus]]] = Field( None, description="The status of the study (enumerated).", ) @@ -69,12 +76,12 @@ class MedicalCondition(MedicalEntity): description="Changes in the normal mechanical, physical, and biochemical functions that are associated" "with this activity or condition.", ) - secondaryPrevention: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + secondaryPrevention: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A preventative therapy used to prevent reoccurrence of the medical condition after" "an initial episode of the condition.", ) - drug: Any = Field( + drug: Optional[Union[List[Union[Drug, str]], Union[Drug, str]]] = Field( None, description="Specifying a drug or medicine used in a medication procedure.", ) @@ -84,11 +91,11 @@ class MedicalCondition(MedicalEntity): "may include worsening of the signs or symptoms of the disease, extension of the condition" "to other organ systems, etc.", ) - associatedAnatomy: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + associatedAnatomy: Optional[Union[List[Union[SuperficialAnatomy, AnatomicalStructure, AnatomicalSystem, str]], Union[SuperficialAnatomy, AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="The anatomy of the underlying organ system or structures associated with this entity.", ) - signOrSymptom: Any = Field( + signOrSymptom: Optional[Union[List[Union[MedicalSignOrSymptom, str]], Union[MedicalSignOrSymptom, str]]] = Field( None, description="A sign or symptom of this condition. Signs are objective or physically observable manifestations" "of the medical condition while symptoms are the subjective experience of the medical" diff --git a/pydantic_schemaorg/MedicalConditionStage.py b/pydantic_schemaorg/MedicalConditionStage.py index fbef5141..f9793247 100644 --- a/pydantic_schemaorg/MedicalConditionStage.py +++ b/pydantic_schemaorg/MedicalConditionStage.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalIntangible import MedicalIntangible @@ -11,7 +11,7 @@ class MedicalConditionStage(MedicalIntangible): """ type_: str = Field("MedicalConditionStage", const=True, alias='@type') - stageAsNumber: Optional[Union[List[Decimal], Decimal]] = Field( + stageAsNumber: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The stage represented as a number, e.g. 3.", ) diff --git a/pydantic_schemaorg/MedicalDevice.py b/pydantic_schemaorg/MedicalDevice.py index 291a6850..9315af7b 100644 --- a/pydantic_schemaorg/MedicalDevice.py +++ b/pydantic_schemaorg/MedicalDevice.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEntity import MedicalEntity from pydantic_schemaorg.MedicalContraindication import MedicalContraindication @@ -20,7 +20,7 @@ class MedicalDevice(MedicalEntity): description="A description of the workup, testing, and other preparations required before implanting" "this device.", ) - seriousAdverseOutcome: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + seriousAdverseOutcome: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="A possible serious complication and/or serious side effect of this therapy. Serious" "adverse outcomes include those that are life-threatening; result in death, disability," @@ -33,7 +33,7 @@ class MedicalDevice(MedicalEntity): description="A description of the procedure involved in setting up, using, and/or installing the" "device.", ) - adverseOutcome: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + adverseOutcome: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="A possible complication and/or side effect of this therapy. If it is known that an adverse" "outcome is serious (resulting in death, disability, or permanent damage; requiring" diff --git a/pydantic_schemaorg/MedicalEntity.py b/pydantic_schemaorg/MedicalEntity.py index c675ea06..91367ec9 100644 --- a/pydantic_schemaorg/MedicalEntity.py +++ b/pydantic_schemaorg/MedicalEntity.py @@ -1,8 +1,12 @@ from pydantic import Field from pydantic_schemaorg.MedicineSystem import MedicineSystem -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MedicalGuideline import MedicalGuideline +from pydantic_schemaorg.MedicalStudy import MedicalStudy from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.MedicalCode import MedicalCode +from pydantic_schemaorg.DrugLegalStatus import DrugLegalStatus from pydantic_schemaorg.MedicalEnumeration import MedicalEnumeration from pydantic_schemaorg.Thing import Thing @@ -14,34 +18,34 @@ class MedicalEntity(Thing): """ type_: str = Field("MedicalEntity", const=True, alias='@type') - medicineSystem: Optional[Union[List[MedicineSystem], MedicineSystem]] = Field( + medicineSystem: Optional[Union[List[Union[MedicineSystem, str]], Union[MedicineSystem, str]]] = Field( None, description="The system of medicine that includes this MedicalEntity, for example 'evidence-based'," "'homeopathic', 'chiropractic', etc.", ) - guideline: Any = Field( + guideline: Optional[Union[List[Union[MedicalGuideline, str]], Union[MedicalGuideline, str]]] = Field( None, description="A medical guideline related to this entity.", ) - study: Any = Field( + study: Optional[Union[List[Union[MedicalStudy, str]], Union[MedicalStudy, str]]] = Field( None, description="A medical study or trial related to this entity.", ) - relevantSpecialty: Optional[Union[List[MedicalSpecialty], MedicalSpecialty]] = Field( + relevantSpecialty: Optional[Union[List[Union[MedicalSpecialty, str]], Union[MedicalSpecialty, str]]] = Field( None, description="If applicable, a medical specialty in which this entity is relevant.", ) - recognizingAuthority: Optional[Union[List[Organization], Organization]] = Field( + recognizingAuthority: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="If applicable, the organization that officially recognizes this entity as part of its" "endorsed system of medicine.", ) - code: Any = Field( + code: Optional[Union[List[Union[MedicalCode, str]], Union[MedicalCode, str]]] = Field( None, description="A medical code for the entity, taken from a controlled vocabulary or ontology such as" "ICD-9, DiseasesDB, MeSH, SNOMED-CT, RxNorm, etc.", ) - legalStatus: Union[List[Union[str, MedicalEnumeration, Any]], Union[str, MedicalEnumeration, Any]] = Field( + legalStatus: Optional[Union[List[Union[str, DrugLegalStatus, MedicalEnumeration]], Union[str, DrugLegalStatus, MedicalEnumeration]]] = Field( None, description="The drug or supplement's legal status, including any controlled substance schedules" "that apply.", diff --git a/pydantic_schemaorg/MedicalGuideline.py b/pydantic_schemaorg/MedicalGuideline.py index 96212bee..f1ad59da 100644 --- a/pydantic_schemaorg/MedicalGuideline.py +++ b/pydantic_schemaorg/MedicalGuideline.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEvidenceLevel import MedicalEvidenceLevel from datetime import date from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -21,15 +21,15 @@ class MedicalGuideline(MedicalEntity): None, description="Source of the data used to formulate the guidance, e.g. RCT, consensus opinion, etc.", ) - evidenceLevel: Optional[Union[List[MedicalEvidenceLevel], MedicalEvidenceLevel]] = Field( + evidenceLevel: Optional[Union[List[Union[MedicalEvidenceLevel, str]], Union[MedicalEvidenceLevel, str]]] = Field( None, description="Strength of evidence of the data used to formulate the guideline (enumerated).", ) - guidelineDate: Optional[Union[List[date], date]] = Field( + guidelineDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date on which this guideline's recommendation was made.", ) - guidelineSubject: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + guidelineSubject: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="The medical conditions, treatments, etc. that are the subject of the guideline.", ) diff --git a/pydantic_schemaorg/MedicalGuidelineRecommendation.py b/pydantic_schemaorg/MedicalGuidelineRecommendation.py index eac75e74..e3d43173 100644 --- a/pydantic_schemaorg/MedicalGuidelineRecommendation.py +++ b/pydantic_schemaorg/MedicalGuidelineRecommendation.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalGuideline import MedicalGuideline diff --git a/pydantic_schemaorg/MedicalObservationalStudy.py b/pydantic_schemaorg/MedicalObservationalStudy.py index 6954e7da..aaefa53d 100644 --- a/pydantic_schemaorg/MedicalObservationalStudy.py +++ b/pydantic_schemaorg/MedicalObservationalStudy.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MedicalObservationalStudyDesign import MedicalObservationalStudyDesign +from typing import List, Optional, Union from pydantic_schemaorg.MedicalStudy import MedicalStudy @@ -16,7 +17,7 @@ class MedicalObservationalStudy(MedicalStudy): """ type_: str = Field("MedicalObservationalStudy", const=True, alias='@type') - studyDesign: Any = Field( + studyDesign: Optional[Union[List[Union[MedicalObservationalStudyDesign, str]], Union[MedicalObservationalStudyDesign, str]]] = Field( None, description="Specifics about the observational study design (enumerated).", ) diff --git a/pydantic_schemaorg/MedicalOrganization.py b/pydantic_schemaorg/MedicalOrganization.py index 2ddc2f58..b324e5cb 100644 --- a/pydantic_schemaorg/MedicalOrganization.py +++ b/pydantic_schemaorg/MedicalOrganization.py @@ -1,6 +1,6 @@ from pydantic import StrictBool, Field from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Organization import Organization @@ -11,11 +11,11 @@ class MedicalOrganization(Organization): """ type_: str = Field("MedicalOrganization", const=True, alias='@type') - medicalSpecialty: Optional[Union[List[MedicalSpecialty], MedicalSpecialty]] = Field( + medicalSpecialty: Optional[Union[List[Union[MedicalSpecialty, str]], Union[MedicalSpecialty, str]]] = Field( None, description="A medical specialty of the provider.", ) - isAcceptingNewPatients: Optional[Union[List[StrictBool], StrictBool]] = Field( + isAcceptingNewPatients: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether the provider is accepting new patients.", ) diff --git a/pydantic_schemaorg/MedicalProcedure.py b/pydantic_schemaorg/MedicalProcedure.py index d25e28f8..eb99b994 100644 --- a/pydantic_schemaorg/MedicalProcedure.py +++ b/pydantic_schemaorg/MedicalProcedure.py @@ -1,8 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MedicalProcedureType import MedicalProcedureType +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalEntity import MedicalEntity -from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus from pydantic_schemaorg.EventStatusType import EventStatusType +from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus class MedicalProcedure(MedicalEntity): @@ -13,7 +14,7 @@ class MedicalProcedure(MedicalEntity): """ type_: str = Field("MedicalProcedure", const=True, alias='@type') - procedureType: Any = Field( + procedureType: Optional[Union[List[Union[MedicalProcedureType, str]], Union[MedicalProcedureType, str]]] = Field( None, description="The type of procedure, for example Surgical, Noninvasive, or Percutaneous.", ) @@ -25,7 +26,7 @@ class MedicalProcedure(MedicalEntity): None, description="Typical preparation that a patient must undergo before having the procedure performed.", ) - status: Optional[Union[List[Union[str, MedicalStudyStatus, EventStatusType]], Union[str, MedicalStudyStatus, EventStatusType]]] = Field( + status: Optional[Union[List[Union[str, EventStatusType, MedicalStudyStatus]], Union[str, EventStatusType, MedicalStudyStatus]]] = Field( None, description="The status of the study (enumerated).", ) diff --git a/pydantic_schemaorg/MedicalRiskEstimator.py b/pydantic_schemaorg/MedicalRiskEstimator.py index 6d22f9d6..22a3909d 100644 --- a/pydantic_schemaorg/MedicalRiskEstimator.py +++ b/pydantic_schemaorg/MedicalRiskEstimator.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.MedicalEntity import MedicalEntity -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MedicalRiskFactor import MedicalRiskFactor class MedicalRiskEstimator(MedicalEntity): @@ -11,11 +12,11 @@ class MedicalRiskEstimator(MedicalEntity): """ type_: str = Field("MedicalRiskEstimator", const=True, alias='@type') - estimatesRiskOf: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + estimatesRiskOf: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="The condition, complication, or symptom whose risk is being estimated.", ) - includedRiskFactor: Any = Field( + includedRiskFactor: Optional[Union[List[Union[MedicalRiskFactor, str]], Union[MedicalRiskFactor, str]]] = Field( None, description="A modifiable or non-modifiable risk factor included in the calculation, e.g. age, coexisting" "condition.", diff --git a/pydantic_schemaorg/MedicalRiskFactor.py b/pydantic_schemaorg/MedicalRiskFactor.py index 5663dba2..60a81da6 100644 --- a/pydantic_schemaorg/MedicalRiskFactor.py +++ b/pydantic_schemaorg/MedicalRiskFactor.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalEntity import MedicalEntity -from typing import Any, Optional, Union, List +from typing import List, Optional, Union class MedicalRiskFactor(MedicalEntity): @@ -11,7 +11,7 @@ class MedicalRiskFactor(MedicalEntity): """ type_: str = Field("MedicalRiskFactor", const=True, alias='@type') - increasesRiskOf: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + increasesRiskOf: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="The condition, complication, etc. influenced by this factor.", ) diff --git a/pydantic_schemaorg/MedicalRiskScore.py b/pydantic_schemaorg/MedicalRiskScore.py index 4476ab57..da6cbb10 100644 --- a/pydantic_schemaorg/MedicalRiskScore.py +++ b/pydantic_schemaorg/MedicalRiskScore.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalRiskEstimator import MedicalRiskEstimator diff --git a/pydantic_schemaorg/MedicalScholarlyArticle.py b/pydantic_schemaorg/MedicalScholarlyArticle.py index 83e941bf..33fe93f2 100644 --- a/pydantic_schemaorg/MedicalScholarlyArticle.py +++ b/pydantic_schemaorg/MedicalScholarlyArticle.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.ScholarlyArticle import ScholarlyArticle diff --git a/pydantic_schemaorg/MedicalSign.py b/pydantic_schemaorg/MedicalSign.py index e09178d7..050baf4d 100644 --- a/pydantic_schemaorg/MedicalSign.py +++ b/pydantic_schemaorg/MedicalSign.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.PhysicalExam import PhysicalExam -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalTest import MedicalTest from pydantic_schemaorg.MedicalSignOrSymptom import MedicalSignOrSymptom @@ -13,11 +13,11 @@ class MedicalSign(MedicalSignOrSymptom): """ type_: str = Field("MedicalSign", const=True, alias='@type') - identifyingExam: Optional[Union[List[PhysicalExam], PhysicalExam]] = Field( + identifyingExam: Optional[Union[List[Union[PhysicalExam, str]], Union[PhysicalExam, str]]] = Field( None, description="A physical examination that can identify this sign.", ) - identifyingTest: Optional[Union[List[MedicalTest], MedicalTest]] = Field( + identifyingTest: Optional[Union[List[Union[MedicalTest, str]], Union[MedicalTest, str]]] = Field( None, description="A diagnostic test that can identify this sign.", ) diff --git a/pydantic_schemaorg/MedicalSignOrSymptom.py b/pydantic_schemaorg/MedicalSignOrSymptom.py index fe5f6f04..8e8d460c 100644 --- a/pydantic_schemaorg/MedicalSignOrSymptom.py +++ b/pydantic_schemaorg/MedicalSignOrSymptom.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalTherapy import MedicalTherapy -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalCondition import MedicalCondition @@ -12,7 +12,7 @@ class MedicalSignOrSymptom(MedicalCondition): """ type_: str = Field("MedicalSignOrSymptom", const=True, alias='@type') - possibleTreatment: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + possibleTreatment: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A possible treatment to address this condition, sign or symptom.", ) diff --git a/pydantic_schemaorg/MedicalStudy.py b/pydantic_schemaorg/MedicalStudy.py index f0ed161d..728f1ce1 100644 --- a/pydantic_schemaorg/MedicalStudy.py +++ b/pydantic_schemaorg/MedicalStudy.py @@ -1,8 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEntity import MedicalEntity -from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus from pydantic_schemaorg.EventStatusType import EventStatusType +from pydantic_schemaorg.MedicalStudyStatus import MedicalStudyStatus from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.MedicalCondition import MedicalCondition @@ -22,25 +23,25 @@ class MedicalStudy(MedicalEntity): """ type_: str = Field("MedicalStudy", const=True, alias='@type') - studyLocation: Any = Field( + studyLocation: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The location in which the study is taking/took place.", ) - studySubject: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + studySubject: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="A subject of the study, i.e. one of the medical conditions, therapies, devices, drugs," "etc. investigated by the study.", ) - status: Optional[Union[List[Union[str, MedicalStudyStatus, EventStatusType]], Union[str, MedicalStudyStatus, EventStatusType]]] = Field( + status: Optional[Union[List[Union[str, EventStatusType, MedicalStudyStatus]], Union[str, EventStatusType, MedicalStudyStatus]]] = Field( None, description="The status of the study (enumerated).", ) - sponsor: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + sponsor: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", ) - healthCondition: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + healthCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="Specifying the health condition(s) of a patient, medical study, or other target audience.", ) diff --git a/pydantic_schemaorg/MedicalTest.py b/pydantic_schemaorg/MedicalTest.py index 6dfa89cf..02fbaf93 100644 --- a/pydantic_schemaorg/MedicalTest.py +++ b/pydantic_schemaorg/MedicalTest.py @@ -1,6 +1,10 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MedicalDevice import MedicalDevice +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEnumeration import MedicalEnumeration +from pydantic_schemaorg.Drug import Drug +from pydantic_schemaorg.MedicalSign import MedicalSign +from pydantic_schemaorg.MedicalCondition import MedicalCondition from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -11,7 +15,7 @@ class MedicalTest(MedicalEntity): """ type_: str = Field("MedicalTest", const=True, alias='@type') - usesDevice: Any = Field( + usesDevice: Optional[Union[List[Union[MedicalDevice, str]], Union[MedicalDevice, str]]] = Field( None, description="Device used to perform the test.", ) @@ -19,15 +23,15 @@ class MedicalTest(MedicalEntity): None, description="Range of acceptable values for a typical patient, when applicable.", ) - affectedBy: Any = Field( + affectedBy: Optional[Union[List[Union[Drug, str]], Union[Drug, str]]] = Field( None, description="Drugs that affect the test's results.", ) - signDetected: Any = Field( + signDetected: Optional[Union[List[Union[MedicalSign, str]], Union[MedicalSign, str]]] = Field( None, description="A sign detected by the test.", ) - usedToDiagnose: Any = Field( + usedToDiagnose: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="A condition the test is used to diagnose.", ) diff --git a/pydantic_schemaorg/MedicalTestPanel.py b/pydantic_schemaorg/MedicalTestPanel.py index a4cbc552..4af477f2 100644 --- a/pydantic_schemaorg/MedicalTestPanel.py +++ b/pydantic_schemaorg/MedicalTestPanel.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalTest import MedicalTest -from typing import Any, Optional, Union, List +from typing import List, Optional, Union class MedicalTestPanel(MedicalTest): @@ -10,7 +10,7 @@ class MedicalTestPanel(MedicalTest): """ type_: str = Field("MedicalTestPanel", const=True, alias='@type') - subTest: Optional[Union[List[MedicalTest], MedicalTest]] = Field( + subTest: Optional[Union[List[Union[MedicalTest, str]], Union[MedicalTest, str]]] = Field( None, description="A component test of the panel.", ) diff --git a/pydantic_schemaorg/MedicalTherapy.py b/pydantic_schemaorg/MedicalTherapy.py index 52dce38f..7e7eaf79 100644 --- a/pydantic_schemaorg/MedicalTherapy.py +++ b/pydantic_schemaorg/MedicalTherapy.py @@ -1,7 +1,9 @@ +from typing import List, Optional, Union + from pydantic import Field -from typing import Any, Optional, Union, List -from pydantic_schemaorg.MedicalEntity import MedicalEntity + from pydantic_schemaorg.MedicalContraindication import MedicalContraindication +from pydantic_schemaorg.MedicalEntity import MedicalEntity from pydantic_schemaorg.TherapeuticProcedure import TherapeuticProcedure @@ -16,22 +18,23 @@ class MedicalTherapy(TherapeuticProcedure): """ type_: str = Field("MedicalTherapy", const=True, alias='@type') - duplicateTherapy: Any = Field( + duplicateTherapy: Optional[Union[List[Union['MedicalTherapy', str]], Union['MedicalTherapy', str]]] = Field( None, description="A therapy that duplicates or overlaps this one.", ) - seriousAdverseOutcome: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + seriousAdverseOutcome: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="A possible serious complication and/or serious side effect of this therapy. Serious" - "adverse outcomes include those that are life-threatening; result in death, disability," - "or permanent damage; require hospitalization or prolong existing hospitalization;" - "cause congenital anomalies or birth defects; or jeopardize the patient and may require" - "medical or surgical intervention to prevent one of the outcomes in this definition.", + "adverse outcomes include those that are life-threatening; result in death, disability," + "or permanent damage; require hospitalization or prolong existing hospitalization;" + "cause congenital anomalies or birth defects; or jeopardize the patient and may require" + "medical or surgical intervention to prevent one of the outcomes in this definition.", ) - contraindication: Optional[Union[List[Union[str, MedicalContraindication]], Union[str, MedicalContraindication]]] = Field( + contraindication: Optional[ + Union[List[Union[str, MedicalContraindication]], Union[str, MedicalContraindication]]] = Field( None, description="A contraindication for this therapy.", ) - + MedicalTherapy.update_forward_refs() diff --git a/pydantic_schemaorg/MedicalTrial.py b/pydantic_schemaorg/MedicalTrial.py index 6cd2b2f5..f3d4367f 100644 --- a/pydantic_schemaorg/MedicalTrial.py +++ b/pydantic_schemaorg/MedicalTrial.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MedicalTrialDesign import MedicalTrialDesign -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MedicalStudy import MedicalStudy @@ -14,7 +14,7 @@ class MedicalTrial(MedicalStudy): """ type_: str = Field("MedicalTrial", const=True, alias='@type') - trialDesign: Optional[Union[List[MedicalTrialDesign], MedicalTrialDesign]] = Field( + trialDesign: Optional[Union[List[Union[MedicalTrialDesign, str]], Union[MedicalTrialDesign, str]]] = Field( None, description="Specifics about the trial design (enumerated).", ) diff --git a/pydantic_schemaorg/MedicalWebPage.py b/pydantic_schemaorg/MedicalWebPage.py index 1a9b8ac8..f0444c5a 100644 --- a/pydantic_schemaorg/MedicalWebPage.py +++ b/pydantic_schemaorg/MedicalWebPage.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.MedicalAudienceType import MedicalAudienceType -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MedicalAudience import MedicalAudience +from typing import List, Optional, Any, Union from pydantic_schemaorg.WebPage import WebPage @@ -11,7 +12,7 @@ class MedicalWebPage(WebPage): """ type_: str = Field("MedicalWebPage", const=True, alias='@type') - medicalAudience: Union[List[Union[MedicalAudienceType, Any]], Union[MedicalAudienceType, Any]] = Field( + medicalAudience: Optional[Union[List[Union[MedicalAudienceType, MedicalAudience, str]], Union[MedicalAudienceType, MedicalAudience, str]]] = Field( None, description="Medical audience for page.", ) diff --git a/pydantic_schemaorg/Menu.py b/pydantic_schemaorg/Menu.py index b65072ba..c827a7ed 100644 --- a/pydantic_schemaorg/Menu.py +++ b/pydantic_schemaorg/Menu.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MenuSection import MenuSection -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MenuItem import MenuItem from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,11 +12,11 @@ class Menu(CreativeWork): """ type_: str = Field("Menu", const=True, alias='@type') - hasMenuSection: Optional[Union[List[MenuSection], MenuSection]] = Field( + hasMenuSection: Optional[Union[List[Union[MenuSection, str]], Union[MenuSection, str]]] = Field( None, description="A subgrouping of the menu (by dishes, course, serving time period, etc.).", ) - hasMenuItem: Optional[Union[List[MenuItem], MenuItem]] = Field( + hasMenuItem: Optional[Union[List[Union[MenuItem, str]], Union[MenuItem, str]]] = Field( None, description="A food or drink item contained in a menu or menu section.", ) diff --git a/pydantic_schemaorg/MenuItem.py b/pydantic_schemaorg/MenuItem.py index 13f7e756..cd365269 100644 --- a/pydantic_schemaorg/MenuItem.py +++ b/pydantic_schemaorg/MenuItem.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.MenuSection import MenuSection -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Demand import Demand from pydantic_schemaorg.Offer import Offer from pydantic_schemaorg.NutritionInformation import NutritionInformation @@ -15,13 +15,13 @@ class MenuItem(Intangible): """ type_: str = Field("MenuItem", const=True, alias='@type') - menuAddOn: Union[List[Union[MenuSection, Any]], Union[MenuSection, Any]] = Field( + menuAddOn: Optional[Union[List[Union['MenuItem', MenuSection, str]], Union['MenuItem', MenuSection, str]]] = Field( None, description="Additional menu item(s) such as a side dish of salad or side order of fries that can be added" "to this menu item. Additionally it can be a menu section containing allowed add-on menu" "items for this menu item.", ) - offers: Optional[Union[List[Union[Demand, Offer]], Union[Demand, Offer]]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -30,11 +30,11 @@ class MenuItem(Intangible): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - nutrition: Optional[Union[List[NutritionInformation], NutritionInformation]] = Field( + nutrition: Optional[Union[List[Union[NutritionInformation, str]], Union[NutritionInformation, str]]] = Field( None, description="Nutrition information about the recipe or menu item.", ) - suitableForDiet: Optional[Union[List[RestrictedDiet], RestrictedDiet]] = Field( + suitableForDiet: Optional[Union[List[Union[RestrictedDiet, str]], Union[RestrictedDiet, str]]] = Field( None, description="Indicates a dietary restriction or guideline for which this recipe or menu item is suitable," "e.g. diabetic, halal etc.", diff --git a/pydantic_schemaorg/MenuSection.py b/pydantic_schemaorg/MenuSection.py index eefbd187..238e38d6 100644 --- a/pydantic_schemaorg/MenuSection.py +++ b/pydantic_schemaorg/MenuSection.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MenuItem import MenuItem from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,11 +13,11 @@ class MenuSection(CreativeWork): """ type_: str = Field("MenuSection", const=True, alias='@type') - hasMenuSection: Any = Field( + hasMenuSection: Optional[Union[List[Union['MenuSection', str]], Union['MenuSection', str]]] = Field( None, description="A subgrouping of the menu (by dishes, course, serving time period, etc.).", ) - hasMenuItem: Any = Field( + hasMenuItem: Optional[Union[List[Union[MenuItem, str]], Union[MenuItem, str]]] = Field( None, description="A food or drink item contained in a menu or menu section.", ) diff --git a/pydantic_schemaorg/MerchantReturnPolicy.py b/pydantic_schemaorg/MerchantReturnPolicy.py index 357e4fa3..def89446 100644 --- a/pydantic_schemaorg/MerchantReturnPolicy.py +++ b/pydantic_schemaorg/MerchantReturnPolicy.py @@ -1,8 +1,13 @@ -from pydantic import StrictBool, Field, AnyUrl +from pydantic import AnyUrl, StrictBool, Field from pydantic_schemaorg.ReturnFeesEnumeration import ReturnFeesEnumeration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.ReturnLabelSourceEnumeration import ReturnLabelSourceEnumeration from datetime import datetime, date +from pydantic_schemaorg.MerchantReturnPolicySeasonalOverride import MerchantReturnPolicySeasonalOverride +from pydantic_schemaorg.RefundTypeEnumeration import RefundTypeEnumeration +from pydantic_schemaorg.MerchantReturnEnumeration import MerchantReturnEnumeration +from pydantic_schemaorg.Country import Country from pydantic_schemaorg.ReturnMethodEnumeration import ReturnMethodEnumeration from pydantic_schemaorg.OfferItemCondition import OfferItemCondition from decimal import Decimal @@ -18,62 +23,62 @@ class MerchantReturnPolicy(Intangible): """ type_: str = Field("MerchantReturnPolicy", const=True, alias='@type') - customerRemorseReturnFees: Optional[Union[List[ReturnFeesEnumeration], ReturnFeesEnumeration]] = Field( + customerRemorseReturnFees: Optional[Union[List[Union[ReturnFeesEnumeration, str]], Union[ReturnFeesEnumeration, str]]] = Field( None, description="The type of return fees if the product is returned due to customer remorse.", ) - customerRemorseReturnShippingFeesAmount: Any = Field( + customerRemorseReturnShippingFeesAmount: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="The amount of shipping costs if a product is returned due to customer remorse. Applicable" "when property [[customerRemorseReturnFees]] equals [[ReturnShippingFees]].", ) - inStoreReturnsOffered: Optional[Union[List[StrictBool], StrictBool]] = Field( + inStoreReturnsOffered: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Are in-store returns offered? (for more advanced return methods use the [[returnMethod]]" "property)", ) - itemDefectReturnShippingFeesAmount: Any = Field( + itemDefectReturnShippingFeesAmount: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="Amount of shipping costs for defect product returns. Applicable when property [[itemDefectReturnFees]]" "equals [[ReturnShippingFees]].", ) - returnFees: Optional[Union[List[ReturnFeesEnumeration], ReturnFeesEnumeration]] = Field( + returnFees: Optional[Union[List[Union[ReturnFeesEnumeration, str]], Union[ReturnFeesEnumeration, str]]] = Field( None, description="The type of return fees for purchased products (for any return reason)", ) - merchantReturnLink: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + merchantReturnLink: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Specifies a Web page or service by URL, for product returns.", ) - itemDefectReturnLabelSource: Optional[Union[List[ReturnLabelSourceEnumeration], ReturnLabelSourceEnumeration]] = Field( + itemDefectReturnLabelSource: Optional[Union[List[Union[ReturnLabelSourceEnumeration, str]], Union[ReturnLabelSourceEnumeration, str]]] = Field( None, description="The method (from an enumeration) by which the customer obtains a return shipping label" "for a defect product.", ) - merchantReturnDays: Optional[Union[List[Union[datetime, int, date]], Union[datetime, int, date]]] = Field( + merchantReturnDays: Optional[Union[List[Union[datetime, int, date, str]], Union[datetime, int, date, str]]] = Field( None, description="Specifies either a fixed return date or the number of days (from the delivery date) that" "a product can be returned. Used when the [[returnPolicyCategory]] property is specified" "as [[MerchantReturnFiniteReturnWindow]].", ) - returnLabelSource: Optional[Union[List[ReturnLabelSourceEnumeration], ReturnLabelSourceEnumeration]] = Field( + returnLabelSource: Optional[Union[List[Union[ReturnLabelSourceEnumeration, str]], Union[ReturnLabelSourceEnumeration, str]]] = Field( None, description="The method (from an enumeration) by which the customer obtains a return shipping label" "for a product returned for any reason.", ) - returnPolicySeasonalOverride: Any = Field( + returnPolicySeasonalOverride: Optional[Union[List[Union[MerchantReturnPolicySeasonalOverride, str]], Union[MerchantReturnPolicySeasonalOverride, str]]] = Field( None, description="Seasonal override of a return policy.", ) - refundType: Any = Field( + refundType: Optional[Union[List[Union[RefundTypeEnumeration, str]], Union[RefundTypeEnumeration, str]]] = Field( None, description="A refund type, from an enumerated list.", ) - returnPolicyCategory: Any = Field( + returnPolicyCategory: Optional[Union[List[Union[MerchantReturnEnumeration, str]], Union[MerchantReturnEnumeration, str]]] = Field( None, description="Specifies an applicable return policy (from an enumeration).", ) - returnPolicyCountry: Union[List[Union[str, Any]], Union[str, Any]] = Field( + returnPolicyCountry: Optional[Union[List[Union[str, Country]], Union[str, Country]]] = Field( None, description="The country where the product has to be sent to for returns, for example \"Ireland\" using" "the [[name]] property of [[Country]]. You can also provide the two-letter [ISO 3166-1" @@ -81,26 +86,26 @@ class MerchantReturnPolicy(Intangible): "can be different from the country where the product was originally shipped from or sent" "too.", ) - itemDefectReturnFees: Optional[Union[List[ReturnFeesEnumeration], ReturnFeesEnumeration]] = Field( + itemDefectReturnFees: Optional[Union[List[Union[ReturnFeesEnumeration, str]], Union[ReturnFeesEnumeration, str]]] = Field( None, description="The type of return fees for returns of defect products.", ) - returnMethod: Optional[Union[List[ReturnMethodEnumeration], ReturnMethodEnumeration]] = Field( + returnMethod: Optional[Union[List[Union[ReturnMethodEnumeration, str]], Union[ReturnMethodEnumeration, str]]] = Field( None, description="The type of return method offered, specified from an enumeration.", ) - itemCondition: Optional[Union[List[OfferItemCondition], OfferItemCondition]] = Field( + itemCondition: Optional[Union[List[Union[OfferItemCondition, str]], Union[OfferItemCondition, str]]] = Field( None, description="A predefined value from OfferItemCondition specifying the condition of the product" "or service, or the products or services included in the offer. Also used for product return" "policies to specify the condition of products accepted for returns.", ) - restockingFee: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + restockingFee: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="Use [[MonetaryAmount]] to specify a fixed restocking fee for product returns, or use" "[[Number]] to specify a percentage of the product price paid by the customer.", ) - additionalProperty: Optional[Union[List[PropertyValue], PropertyValue]] = Field( + additionalProperty: Optional[Union[List[Union[PropertyValue, str]], Union[PropertyValue, str]]] = Field( None, description="A property-value pair representing an additional characteristics of the entitity," "e.g. a product feature or another characteristic for which there is no matching property" @@ -109,12 +114,12 @@ class MerchantReturnPolicy(Intangible): "https://schema.org/gtin13, ...) will typically expect such data to be provided using" "those properties, rather than using the generic property/value mechanism.", ) - returnShippingFeesAmount: Any = Field( + returnShippingFeesAmount: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="Amount of shipping costs for product returns (for any reason). Applicable when property" "[[returnFees]] equals [[ReturnShippingFees]].", ) - customerRemorseReturnLabelSource: Optional[Union[List[ReturnLabelSourceEnumeration], ReturnLabelSourceEnumeration]] = Field( + customerRemorseReturnLabelSource: Optional[Union[List[Union[ReturnLabelSourceEnumeration, str]], Union[ReturnLabelSourceEnumeration, str]]] = Field( None, description="The method (from an enumeration) by which the customer obtains a return shipping label" "for a product returned due to customer remorse.", diff --git a/pydantic_schemaorg/MerchantReturnPolicySeasonalOverride.py b/pydantic_schemaorg/MerchantReturnPolicySeasonalOverride.py index 1687e156..e9462058 100644 --- a/pydantic_schemaorg/MerchantReturnPolicySeasonalOverride.py +++ b/pydantic_schemaorg/MerchantReturnPolicySeasonalOverride.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MerchantReturnEnumeration import MerchantReturnEnumeration from pydantic_schemaorg.Intangible import Intangible @@ -12,21 +12,21 @@ class MerchantReturnPolicySeasonalOverride(Intangible): """ type_: str = Field("MerchantReturnPolicySeasonalOverride", const=True, alias='@type') - merchantReturnDays: Optional[Union[List[Union[datetime, int, date]], Union[datetime, int, date]]] = Field( + merchantReturnDays: Optional[Union[List[Union[datetime, int, date, str]], Union[datetime, int, date, str]]] = Field( None, description="Specifies either a fixed return date or the number of days (from the delivery date) that" "a product can be returned. Used when the [[returnPolicyCategory]] property is specified" "as [[MerchantReturnFiniteReturnWindow]].", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - returnPolicyCategory: Optional[Union[List[MerchantReturnEnumeration], MerchantReturnEnumeration]] = Field( + returnPolicyCategory: Optional[Union[List[Union[MerchantReturnEnumeration, str]], Union[MerchantReturnEnumeration, str]]] = Field( None, description="Specifies an applicable return policy (from an enumeration).", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) diff --git a/pydantic_schemaorg/Message.py b/pydantic_schemaorg/Message.py index 43dad287..fd8ace22 100644 --- a/pydantic_schemaorg/Message.py +++ b/pydantic_schemaorg/Message.py @@ -1,8 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.CreativeWork import CreativeWork from datetime import datetime, date @@ -14,40 +15,40 @@ class Message(CreativeWork): """ type_: str = Field("Message", const=True, alias='@type') - sender: Optional[Union[List[Union[Organization, Audience, Person]], Union[Organization, Audience, Person]]] = Field( + sender: Optional[Union[List[Union[Audience, Organization, Person, str]], Union[Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the sending end of the action.", ) - ccRecipient: Union[List[Union[Organization, Person, Any]], Union[Organization, Person, Any]] = Field( + ccRecipient: Optional[Union[List[Union[ContactPoint, Organization, Person, str]], Union[ContactPoint, Organization, Person, str]]] = Field( None, description="A sub property of recipient. The recipient copied on a message.", ) - toRecipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + toRecipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of recipient. The recipient who was directly sent the message.", ) - recipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) - messageAttachment: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + messageAttachment: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="A CreativeWork attached to the message.", ) - dateRead: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateRead: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date/time at which the message has been read by the recipient if a single recipient" "exists.", ) - dateSent: Optional[Union[List[datetime], datetime]] = Field( + dateSent: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date/time at which the message was sent.", ) - dateReceived: Optional[Union[List[datetime], datetime]] = Field( + dateReceived: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date/time the message was received if a single recipient exists.", ) - bccRecipient: Union[List[Union[Organization, Person, Any]], Union[Organization, Person, Any]] = Field( + bccRecipient: Optional[Union[List[Union[ContactPoint, Organization, Person, str]], Union[ContactPoint, Organization, Person, str]]] = Field( None, description="A sub property of recipient. The recipient blind copied on a message.", ) diff --git a/pydantic_schemaorg/MobileApplication.py b/pydantic_schemaorg/MobileApplication.py index 68b5452a..efac379f 100644 --- a/pydantic_schemaorg/MobileApplication.py +++ b/pydantic_schemaorg/MobileApplication.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.SoftwareApplication import SoftwareApplication diff --git a/pydantic_schemaorg/MolecularEntity.py b/pydantic_schemaorg/MolecularEntity.py index 5c5f02ae..248247c3 100644 --- a/pydantic_schemaorg/MolecularEntity.py +++ b/pydantic_schemaorg/MolecularEntity.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.DefinedTerm import DefinedTerm from pydantic_schemaorg.BioChemEntity import BioChemEntity @@ -24,7 +25,7 @@ class MolecularEntity(BioChemEntity): "using short ASCII strings. Double bond stereochemistry \ indicators may need to be escaped" "in the string in formats where the backslash is an escape character.", ) - molecularWeight: Union[List[Union[str, Any]], Union[str, Any]] = Field( + molecularWeight: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="This is the molecular weight of the entity being described, not of the parent. Units should" "be included in the form '<Number> <unit>', for example '12 amu' or as '<QuantitativeValue>.", @@ -38,7 +39,7 @@ class MolecularEntity(BioChemEntity): None, description="The empirical formula is the simplest whole number ratio of all the atoms in a molecule.", ) - chemicalRole: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + chemicalRole: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="A role played by the BioChemEntity within a chemical context.", ) @@ -46,14 +47,14 @@ class MolecularEntity(BioChemEntity): None, description="InChIKey is a hashed version of the full InChI (using the SHA-256 algorithm).", ) - monoisotopicMolecularWeight: Union[List[Union[str, Any]], Union[str, Any]] = Field( + monoisotopicMolecularWeight: Optional[Union[List[Union[str, QuantitativeValue]], Union[str, QuantitativeValue]]] = Field( None, description="The monoisotopic mass is the sum of the masses of the atoms in a molecule using the unbound," "ground-state, rest mass of the principal (most abundant) isotope for each element instead" "of the isotopic average mass. Please include the units the form '<Number> <unit>'," "for example '770.230488 g/mol' or as '<QuantitativeValue>.", ) - potentialUse: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + potentialUse: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="Intended use of the BioChemEntity by humans.", ) diff --git a/pydantic_schemaorg/MonetaryAmount.py b/pydantic_schemaorg/MonetaryAmount.py index 7f7588b1..5bfd00fa 100644 --- a/pydantic_schemaorg/MonetaryAmount.py +++ b/pydantic_schemaorg/MonetaryAmount.py @@ -1,6 +1,6 @@ from pydantic import StrictBool, Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from datetime import datetime, date from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,15 +15,15 @@ class MonetaryAmount(StructuredValue): """ type_: str = Field("MonetaryAmount", const=True, alias='@type') - minValue: Optional[Union[List[Decimal], Decimal]] = Field( + minValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The lower value of some characteristic or property.", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - value: Optional[Union[List[Union[Decimal, StrictBool, str, StructuredValue]], Union[Decimal, StrictBool, str, StructuredValue]]] = Field( + value: Optional[Union[List[Union[Decimal, str, StrictBool, StructuredValue]], Union[Decimal, str, StrictBool, StructuredValue]]] = Field( None, description="The value of the quantitative value or property value node. * For [[QuantitativeValue]]" "and [[MonetaryAmount]], the recommended type for values is 'Number'. * For [[PropertyValue]]," @@ -32,12 +32,12 @@ class MonetaryAmount(StructuredValue): "similiar Unicode symbols. * Use '.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to" "indicate a decimal point. Avoid using these symbols as a readability separator.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", ) - maxValue: Optional[Union[List[Decimal], Decimal]] = Field( + maxValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The upper value of some characteristic or property.", ) diff --git a/pydantic_schemaorg/MonetaryAmountDistribution.py b/pydantic_schemaorg/MonetaryAmountDistribution.py index ff5701c8..5f6c2326 100644 --- a/pydantic_schemaorg/MonetaryAmountDistribution.py +++ b/pydantic_schemaorg/MonetaryAmountDistribution.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.QuantitativeValueDistribution import QuantitativeValueDistribution diff --git a/pydantic_schemaorg/MonetaryGrant.py b/pydantic_schemaorg/MonetaryGrant.py index 85ab5d01..cff98411 100644 --- a/pydantic_schemaorg/MonetaryGrant.py +++ b/pydantic_schemaorg/MonetaryGrant.py @@ -1,8 +1,9 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.Grant import Grant @@ -13,12 +14,12 @@ class MonetaryGrant(Grant): """ type_: str = Field("MonetaryGrant", const=True, alias='@type') - funder: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + funder: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A person or organization that supports (sponsors) something through some kind of financial" "contribution.", ) - amount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + amount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The amount of money.", ) diff --git a/pydantic_schemaorg/MoneyTransfer.py b/pydantic_schemaorg/MoneyTransfer.py index d131eeb2..d7fcc029 100644 --- a/pydantic_schemaorg/MoneyTransfer.py +++ b/pydantic_schemaorg/MoneyTransfer.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Union from pydantic_schemaorg.BankOrCreditUnion import BankOrCreditUnion from pydantic_schemaorg.TransferAction import TransferAction @@ -13,7 +14,7 @@ class MoneyTransfer(TransferAction): """ type_: str = Field("MoneyTransfer", const=True, alias='@type') - amount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + amount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The amount of money.", ) diff --git a/pydantic_schemaorg/MortgageLoan.py b/pydantic_schemaorg/MortgageLoan.py index 4f0ab8c8..7803f6e0 100644 --- a/pydantic_schemaorg/MortgageLoan.py +++ b/pydantic_schemaorg/MortgageLoan.py @@ -1,5 +1,6 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.LoanOrCredit import LoanOrCredit @@ -11,11 +12,11 @@ class MortgageLoan(LoanOrCredit): """ type_: str = Field("MortgageLoan", const=True, alias='@type') - domiciledMortgage: Optional[Union[List[StrictBool], StrictBool]] = Field( + domiciledMortgage: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether borrower is a resident of the jurisdiction where the property is located.", ) - loanMortgageMandateAmount: Any = Field( + loanMortgageMandateAmount: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="Amount of mortgage mandate that can be converted into a proper mortgage at a later stage.", ) diff --git a/pydantic_schemaorg/MoveAction.py b/pydantic_schemaorg/MoveAction.py index 910096c7..937b10a7 100644 --- a/pydantic_schemaorg/MoveAction.py +++ b/pydantic_schemaorg/MoveAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Action import Action @@ -13,12 +13,12 @@ class MoveAction(Action): """ type_: str = Field("MoveAction", const=True, alias='@type') - fromLocation: Optional[Union[List[Place], Place]] = Field( + fromLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The original location of the object or the agent before the" "action.", ) - toLocation: Optional[Union[List[Place], Place]] = Field( + toLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The final location of the object or the agent after the action.", ) diff --git a/pydantic_schemaorg/Movie.py b/pydantic_schemaorg/Movie.py index a40e206f..12ec0591 100644 --- a/pydantic_schemaorg/Movie.py +++ b/pydantic_schemaorg/Movie.py @@ -1,9 +1,12 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.VideoObject import VideoObject from pydantic_schemaorg.Duration import Duration +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Country import Country from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWork import CreativeWork @@ -14,24 +17,24 @@ class Movie(CreativeWork): """ type_: str = Field("Movie", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - duration: Optional[Union[List[Duration], Duration]] = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - subtitleLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + subtitleLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).", ) - countryOfOrigin: Optional[Union[List[Country], Country]] = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -41,12 +44,12 @@ class Movie(CreativeWork): "case of products, the country of origin of the product. The exact interpretation of this" "may vary by context and product type, and cannot be fully enumerated here.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", @@ -61,17 +64,17 @@ class Movie(CreativeWork): "their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general" "description), or alongside [[editEIDR]] for a more edit-specific description.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/MovieSeries.py b/pydantic_schemaorg/MovieSeries.py index 09b95817..30dc903a 100644 --- a/pydantic_schemaorg/MovieSeries.py +++ b/pydantic_schemaorg/MovieSeries.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.VideoObject import VideoObject from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.MusicGroup import MusicGroup @@ -14,36 +14,36 @@ class MovieSeries(CreativeWorkSeries): """ type_: str = Field("MovieSeries", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - trailer: Optional[Union[List[VideoObject], VideoObject]] = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Optional[Union[List[Union[MusicGroup, Person]], Union[MusicGroup, Person]]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/MovieTheater.py b/pydantic_schemaorg/MovieTheater.py index 8cc3d8d1..ae0afd1a 100644 --- a/pydantic_schemaorg/MovieTheater.py +++ b/pydantic_schemaorg/MovieTheater.py @@ -1,18 +1,18 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List -from pydantic_schemaorg.CivicStructure import CivicStructure +from typing import List, Optional, Union from pydantic_schemaorg.EntertainmentBusiness import EntertainmentBusiness +from pydantic_schemaorg.CivicStructure import CivicStructure -class MovieTheater(CivicStructure, EntertainmentBusiness): +class MovieTheater(EntertainmentBusiness, CivicStructure): """A movie theater. See https://schema.org/MovieTheater. """ type_: str = Field("MovieTheater", const=True, alias='@type') - screenCount: Optional[Union[List[Decimal], Decimal]] = Field( + screenCount: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The number of screens in the movie theater.", ) diff --git a/pydantic_schemaorg/Muscle.py b/pydantic_schemaorg/Muscle.py index 46c77175..35a4ea32 100644 --- a/pydantic_schemaorg/Muscle.py +++ b/pydantic_schemaorg/Muscle.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Nerve import Nerve -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Vessel import Vessel from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure @@ -13,7 +13,7 @@ class Muscle(AnatomicalStructure): """ type_: str = Field("Muscle", const=True, alias='@type') - nerve: Optional[Union[List[Nerve], Nerve]] = Field( + nerve: Optional[Union[List[Union[Nerve, str]], Union[Nerve, str]]] = Field( None, description="The underlying innervation associated with the muscle.", ) @@ -21,15 +21,15 @@ class Muscle(AnatomicalStructure): None, description="The movement the muscle generates.", ) - antagonist: Any = Field( + antagonist: Optional[Union[List[Union['Muscle', str]], Union['Muscle', str]]] = Field( None, description="The muscle whose action counteracts the specified muscle.", ) - bloodSupply: Optional[Union[List[Vessel], Vessel]] = Field( + bloodSupply: Optional[Union[List[Union[Vessel, str]], Union[Vessel, str]]] = Field( None, description="The blood vessel that carries blood from the heart to the muscle.", ) - insertion: Optional[Union[List[AnatomicalStructure], AnatomicalStructure]] = Field( + insertion: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="The place of attachment of a muscle, or what the muscle moves.", ) diff --git a/pydantic_schemaorg/MusicAlbum.py b/pydantic_schemaorg/MusicAlbum.py index f9952c9b..268cb9fe 100644 --- a/pydantic_schemaorg/MusicAlbum.py +++ b/pydantic_schemaorg/MusicAlbum.py @@ -1,8 +1,10 @@ from pydantic import Field from pydantic_schemaorg.MusicAlbumProductionType import MusicAlbumProductionType -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.MusicAlbumReleaseType import MusicAlbumReleaseType +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.MusicRelease import MusicRelease from pydantic_schemaorg.MusicPlaylist import MusicPlaylist @@ -13,20 +15,20 @@ class MusicAlbum(MusicPlaylist): """ type_: str = Field("MusicAlbum", const=True, alias='@type') - albumProductionType: Optional[Union[List[MusicAlbumProductionType], MusicAlbumProductionType]] = Field( + albumProductionType: Optional[Union[List[Union[MusicAlbumProductionType, str]], Union[MusicAlbumProductionType, str]]] = Field( None, description="Classification of the album by it's type of content: soundtrack, live album, studio" "album, etc.", ) - albumReleaseType: Optional[Union[List[MusicAlbumReleaseType], MusicAlbumReleaseType]] = Field( + albumReleaseType: Optional[Union[List[Union[MusicAlbumReleaseType, str]], Union[MusicAlbumReleaseType, str]]] = Field( None, description="The kind of release which this album is: single, EP or album.", ) - byArtist: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + byArtist: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The artist that performed this album or recording.", ) - albumRelease: Any = Field( + albumRelease: Optional[Union[List[Union[MusicRelease, str]], Union[MusicRelease, str]]] = Field( None, description="A release of this album.", ) diff --git a/pydantic_schemaorg/MusicComposition.py b/pydantic_schemaorg/MusicComposition.py index 7f476bc3..f77c5ae8 100644 --- a/pydantic_schemaorg/MusicComposition.py +++ b/pydantic_schemaorg/MusicComposition.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork from pydantic_schemaorg.MusicRecording import MusicRecording from pydantic_schemaorg.Event import Event @@ -14,16 +14,16 @@ class MusicComposition(CreativeWork): """ type_: str = Field("MusicComposition", const=True, alias='@type') - composer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + composer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization who wrote a composition, or who is the composer of a work performed" "at some event.", ) - includedComposition: Any = Field( + includedComposition: Optional[Union[List[Union['MusicComposition', str]], Union['MusicComposition', str]]] = Field( None, description="Smaller compositions included in this work (e.g. a movement in a symphony).", ) - lyrics: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + lyrics: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="The words in the song.", ) @@ -31,11 +31,11 @@ class MusicComposition(CreativeWork): None, description="The key, mode, or scale this composition uses.", ) - musicArrangement: Any = Field( + musicArrangement: Optional[Union[List[Union['MusicComposition', str]], Union['MusicComposition', str]]] = Field( None, description="An arrangement derived from the composition.", ) - recordedAs: Optional[Union[List[MusicRecording], MusicRecording]] = Field( + recordedAs: Optional[Union[List[Union[MusicRecording, str]], Union[MusicRecording, str]]] = Field( None, description="An audio recording of the work.", ) @@ -43,11 +43,11 @@ class MusicComposition(CreativeWork): None, description="The International Standard Musical Work Code for the composition.", ) - firstPerformance: Optional[Union[List[Event], Event]] = Field( + firstPerformance: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="The date and place the work was first performed.", ) - lyricist: Optional[Union[List[Person], Person]] = Field( + lyricist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The person who wrote the words.", ) diff --git a/pydantic_schemaorg/MusicGroup.py b/pydantic_schemaorg/MusicGroup.py index 541ac5f5..2cd07cfa 100644 --- a/pydantic_schemaorg/MusicGroup.py +++ b/pydantic_schemaorg/MusicGroup.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.MusicAlbum import MusicAlbum from pydantic_schemaorg.MusicRecording import MusicRecording from pydantic_schemaorg.ItemList import ItemList @@ -18,24 +18,24 @@ class MusicGroup(PerformingGroup): None, description="Genre of the creative work, broadcast channel or group.", ) - album: Optional[Union[List[MusicAlbum], MusicAlbum]] = Field( + album: Optional[Union[List[Union[MusicAlbum, str]], Union[MusicAlbum, str]]] = Field( None, description="A music album.", ) - tracks: Optional[Union[List[MusicRecording], MusicRecording]] = Field( + tracks: Optional[Union[List[Union[MusicRecording, str]], Union[MusicRecording, str]]] = Field( None, description="A music recording (track)—usually a single song.", ) - track: Optional[Union[List[Union[ItemList, MusicRecording]], Union[ItemList, MusicRecording]]] = Field( + track: Optional[Union[List[Union[ItemList, MusicRecording, str]], Union[ItemList, MusicRecording, str]]] = Field( None, description="A music recording (track)—usually a single song. If an ItemList is given, the" "list should contain items of type MusicRecording.", ) - albums: Optional[Union[List[MusicAlbum], MusicAlbum]] = Field( + albums: Optional[Union[List[Union[MusicAlbum, str]], Union[MusicAlbum, str]]] = Field( None, description="A collection of music albums.", ) - musicGroupMember: Optional[Union[List[Person], Person]] = Field( + musicGroupMember: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A member of a music group—for example, John, Paul, George, or Ringo.", ) diff --git a/pydantic_schemaorg/MusicPlaylist.py b/pydantic_schemaorg/MusicPlaylist.py index 16b4fa74..4a408527 100644 --- a/pydantic_schemaorg/MusicPlaylist.py +++ b/pydantic_schemaorg/MusicPlaylist.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MusicRecording import MusicRecording +from pydantic_schemaorg.ItemList import ItemList from pydantic_schemaorg.CreativeWork import CreativeWork @@ -10,15 +12,15 @@ class MusicPlaylist(CreativeWork): """ type_: str = Field("MusicPlaylist", const=True, alias='@type') - numTracks: Optional[Union[List[int], int]] = Field( + numTracks: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of tracks in this album or playlist.", ) - tracks: Any = Field( + tracks: Optional[Union[List[Union[MusicRecording, str]], Union[MusicRecording, str]]] = Field( None, description="A music recording (track)—usually a single song.", ) - track: Any = Field( + track: Optional[Union[List[Union[ItemList, MusicRecording, str]], Union[ItemList, MusicRecording, str]]] = Field( None, description="A music recording (track)—usually a single song. If an ItemList is given, the" "list should contain items of type MusicRecording.", diff --git a/pydantic_schemaorg/MusicRecording.py b/pydantic_schemaorg/MusicRecording.py index f0234a59..97c4a52e 100644 --- a/pydantic_schemaorg/MusicRecording.py +++ b/pydantic_schemaorg/MusicRecording.py @@ -1,8 +1,11 @@ from pydantic import Field from pydantic_schemaorg.MusicPlaylist import MusicPlaylist -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union +from pydantic_schemaorg.Duration import Duration +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.Person import Person from pydantic_schemaorg.MusicAlbum import MusicAlbum +from pydantic_schemaorg.MusicComposition import MusicComposition from pydantic_schemaorg.CreativeWork import CreativeWork @@ -13,23 +16,23 @@ class MusicRecording(CreativeWork): """ type_: str = Field("MusicRecording", const=True, alias='@type') - inPlaylist: Optional[Union[List[MusicPlaylist], MusicPlaylist]] = Field( + inPlaylist: Optional[Union[List[Union[MusicPlaylist, str]], Union[MusicPlaylist, str]]] = Field( None, description="The playlist to which this recording belongs.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - byArtist: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + byArtist: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The artist that performed this album or recording.", ) - inAlbum: Optional[Union[List[MusicAlbum], MusicAlbum]] = Field( + inAlbum: Optional[Union[List[Union[MusicAlbum, str]], Union[MusicAlbum, str]]] = Field( None, description="The album to which this recording belongs.", ) - recordingOf: Any = Field( + recordingOf: Optional[Union[List[Union[MusicComposition, str]], Union[MusicComposition, str]]] = Field( None, description="The composition this track is a recording of.", ) diff --git a/pydantic_schemaorg/MusicRelease.py b/pydantic_schemaorg/MusicRelease.py index 86a37cf3..d74c412b 100644 --- a/pydantic_schemaorg/MusicRelease.py +++ b/pydantic_schemaorg/MusicRelease.py @@ -1,6 +1,7 @@ from pydantic import Field from pydantic_schemaorg.MusicAlbum import MusicAlbum -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.MusicReleaseFormatType import MusicReleaseFormatType from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person @@ -14,11 +15,11 @@ class MusicRelease(MusicPlaylist): """ type_: str = Field("MusicRelease", const=True, alias='@type') - releaseOf: Optional[Union[List[MusicAlbum], MusicAlbum]] = Field( + releaseOf: Optional[Union[List[Union[MusicAlbum, str]], Union[MusicAlbum, str]]] = Field( None, description="The album this is a release of.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) @@ -26,17 +27,17 @@ class MusicRelease(MusicPlaylist): None, description="The catalog number for the release.", ) - musicReleaseFormat: Optional[Union[List[MusicReleaseFormatType], MusicReleaseFormatType]] = Field( + musicReleaseFormat: Optional[Union[List[Union[MusicReleaseFormatType, str]], Union[MusicReleaseFormatType, str]]] = Field( None, description="Format of this release (the type of recording media used, ie. compact disc, digital media," "LP, etc.).", ) - creditedTo: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + creditedTo: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The group the release is credited to if different than the byArtist. For example, Red" "and Blue is credited to \"Stefani Germanotta Band\", but by Lady Gaga.", ) - recordLabel: Optional[Union[List[Organization], Organization]] = Field( + recordLabel: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The label that issued the release.", ) diff --git a/pydantic_schemaorg/Nerve.py b/pydantic_schemaorg/Nerve.py index a39b625a..95f61793 100644 --- a/pydantic_schemaorg/Nerve.py +++ b/pydantic_schemaorg/Nerve.py @@ -1,6 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure +from typing import List, Optional, Union +from pydantic_schemaorg.Muscle import Muscle +from pydantic_schemaorg.SuperficialAnatomy import SuperficialAnatomy +from pydantic_schemaorg.BrainStructure import BrainStructure class Nerve(AnatomicalStructure): @@ -11,20 +14,20 @@ class Nerve(AnatomicalStructure): """ type_: str = Field("Nerve", const=True, alias='@type') - branch: Any = Field( + branch: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="The branches that delineate from the nerve bundle. Not to be confused with [[branchOf]].", ) - nerveMotor: Any = Field( + nerveMotor: Optional[Union[List[Union[Muscle, str]], Union[Muscle, str]]] = Field( None, description="The neurological pathway extension that involves muscle control.", ) - sensoryUnit: Any = Field( + sensoryUnit: Optional[Union[List[Union[SuperficialAnatomy, AnatomicalStructure, str]], Union[SuperficialAnatomy, AnatomicalStructure, str]]] = Field( None, description="The neurological pathway extension that inputs and sends information to the brain or" "spinal cord.", ) - sourcedFrom: Any = Field( + sourcedFrom: Optional[Union[List[Union[BrainStructure, str]], Union[BrainStructure, str]]] = Field( None, description="The neurological pathway that originates the neurons.", ) diff --git a/pydantic_schemaorg/NewsArticle.py b/pydantic_schemaorg/NewsArticle.py index 1e53f7a4..f8adfca7 100644 --- a/pydantic_schemaorg/NewsArticle.py +++ b/pydantic_schemaorg/NewsArticle.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Article import Article diff --git a/pydantic_schemaorg/NewsMediaOrganization.py b/pydantic_schemaorg/NewsMediaOrganization.py index c129dc89..0eaaee27 100644 --- a/pydantic_schemaorg/NewsMediaOrganization.py +++ b/pydantic_schemaorg/NewsMediaOrganization.py @@ -1,5 +1,8 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.CreativeWork import CreativeWork +from typing import List, Optional, Union +from pydantic_schemaorg.AboutPage import AboutPage +from pydantic_schemaorg.Article import Article from pydantic_schemaorg.Organization import Organization @@ -10,20 +13,20 @@ class NewsMediaOrganization(Organization): """ type_: str = Field("NewsMediaOrganization", const=True, alias='@type') - actionableFeedbackPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + actionableFeedbackPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement" "about public engagement activities (for news media, the newsroom’s), including involving" "the public - digitally or otherwise -- in coverage decisions, reporting and activities" "after publication.", ) - diversityPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + diversityPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]." "For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity" "policy on both staffing and sources, typically providing staffing data.", ) - ethicsPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + ethicsPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic" "and publishing practices, or of a [[Restaurant]], a page describing food source policies." @@ -31,45 +34,45 @@ class NewsMediaOrganization(Organization): "describing the personal, organizational, and corporate standards of behavior expected" "by the organization.", ) - correctionsPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + correctionsPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing" "(in news media, the newsroom’s) disclosure and correction policy for errors.", ) - missionCoveragePrioritiesPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + missionCoveragePrioritiesPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For a [[NewsMediaOrganization]], a statement on coverage priorities, including any" "public agenda or stance on issues.", ) - ownershipFundingInfo: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + ownershipFundingInfo: Optional[Union[List[Union[AnyUrl, str, CreativeWork, AboutPage]], Union[AnyUrl, str, CreativeWork, AboutPage]]] = Field( None, description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]])," "a description of organizational ownership structure; funding and grants. In a news/media" "setting, this is with particular reference to editorial independence. Note that the" "[[funder]] is also available and can be used to make basic funder information machine-readable.", ) - noBylinesPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + noBylinesPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement" "explaining when authors of articles are not named in bylines.", ) - verificationFactCheckingPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + verificationFactCheckingPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Disclosure about verification and fact-checking processes for a [[NewsMediaOrganization]]" "or other fact-checking [[Organization]].", ) - diversityStaffingReport: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + diversityStaffingReport: Optional[Union[List[Union[AnyUrl, Article, str]], Union[AnyUrl, Article, str]]] = Field( None, description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]])," "a report on staffing diversity issues. In a news context this might be for example ASNE" "or RTDNA (US) reports, or self-reported.", ) - unnamedSourcesPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + unnamedSourcesPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about" "policy on use of unnamed sources and the decision process required.", ) - masthead: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + masthead: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For a [[NewsMediaOrganization]], a link to the masthead page or a page listing top editorial" "management.", diff --git a/pydantic_schemaorg/NutritionInformation.py b/pydantic_schemaorg/NutritionInformation.py index 287a3d29..0af33ba1 100644 --- a/pydantic_schemaorg/NutritionInformation.py +++ b/pydantic_schemaorg/NutritionInformation.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Energy import Energy -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Mass import Mass from pydantic_schemaorg.StructuredValue import StructuredValue @@ -12,19 +12,19 @@ class NutritionInformation(StructuredValue): """ type_: str = Field("NutritionInformation", const=True, alias='@type') - calories: Optional[Union[List[Energy], Energy]] = Field( + calories: Optional[Union[List[Union[Energy, str]], Union[Energy, str]]] = Field( None, description="The number of calories.", ) - cholesterolContent: Optional[Union[List[Mass], Mass]] = Field( + cholesterolContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of milligrams of cholesterol.", ) - fatContent: Optional[Union[List[Mass], Mass]] = Field( + fatContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of fat.", ) - transFatContent: Optional[Union[List[Mass], Mass]] = Field( + transFatContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of trans fat.", ) @@ -32,31 +32,31 @@ class NutritionInformation(StructuredValue): None, description="The serving size, in terms of the number of volume or mass.", ) - unsaturatedFatContent: Optional[Union[List[Mass], Mass]] = Field( + unsaturatedFatContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of unsaturated fat.", ) - saturatedFatContent: Optional[Union[List[Mass], Mass]] = Field( + saturatedFatContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of saturated fat.", ) - carbohydrateContent: Optional[Union[List[Mass], Mass]] = Field( + carbohydrateContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of carbohydrates.", ) - proteinContent: Optional[Union[List[Mass], Mass]] = Field( + proteinContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of protein.", ) - sodiumContent: Optional[Union[List[Mass], Mass]] = Field( + sodiumContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of milligrams of sodium.", ) - fiberContent: Optional[Union[List[Mass], Mass]] = Field( + fiberContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of fiber.", ) - sugarContent: Optional[Union[List[Mass], Mass]] = Field( + sugarContent: Optional[Union[List[Union[Mass, str]], Union[Mass, str]]] = Field( None, description="The number of grams of sugar.", ) diff --git a/pydantic_schemaorg/Observation.py b/pydantic_schemaorg/Observation.py index af11779f..288e17e9 100644 --- a/pydantic_schemaorg/Observation.py +++ b/pydantic_schemaorg/Observation.py @@ -1,7 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Property import Property +from typing import List, Optional, Union from datetime import datetime from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.StatisticalPopulation import StatisticalPopulation from pydantic_schemaorg.DataType import DataType from pydantic_schemaorg.Intangible import Intangible @@ -20,25 +22,25 @@ class Observation(Intangible): """ type_: str = Field("Observation", const=True, alias='@type') - measuredProperty: Any = Field( + measuredProperty: Optional[Union[List[Union[Property, str]], Union[Property, str]]] = Field( None, description="The measuredProperty of an [[Observation]], either a schema.org property, a property" "from other RDF-compatible systems e.g. W3C RDF Data Cube, or schema.org extensions" "such as [GS1's](https://www.gs1.org/voc/?show=properties).", ) - observationDate: Optional[Union[List[datetime], datetime]] = Field( + observationDate: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The observationDate of an [[Observation]].", ) - marginOfError: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + marginOfError: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A marginOfError for an [[Observation]].", ) - observedNode: Any = Field( + observedNode: Optional[Union[List[Union[StatisticalPopulation, str]], Union[StatisticalPopulation, str]]] = Field( None, description="The observedNode of an [[Observation]], often a [[StatisticalPopulation]].", ) - measuredValue: Optional[Union[List[DataType], DataType]] = Field( + measuredValue: Optional[Union[List[Union[DataType, str]], Union[DataType, str]]] = Field( None, description="The measuredValue of an [[Observation]].", ) diff --git a/pydantic_schemaorg/Occupation.py b/pydantic_schemaorg/Occupation.py index 8e2abb8e..6786820a 100644 --- a/pydantic_schemaorg/Occupation.py +++ b/pydantic_schemaorg/Occupation.py @@ -1,9 +1,10 @@ from pydantic import Field from pydantic_schemaorg.OccupationalExperienceRequirements import OccupationalExperienceRequirements -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DefinedTerm import DefinedTerm -from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution from decimal import Decimal +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential from pydantic_schemaorg.CategoryCode import CategoryCode @@ -26,14 +27,14 @@ class Occupation(Intangible): description="A statement of knowledge, skill, ability, task or any other assertion expressing a competency" "that is desired or required to fulfill this role or to work in this occupation.", ) - estimatedSalary: Union[List[Union[Decimal, MonetaryAmountDistribution, Any]], Union[Decimal, MonetaryAmountDistribution, Any]] = Field( + estimatedSalary: Optional[Union[List[Union[Decimal, MonetaryAmount, MonetaryAmountDistribution, str]], Union[Decimal, MonetaryAmount, MonetaryAmountDistribution, str]]] = Field( None, description="An estimated salary for a job posting or occupation, based on a variety of variables including," "but not limited to industry, job title, and location. Estimated salaries are often computed" "by outside organizations rather than the hiring organization, who may not have committed" "to the estimated value.", ) - occupationLocation: Optional[Union[List[AdministrativeArea], AdministrativeArea]] = Field( + occupationLocation: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The region/country for which this occupational description is appropriate. Note that" "educational requirements and qualifications can vary between jurisdictions.", diff --git a/pydantic_schemaorg/OccupationalExperienceRequirements.py b/pydantic_schemaorg/OccupationalExperienceRequirements.py index c53daf9c..3e4ee8a8 100644 --- a/pydantic_schemaorg/OccupationalExperienceRequirements.py +++ b/pydantic_schemaorg/OccupationalExperienceRequirements.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Intangible import Intangible @@ -11,7 +11,7 @@ class OccupationalExperienceRequirements(Intangible): """ type_: str = Field("OccupationalExperienceRequirements", const=True, alias='@type') - monthsOfExperience: Optional[Union[List[Decimal], Decimal]] = Field( + monthsOfExperience: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Indicates the minimal number of months of experience required for a position.", ) diff --git a/pydantic_schemaorg/Offer.py b/pydantic_schemaorg/Offer.py index a7c0c63c..5fc8c4d6 100644 --- a/pydantic_schemaorg/Offer.py +++ b/pydantic_schemaorg/Offer.py @@ -1,26 +1,37 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.TypeAndQuantityNode import TypeAndQuantityNode from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place from pydantic_schemaorg.DeliveryMethod import DeliveryMethod from datetime import datetime, time, date +from pydantic_schemaorg.AggregateRating import AggregateRating from pydantic_schemaorg.BusinessEntityType import BusinessEntityType from pydantic_schemaorg.ItemAvailability import ItemAvailability +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.LoanOrCredit import LoanOrCredit from pydantic_schemaorg.PaymentMethod import PaymentMethod -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic_schemaorg.BusinessFunction import BusinessFunction from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory from pydantic_schemaorg.MerchantReturnPolicy import MerchantReturnPolicy from decimal import Decimal from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.WarrantyPromise import WarrantyPromise +from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.MenuItem import MenuItem from pydantic_schemaorg.Event import Event from pydantic_schemaorg.CreativeWork import CreativeWork -from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.AggregateOffer import AggregateOffer from pydantic_schemaorg.Service import Service +from pydantic_schemaorg.Trip import Trip from pydantic_schemaorg.Review import Review from pydantic_schemaorg.OfferItemCondition import OfferItemCondition +from pydantic_schemaorg.OfferShippingDetails import OfferShippingDetails from pydantic_schemaorg.Intangible import Intangible @@ -39,22 +50,22 @@ class Offer(Intangible): """ type_: str = Field("Offer", const=True, alias='@type') - hasMeasurement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + hasMeasurement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A product measurement, for example the inseam of pants, the wheel size of a bicycle, or" "the gauge of a screw. Usually an exact measurement, but can also be a range of measurements" "for adjustable products, for example belts and ski bindings.", ) - includesObject: Any = Field( + includesObject: Optional[Union[List[Union[TypeAndQuantityNode, str]], Union[TypeAndQuantityNode, str]]] = Field( None, description="This links to a node or nodes indicating the exact quantity of the products included in" "an [[Offer]] or [[ProductCollection]].", ) - areaServed: Union[List[Union[str, AdministrativeArea, Place, Any]], Union[str, AdministrativeArea, Place, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) - availableDeliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + availableDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="The delivery method(s) available for this offer.", ) @@ -70,19 +81,19 @@ class Offer(Intangible): "a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - priceValidUntil: Optional[Union[List[date], date]] = Field( + priceValidUntil: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date after which the price is no longer available.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) - eligibleCustomerType: Optional[Union[List[BusinessEntityType], BusinessEntityType]] = Field( + eligibleCustomerType: Optional[Union[List[Union[BusinessEntityType, str]], Union[BusinessEntityType, str]]] = Field( None, description="The type(s) of customers for which the given offer is valid.", ) - availability: Optional[Union[List[ItemAvailability], ItemAvailability]] = Field( + availability: Optional[Union[List[Union[ItemAvailability, str]], Union[ItemAvailability, str]]] = Field( None, description="The availability of this item—for example In stock, Out of stock, Pre-order," "etc.", @@ -93,41 +104,41 @@ class Offer(Intangible): "known as EAN/UCC-8 or 8-digit EAN. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - leaseLength: Union[List[Union[QuantitativeValue, Any]], Union[QuantitativeValue, Any]] = Field( + leaseLength: Optional[Union[List[Union[Duration, QuantitativeValue, str]], Union[Duration, QuantitativeValue, str]]] = Field( None, description="Length of the lease for some [[Accommodation]], either particular to some [[Offer]]" "or in some cases intrinsic to the property.", ) - eligibleTransactionVolume: Optional[Union[List[PriceSpecification], PriceSpecification]] = Field( + eligibleTransactionVolume: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="The transaction volume, in a monetary unit, for which the offer or price specification" "is valid, e.g. for indicating a minimal purchasing volume, to express free shipping" "above a certain order volume, or to limit the acceptance of credit cards to purchases" "to a certain minimal amount.", ) - acceptedPaymentMethod: Union[List[Union[PaymentMethod, Any]], Union[PaymentMethod, Any]] = Field( + acceptedPaymentMethod: Optional[Union[List[Union[LoanOrCredit, PaymentMethod, str]], Union[LoanOrCredit, PaymentMethod, str]]] = Field( None, description="The payment method(s) accepted by seller for this offer.", ) - businessFunction: Any = Field( + businessFunction: Optional[Union[List[Union[BusinessFunction, str]], Union[BusinessFunction, str]]] = Field( None, description="The business function (e.g. sell, lease, repair, dispose) of the offer or component" "of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.", ) - eligibleDuration: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + eligibleDuration: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The duration for which the given offer is valid.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", ) - hasMerchantReturnPolicy: Optional[Union[List[MerchantReturnPolicy], MerchantReturnPolicy]] = Field( + hasMerchantReturnPolicy: Optional[Union[List[Union[MerchantReturnPolicy, str]], Union[MerchantReturnPolicy, str]]] = Field( None, description="Specifies a MerchantReturnPolicy that may be applicable.", ) - availabilityStarts: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityStarts: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The beginning of the availability of the product or service included in the offer.", ) @@ -156,22 +167,22 @@ class Offer(Intangible): "0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially" "similiar Unicode symbols.", ) - eligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + eligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "valid. See also [[ineligibleRegion]].", ) - seller: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + seller: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity which offers (sells / leases / lends / loans) the services / goods. A seller may" "also be a provider.", ) - warranty: Any = Field( + warranty: Optional[Union[List[Union[WarrantyPromise, str]], Union[WarrantyPromise, str]]] = Field( None, description="The warranty promise(s) included in the offer.", ) - deliveryLeadTime: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + deliveryLeadTime: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The typical delay between the receipt of the order and the goods either leaving the warehouse" "or being prepared for pickup, in case the delivery method is on site pickup.", @@ -187,19 +198,19 @@ class Offer(Intangible): "and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - availableAtOrFrom: Optional[Union[List[Place], Place]] = Field( + availableAtOrFrom: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The place(s) from which the offer can be obtained (e.g. store locations).", ) - offeredBy: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + offeredBy: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A pointer to the organization or person making the offer.", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - itemOffered: Union[List[Union[Event, CreativeWork, Product, Service, Any]], Union[Event, CreativeWork, Product, Service, Any]] = Field( + itemOffered: Optional[Union[List[Union[Product, MenuItem, Event, CreativeWork, AggregateOffer, Service, Trip, str]], Union[Product, MenuItem, Event, CreativeWork, AggregateOffer, Service, Trip, str]]] = Field( None, description="An item being offered (or demanded). The transactional nature of the offer or demand" "is documented using [[businessFunction]], e.g. sell, lease etc. While several common" @@ -211,21 +222,21 @@ class Offer(Intangible): description="The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN" "Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.", ) - availabilityEnds: Optional[Union[List[Union[datetime, time, date]], Union[datetime, time, date]]] = Field( + availabilityEnds: Optional[Union[List[Union[datetime, date, time, str]], Union[datetime, date, time, str]]] = Field( None, description="The end of the availability of the product or service included in the offer.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", ) - addOn: Any = Field( + addOn: Optional[Union[List[Union['Offer', str]], Union['Offer', str]]] = Field( None, description="An additional offer that can only be obtained in combination with the first base offer" "(e.g. supplements and extensions that are available for a surcharge).", ) - reviews: Optional[Union[List[Review], Review]] = Field( + reviews: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="Review of the item.", ) @@ -247,43 +258,43 @@ class Offer(Intangible): "and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for" "more details. Left-padding of the gtin values is not required or encouraged.", ) - review: Optional[Union[List[Review], Review]] = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - itemCondition: Optional[Union[List[OfferItemCondition], OfferItemCondition]] = Field( + itemCondition: Optional[Union[List[Union[OfferItemCondition, str]], Union[OfferItemCondition, str]]] = Field( None, description="A predefined value from OfferItemCondition specifying the condition of the product" "or service, or the products or services included in the offer. Also used for product return" "policies to specify the condition of products accepted for returns.", ) - inventoryLevel: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + inventoryLevel: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The current approximate inventory level for the item or items.", ) - advanceBookingRequirement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + advanceBookingRequirement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The amount of time that is required between accepting the offer and the actual usage of" "the resource or service.", ) - priceSpecification: Optional[Union[List[PriceSpecification], PriceSpecification]] = Field( + priceSpecification: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="One or more detailed price specifications, indicating the unit price and delivery or" "payment charges.", ) - ineligibleRegion: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + ineligibleRegion: Optional[Union[List[Union[str, GeoShape, Place]], Union[str, GeoShape, Place]]] = Field( None, description="The ISO 3166-1 (ISO 3166-1 alpha-2) or ISO 3166-2 code, the place, or the GeoShape for" "the geo-political region(s) for which the offer or delivery charge specification is" "not valid, e.g. a region where the transaction is not allowed. See also [[eligibleRegion]].", ) - eligibleQuantity: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + eligibleQuantity: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The interval and unit of measurement of ordering quantities for which the offer or price" "specification is valid. This allows e.g. specifying that a certain freight charge is" "valid only for a certain quantity.", ) - shippingDetails: Any = Field( + shippingDetails: Optional[Union[List[Union[OfferShippingDetails, str]], Union[OfferShippingDetails, str]]] = Field( None, description="Indicates information about the shipping policies and options associated with an [[Offer]].", ) diff --git a/pydantic_schemaorg/OfferShippingDetails.py b/pydantic_schemaorg/OfferShippingDetails.py index f50582fd..8d662dd6 100644 --- a/pydantic_schemaorg/OfferShippingDetails.py +++ b/pydantic_schemaorg/OfferShippingDetails.py @@ -1,6 +1,8 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, StrictBool, Field +from typing import List, Optional, Any, Union from pydantic_schemaorg.DefinedRegion import DefinedRegion +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from pydantic_schemaorg.ShippingDeliveryTime import ShippingDeliveryTime from pydantic_schemaorg.StructuredValue import StructuredValue @@ -21,26 +23,26 @@ class OfferShippingDetails(StructuredValue): description="Label to match an [[OfferShippingDetails]] with a [[ShippingRateSettings]] (within" "the context of a [[shippingSettingsLink]] cross-reference).", ) - doesNotShip: Optional[Union[List[StrictBool], StrictBool]] = Field( + doesNotShip: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates when shipping to a particular [[shippingDestination]] is not available.", ) - shippingDestination: Optional[Union[List[DefinedRegion], DefinedRegion]] = Field( + shippingDestination: Optional[Union[List[Union[DefinedRegion, str]], Union[DefinedRegion, str]]] = Field( None, description="indicates (possibly multiple) shipping destinations. These can be defined in several" "ways e.g. postalCode ranges.", ) - shippingRate: Any = Field( + shippingRate: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="The shipping rate is the cost of shipping to the specified destination. Typically, the" "maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate.", ) - shippingSettingsLink: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + shippingSettingsLink: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Link to a page containing [[ShippingRateSettings]] and [[DeliveryTimeSettings]]" "details.", ) - deliveryTime: Any = Field( + deliveryTime: Optional[Union[List[Union[ShippingDeliveryTime, str]], Union[ShippingDeliveryTime, str]]] = Field( None, description="The total delay between the receipt of the order and the goods reaching the final customer.", ) diff --git a/pydantic_schemaorg/OpeningHoursSpecification.py b/pydantic_schemaorg/OpeningHoursSpecification.py index a5019fd1..f1efae1f 100644 --- a/pydantic_schemaorg/OpeningHoursSpecification.py +++ b/pydantic_schemaorg/OpeningHoursSpecification.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime, time, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DayOfWeek import DayOfWeek from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,24 +15,24 @@ class OpeningHoursSpecification(StructuredValue): """ type_: str = Field("OpeningHoursSpecification", const=True, alias='@type') - opens: Optional[Union[List[time], time]] = Field( + opens: Optional[Union[List[Union[time, str]], Union[time, str]]] = Field( None, description="The opening hour of the place or service on the given day(s) of the week.", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", ) - closes: Optional[Union[List[time], time]] = Field( + closes: Optional[Union[List[Union[time, str]], Union[time, str]]] = Field( None, description="The closing hour of the place or service on the given day(s) of the week.", ) - dayOfWeek: Optional[Union[List[DayOfWeek], DayOfWeek]] = Field( + dayOfWeek: Optional[Union[List[Union[DayOfWeek, str]], Union[DayOfWeek, str]]] = Field( None, description="The day of the week for which these opening hours are valid.", ) diff --git a/pydantic_schemaorg/Order.py b/pydantic_schemaorg/Order.py index 91c32571..a2bc2a9f 100644 --- a/pydantic_schemaorg/Order.py +++ b/pydantic_schemaorg/Order.py @@ -1,9 +1,18 @@ -from pydantic import StrictBool, Field, AnyUrl +from pydantic import AnyUrl, StrictBool, Field from datetime import datetime, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.ParcelDelivery import ParcelDelivery +from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.OrderItem import OrderItem +from pydantic_schemaorg.Service import Service +from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.OrderStatus import OrderStatus +from pydantic_schemaorg.Invoice import Invoice +from pydantic_schemaorg.Offer import Offer +from pydantic_schemaorg.PaymentMethod import PaymentMethod from pydantic_schemaorg.Intangible import Intangible @@ -15,11 +24,11 @@ class Order(Intangible): """ type_: str = Field("Order", const=True, alias='@type') - orderDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + orderDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Date order was placed.", ) - paymentDue: Optional[Union[List[datetime], datetime]] = Field( + paymentDue: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date that payment is due.", ) @@ -35,7 +44,7 @@ class Order(Intangible): None, description="An identifier for the method of payment used (e.g. the last 4 digits of the credit card).", ) - orderDelivery: Any = Field( + orderDelivery: Optional[Union[List[Union[ParcelDelivery, str]], Union[ParcelDelivery, str]]] = Field( None, description="The delivery of the parcel related to this order or order item.", ) @@ -46,36 +55,36 @@ class Order(Intangible): "for cryptocurrencies e.g. \"BTC\"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)" "(LETS) and other currency types e.g. \"Ithaca HOUR\".", ) - isGift: Optional[Union[List[StrictBool], StrictBool]] = Field( + isGift: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Was the offer accepted as a gift for someone other than the buyer.", ) - orderedItem: Any = Field( + orderedItem: Optional[Union[List[Union[Product, OrderItem, Service, str]], Union[Product, OrderItem, Service, str]]] = Field( None, description="The item ordered.", ) - billingAddress: Any = Field( + billingAddress: Optional[Union[List[Union[PostalAddress, str]], Union[PostalAddress, str]]] = Field( None, description="The billing address for the order.", ) - customer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + customer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="Party placing the order or paying the invoice.", ) - seller: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + seller: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity which offers (sells / leases / lends / loans) the services / goods. A seller may" "also be a provider.", ) - orderStatus: Any = Field( + orderStatus: Optional[Union[List[Union[OrderStatus, str]], Union[OrderStatus, str]]] = Field( None, description="The current status of the order.", ) - partOfInvoice: Any = Field( + partOfInvoice: Optional[Union[List[Union[Invoice, str]], Union[Invoice, str]]] = Field( None, description="The order is being paid as part of the referenced Invoice.", ) - paymentDueDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + paymentDueDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date that payment is due.", ) @@ -87,23 +96,23 @@ class Order(Intangible): None, description="The identifier of the transaction.", ) - acceptedOffer: Any = Field( + acceptedOffer: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="The offer(s) -- e.g., product, quantity and price combinations -- included in the order.", ) - merchant: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + merchant: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="'merchant' is an out-dated term for 'seller'.", ) - paymentUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + paymentUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The URL for sending a payment.", ) - paymentMethod: Any = Field( + paymentMethod: Optional[Union[List[Union[PaymentMethod, str]], Union[PaymentMethod, str]]] = Field( None, description="The name of the credit card or other method of payment for the order.", ) - broker: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + broker: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity that arranges for an exchange between a buyer and a seller. In most cases a broker" "never acquires or releases ownership of a product or service involved in an exchange." diff --git a/pydantic_schemaorg/OrderAction.py b/pydantic_schemaorg/OrderAction.py index ab70bef0..25db3ef6 100644 --- a/pydantic_schemaorg/OrderAction.py +++ b/pydantic_schemaorg/OrderAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.DeliveryMethod import DeliveryMethod -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TradeAction import TradeAction @@ -11,7 +11,7 @@ class OrderAction(TradeAction): """ type_: str = Field("OrderAction", const=True, alias='@type') - deliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + deliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="A sub property of instrument. The method of delivery.", ) diff --git a/pydantic_schemaorg/OrderItem.py b/pydantic_schemaorg/OrderItem.py index fd137523..d192a299 100644 --- a/pydantic_schemaorg/OrderItem.py +++ b/pydantic_schemaorg/OrderItem.py @@ -1,7 +1,8 @@ from pydantic import Field -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Service import Service +from pydantic_schemaorg.ParcelDelivery import ParcelDelivery +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.Service import Service from decimal import Decimal from pydantic_schemaorg.OrderStatus import OrderStatus from pydantic_schemaorg.Intangible import Intangible @@ -15,15 +16,15 @@ class OrderItem(Intangible): """ type_: str = Field("OrderItem", const=True, alias='@type') - orderDelivery: Any = Field( + orderDelivery: Optional[Union[List[Union[ParcelDelivery, str]], Union[ParcelDelivery, str]]] = Field( None, description="The delivery of the parcel related to this order or order item.", ) - orderedItem: Union[List[Union[Service, Product, Any]], Union[Service, Product, Any]] = Field( + orderedItem: Optional[Union[List[Union[Product, 'OrderItem', Service, str]], Union[Product, 'OrderItem', Service, str]]] = Field( None, description="The item ordered.", ) - orderQuantity: Optional[Union[List[Decimal], Decimal]] = Field( + orderQuantity: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The number of the item ordered. If the property is not set, assume the quantity is one.", ) @@ -31,7 +32,7 @@ class OrderItem(Intangible): None, description="The identifier of the order item.", ) - orderItemStatus: Optional[Union[List[OrderStatus], OrderStatus]] = Field( + orderItemStatus: Optional[Union[List[Union[OrderStatus, str]], Union[OrderStatus, str]]] = Field( None, description="The current status of the order item.", ) diff --git a/pydantic_schemaorg/Organization.py b/pydantic_schemaorg/Organization.py index e8c450a2..3bce08d0 100644 --- a/pydantic_schemaorg/Organization.py +++ b/pydantic_schemaorg/Organization.py @@ -1,7 +1,34 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.ContactPoint import ContactPoint +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape +from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.AggregateRating import AggregateRating +from pydantic_schemaorg.Language import Language +from pydantic_schemaorg.Brand import Brand +from pydantic_schemaorg.MerchantReturnPolicy import MerchantReturnPolicy +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.VirtualLocation import VirtualLocation +from pydantic_schemaorg.InteractionCounter import InteractionCounter +from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential +from pydantic_schemaorg.NonprofitType import NonprofitType +from pydantic_schemaorg.ProgramMembership import ProgramMembership +from pydantic_schemaorg.ImageObject import ImageObject from datetime import date +from pydantic_schemaorg.Offer import Offer +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.OfferCatalog import OfferCatalog +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.AboutPage import AboutPage +from pydantic_schemaorg.Review import Review +from pydantic_schemaorg.Demand import Demand +from pydantic_schemaorg.Article import Article from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.OwnershipInfo import OwnershipInfo class Organization(Thing): @@ -11,31 +38,31 @@ class Organization(Thing): """ type_: str = Field("Organization", const=True, alias='@type') - subOrganization: Any = Field( + subOrganization: Optional[Union[List[Union['Organization', str]], Union['Organization', str]]] = Field( None, description="A relationship between two organizations where the first includes the second, e.g.," "as a subsidiary. See also: the more specific 'department' property.", ) - contactPoint: Any = Field( + contactPoint: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="A contact point for a person or organization.", ) - areaServed: Union[List[Union[str, Any]], Union[str, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) - actionableFeedbackPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + actionableFeedbackPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For a [[NewsMediaOrganization]] or other news-related [[Organization]], a statement" "about public engagement activities (for news media, the newsroom’s), including involving" "the public - digitally or otherwise -- in coverage decisions, reporting and activities" "after publication.", ) - parentOrganization: Any = Field( + parentOrganization: Optional[Union[List[Union['Organization', str]], Union['Organization', str]]] = Field( None, description="The larger organization that this organization is a [[subOrganization]] of, if any.", ) - funder: Any = Field( + funder: Optional[Union[List[Union['Organization', Person, str]], Union['Organization', Person, str]]] = Field( None, description="A person or organization that supports (sponsors) something through some kind of financial" "contribution.", @@ -46,21 +73,21 @@ class Organization(Thing): "to as International Location Number or ILN) of the respective organization, person," "or place. The GLN is a 13-digit number used to identify parties and physical locations.", ) - employees: Any = Field( + employees: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="People working for this organization.", ) - diversityPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + diversityPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Statement on diversity policy by an [[Organization]] e.g. a [[NewsMediaOrganization]]." "For a [[NewsMediaOrganization]], a statement describing the newsroom’s diversity" "policy on both staffing and sources, typically providing staffing data.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) - knowsLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + knowsLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language." "We do not distinguish skill levels or reading/writing/speaking/signing here. Use" @@ -70,11 +97,11 @@ class Organization(Thing): None, description="An award won by or for this item.", ) - foundingLocation: Any = Field( + foundingLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The place where the Organization was founded.", ) - publishingPrinciples: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + publishingPrinciples: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing" "the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing" @@ -89,7 +116,7 @@ class Organization(Thing): description="The International Standard of Industrial Classification of All Economic Activities" "(ISIC), Revision 4 code for a particular organization, business person, or place.", ) - member: Any = Field( + member: Optional[Union[List[Union['Organization', Person, str]], Union['Organization', Person, str]]] = Field( None, description="A member of an Organization or a ProgramMembership. Organizations can be members of" "organizations; ProgramMembership is typically for individuals.", @@ -99,11 +126,11 @@ class Organization(Thing): description="The North American Industry Classification System (NAICS) code for a particular organization" "or business person.", ) - employee: Any = Field( + employee: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Someone working for this organization.", ) - brand: Any = Field( + brand: Optional[Union[List[Union['Organization', Brand, str]], Union['Organization', Brand, str]]] = Field( None, description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization" "or business person.", @@ -112,30 +139,30 @@ class Organization(Thing): None, description="The Dun & Bradstreet DUNS number for identifying an organization or business person.", ) - hasMerchantReturnPolicy: Any = Field( + hasMerchantReturnPolicy: Optional[Union[List[Union[MerchantReturnPolicy, str]], Union[MerchantReturnPolicy, str]]] = Field( None, description="Specifies a MerchantReturnPolicy that may be applicable.", ) - location: Union[List[Union[str, Any]], Union[str, Any]] = Field( + location: Optional[Union[List[Union[str, PostalAddress, VirtualLocation, Place]], Union[str, PostalAddress, VirtualLocation, Place]]] = Field( None, description="The location of, for example, where an event is happening, where an organization is located," "or where an action takes place.", ) - interactionStatistic: Any = Field( + interactionStatistic: Optional[Union[List[Union[InteractionCounter, str]], Union[InteractionCounter, str]]] = Field( None, description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication." "The most specific child type of InteractionCounter should be used.", ) - hasCredential: Any = Field( + hasCredential: Optional[Union[List[Union[EducationalOccupationalCredential, str]], Union[EducationalOccupationalCredential, str]]] = Field( None, description="A credential awarded to the Person or Organization.", ) - nonprofitStatus: Any = Field( + nonprofitStatus: Optional[Union[List[Union[NonprofitType, str]], Union[NonprofitType, str]]] = Field( None, description="nonprofit Status indicates the legal status of a non-profit organization in its primary" "place of business.", ) - ethicsPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + ethicsPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Statement about ethics policy, e.g. of a [[NewsMediaOrganization]] regarding journalistic" "and publishing practices, or of a [[Restaurant]], a page describing food source policies." @@ -143,12 +170,12 @@ class Organization(Thing): "describing the personal, organizational, and corporate standards of behavior expected" "by the organization.", ) - correctionsPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + correctionsPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For an [[Organization]] (e.g. [[NewsMediaOrganization]]), a statement describing" "(in news media, the newsroom’s) disclosure and correction policy for errors.", ) - memberOf: Any = Field( + memberOf: Optional[Union[List[Union[ProgramMembership, 'Organization', str]], Union[ProgramMembership, 'Organization', str]]] = Field( None, description="An Organization (or ProgramMembership) to which this Person or Organization belongs.", ) @@ -156,7 +183,7 @@ class Organization(Thing): None, description="A slogan or motto associated with the item.", ) - department: Any = Field( + department: Optional[Union[List[Union['Organization', str]], Union['Organization', str]]] = Field( None, description="A relationship between an organization and a department of that organization, also" "described as an organization (allowing different urls, logos, opening hours). For" @@ -171,19 +198,19 @@ class Organization(Thing): description="An organization identifier that uniquely identifies a legal entity as defined in ISO" "17442.", ) - founders: Any = Field( + founders: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person who founded this organization.", ) - logo: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + logo: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An associated logo.", ) - members: Any = Field( + members: Optional[Union[List[Union['Organization', Person, str]], Union['Organization', Person, str]]] = Field( None, description="A member of this organization.", ) - foundingDate: Optional[Union[List[date], date]] = Field( + foundingDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date that this organization was founded.", ) @@ -191,32 +218,32 @@ class Organization(Thing): None, description="Awards won by or for this item.", ) - makesOffer: Any = Field( + makesOffer: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="A pointer to products or services offered by the organization or person.", ) - address: Union[List[Union[str, Any]], Union[str, Any]] = Field( + address: Optional[Union[List[Union[str, PostalAddress]], Union[str, PostalAddress]]] = Field( None, description="Physical address of the item.", ) - dissolutionDate: Optional[Union[List[date], date]] = Field( + dissolutionDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date that this organization was dissolved.", ) - alumni: Any = Field( + alumni: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="Alumni of an organization.", ) - sponsor: Any = Field( + sponsor: Optional[Union[List[Union['Organization', Person, str]], Union['Organization', Person, str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", ) - events: Any = Field( + events: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past events associated with this place or organization.", ) - serviceArea: Any = Field( + serviceArea: Optional[Union[List[Union[AdministrativeArea, GeoShape, Place, str]], Union[AdministrativeArea, GeoShape, Place, str]]] = Field( None, description="The geographic area where the service is provided.", ) @@ -229,26 +256,26 @@ class Organization(Thing): description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in" "Spain.", ) - hasOfferCatalog: Any = Field( + hasOfferCatalog: Optional[Union[List[Union[OfferCatalog, str]], Union[OfferCatalog, str]]] = Field( None, description="Indicates an OfferCatalog listing for this Organization, Person, or Service.", ) - numberOfEmployees: Any = Field( + numberOfEmployees: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The number of employees in an organization e.g. business.", ) - ownershipFundingInfo: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + ownershipFundingInfo: Optional[Union[List[Union[AnyUrl, str, CreativeWork, AboutPage]], Union[AnyUrl, str, CreativeWork, AboutPage]]] = Field( None, description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]])," "a description of organizational ownership structure; funding and grants. In a news/media" "setting, this is with particular reference to editorial independence. Note that the" "[[funder]] is also available and can be used to make basic funder information machine-readable.", ) - founder: Any = Field( + founder: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person who founded this organization.", ) - reviews: Any = Field( + reviews: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="Review of the item.", ) @@ -256,19 +283,19 @@ class Organization(Thing): None, description="The telephone number.", ) - hasPOS: Any = Field( + hasPOS: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="Points-of-Sales operated by the organization or person.", ) - review: Any = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - seeks: Any = Field( + seeks: Optional[Union[List[Union[Demand, str]], Union[Demand, str]]] = Field( None, description="A pointer to products or services sought by the organization or person (demand).", ) - contactPoints: Any = Field( + contactPoints: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="A contact point for a person or organization.", ) @@ -276,25 +303,25 @@ class Organization(Thing): None, description="The official name of the organization, e.g. the registered company name.", ) - diversityStaffingReport: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + diversityStaffingReport: Optional[Union[List[Union[AnyUrl, Article, str]], Union[AnyUrl, Article, str]]] = Field( None, description="For an [[Organization]] (often but not necessarily a [[NewsMediaOrganization]])," "a report on staffing diversity issues. In a news context this might be for example ASNE" "or RTDNA (US) reports, or self-reported.", ) - unnamedSourcesPolicy: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + unnamedSourcesPolicy: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="For an [[Organization]] (typically a [[NewsMediaOrganization]]), a statement about" "policy on use of unnamed sources and the decision process required.", ) - knowsAbout: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + knowsAbout: Optional[Union[List[Union[AnyUrl, str, Thing]], Union[AnyUrl, str, Thing]]] = Field( None, description="Of a [[Person]], and less typically of an [[Organization]], to indicate a topic that" "is known about - suggesting possible expertise but not implying it. We do not distinguish" "skill levels here, or relate this to educational content, events, objectives or [[JobPosting]]" "descriptions.", ) - event: Any = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) @@ -302,7 +329,7 @@ class Organization(Thing): None, description="The fax number.", ) - owns: Any = Field( + owns: Optional[Union[List[Union[Product, OwnershipInfo, str]], Union[Product, OwnershipInfo, str]]] = Field( None, description="Products owned by the organization or person.", ) diff --git a/pydantic_schemaorg/OrganizationRole.py b/pydantic_schemaorg/OrganizationRole.py index 3d51b14e..7eb7e645 100644 --- a/pydantic_schemaorg/OrganizationRole.py +++ b/pydantic_schemaorg/OrganizationRole.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Role import Role @@ -11,7 +11,7 @@ class OrganizationRole(Role): """ type_: str = Field("OrganizationRole", const=True, alias='@type') - numberedPosition: Optional[Union[List[Decimal], Decimal]] = Field( + numberedPosition: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="A number associated with a role in an organization, for example, the number on an athlete's" "jersey.", diff --git a/pydantic_schemaorg/OwnershipInfo.py b/pydantic_schemaorg/OwnershipInfo.py index db29dff7..1e207e2f 100644 --- a/pydantic_schemaorg/OwnershipInfo.py +++ b/pydantic_schemaorg/OwnershipInfo.py @@ -1,9 +1,9 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Service import Service +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.Service import Service from datetime import datetime from pydantic_schemaorg.StructuredValue import StructuredValue @@ -16,19 +16,19 @@ class OwnershipInfo(StructuredValue): """ type_: str = Field("OwnershipInfo", const=True, alias='@type') - acquiredFrom: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + acquiredFrom: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The organization or person from which the product was acquired.", ) - typeOfGood: Optional[Union[List[Union[Service, Product]], Union[Service, Product]]] = Field( + typeOfGood: Optional[Union[List[Union[Product, Service, str]], Union[Product, Service, str]]] = Field( None, description="The product that this structured value is referring to.", ) - ownedThrough: Optional[Union[List[datetime], datetime]] = Field( + ownedThrough: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date and time of giving up ownership on the product.", ) - ownedFrom: Optional[Union[List[datetime], datetime]] = Field( + ownedFrom: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date and time of obtaining the product.", ) diff --git a/pydantic_schemaorg/PalliativeProcedure.py b/pydantic_schemaorg/PalliativeProcedure.py index f87cccc5..271c3b5b 100644 --- a/pydantic_schemaorg/PalliativeProcedure.py +++ b/pydantic_schemaorg/PalliativeProcedure.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalProcedure import MedicalProcedure +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy -class PalliativeProcedure(MedicalTherapy, MedicalProcedure): +class PalliativeProcedure(MedicalProcedure, MedicalTherapy): """A medical procedure intended primarily for palliative purposes, aimed at relieving" "the symptoms of an underlying health condition. diff --git a/pydantic_schemaorg/ParcelDelivery.py b/pydantic_schemaorg/ParcelDelivery.py index 3aaf22b9..6dbb0ab6 100644 --- a/pydantic_schemaorg/ParcelDelivery.py +++ b/pydantic_schemaorg/ParcelDelivery.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product from datetime import datetime, date from pydantic_schemaorg.PostalAddress import PostalAddress @@ -22,50 +22,50 @@ class ParcelDelivery(Intangible): None, description="Shipper tracking number.", ) - itemShipped: Optional[Union[List[Product], Product]] = Field( + itemShipped: Optional[Union[List[Union[Product, str]], Union[Product, str]]] = Field( None, description="Item(s) being shipped.", ) - trackingUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + trackingUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Tracking url for the parcel delivery.", ) - expectedArrivalFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + expectedArrivalFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The earliest date the package may arrive.", ) - expectedArrivalUntil: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + expectedArrivalUntil: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The latest date the package may arrive.", ) - deliveryAddress: Optional[Union[List[PostalAddress], PostalAddress]] = Field( + deliveryAddress: Optional[Union[List[Union[PostalAddress, str]], Union[PostalAddress, str]]] = Field( None, description="Destination address.", ) - hasDeliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + hasDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="Method used for delivery or shipping.", ) - carrier: Optional[Union[List[Organization], Organization]] = Field( + carrier: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="'carrier' is an out-dated term indicating the 'provider' for parcel delivery and flights.", ) - originAddress: Optional[Union[List[PostalAddress], PostalAddress]] = Field( + originAddress: Optional[Union[List[Union[PostalAddress, str]], Union[PostalAddress, str]]] = Field( None, description="Shipper's address.", ) - provider: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." "A provider may also serve as the seller.", ) - deliveryStatus: Optional[Union[List[DeliveryEvent], DeliveryEvent]] = Field( + deliveryStatus: Optional[Union[List[Union[DeliveryEvent, str]], Union[DeliveryEvent, str]]] = Field( None, description="New entry added as the package passes through each leg of its journey (from shipment to" "final delivery).", ) - partOfOrder: Optional[Union[List[Order], Order]] = Field( + partOfOrder: Optional[Union[List[Union[Order, str]], Union[Order, str]]] = Field( None, description="The overall order the items in this delivery were included in.", ) diff --git a/pydantic_schemaorg/ParentAudience.py b/pydantic_schemaorg/ParentAudience.py index 11625cb2..f6f1c2ca 100644 --- a/pydantic_schemaorg/ParentAudience.py +++ b/pydantic_schemaorg/ParentAudience.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PeopleAudience import PeopleAudience @@ -11,11 +11,11 @@ class ParentAudience(PeopleAudience): """ type_: str = Field("ParentAudience", const=True, alias='@type') - childMinAge: Optional[Union[List[Decimal], Decimal]] = Field( + childMinAge: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Minimal age of the child.", ) - childMaxAge: Optional[Union[List[Decimal], Decimal]] = Field( + childMaxAge: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Maximal age of the child.", ) diff --git a/pydantic_schemaorg/PathologyTest.py b/pydantic_schemaorg/PathologyTest.py index 55427c1c..14f9190d 100644 --- a/pydantic_schemaorg/PathologyTest.py +++ b/pydantic_schemaorg/PathologyTest.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.MedicalTest import MedicalTest diff --git a/pydantic_schemaorg/Patient.py b/pydantic_schemaorg/Patient.py index cbd943dd..97f49f25 100644 --- a/pydantic_schemaorg/Patient.py +++ b/pydantic_schemaorg/Patient.py @@ -1,28 +1,28 @@ from pydantic import Field from pydantic_schemaorg.MedicalCondition import MedicalCondition -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Drug import Drug -from pydantic_schemaorg.Person import Person from pydantic_schemaorg.MedicalAudience import MedicalAudience +from pydantic_schemaorg.Person import Person -class Patient(Person, MedicalAudience): +class Patient(MedicalAudience, Person): """A patient is any person recipient of health care services. See https://schema.org/Patient. """ type_: str = Field("Patient", const=True, alias='@type') - diagnosis: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + diagnosis: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="One or more alternative conditions considered in the differential diagnosis process" "as output of a diagnosis process.", ) - healthCondition: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + healthCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="Specifying the health condition(s) of a patient, medical study, or other target audience.", ) - drug: Optional[Union[List[Drug], Drug]] = Field( + drug: Optional[Union[List[Union[Drug, str]], Union[Drug, str]]] = Field( None, description="Specifying a drug or medicine used in a medication procedure.", ) diff --git a/pydantic_schemaorg/PayAction.py b/pydantic_schemaorg/PayAction.py index 6ae86b46..5f4534cf 100644 --- a/pydantic_schemaorg/PayAction.py +++ b/pydantic_schemaorg/PayAction.py @@ -1,8 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TradeAction import TradeAction @@ -13,7 +14,7 @@ class PayAction(TradeAction): """ type_: str = Field("PayAction", const=True, alias='@type') - recipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/PaymentCard.py b/pydantic_schemaorg/PaymentCard.py index 242e4fbf..ddf4c5c8 100644 --- a/pydantic_schemaorg/PaymentCard.py +++ b/pydantic_schemaorg/PaymentCard.py @@ -1,6 +1,7 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.PaymentMethod import PaymentMethod from pydantic_schemaorg.FinancialProduct import FinancialProduct @@ -13,20 +14,20 @@ class PaymentCard(PaymentMethod, FinancialProduct): """ type_: str = Field("PaymentCard", const=True, alias='@type') - contactlessPayment: Optional[Union[List[StrictBool], StrictBool]] = Field( + contactlessPayment: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A secure method for consumers to purchase products or services via debit, credit or smartcards" "by using RFID or NFC technology.", ) - cashBack: Optional[Union[List[Union[Decimal, StrictBool]], Union[Decimal, StrictBool]]] = Field( + cashBack: Optional[Union[List[Union[Decimal, StrictBool, str]], Union[Decimal, StrictBool, str]]] = Field( None, description="A cardholder benefit that pays the cardholder a small percentage of their net expenditures.", ) - floorLimit: Any = Field( + floorLimit: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="A floor limit is the amount of money above which credit card transactions must be authorized.", ) - monthlyMinimumRepaymentAmount: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + monthlyMinimumRepaymentAmount: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="The minimum payment is the lowest amount of money that one is required to pay on a credit" "card statement each month.", diff --git a/pydantic_schemaorg/PaymentChargeSpecification.py b/pydantic_schemaorg/PaymentChargeSpecification.py index 6dbd244f..0eb66fd4 100644 --- a/pydantic_schemaorg/PaymentChargeSpecification.py +++ b/pydantic_schemaorg/PaymentChargeSpecification.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.DeliveryMethod import DeliveryMethod -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PaymentMethod import PaymentMethod from pydantic_schemaorg.PriceSpecification import PriceSpecification @@ -12,12 +12,12 @@ class PaymentChargeSpecification(PriceSpecification): """ type_: str = Field("PaymentChargeSpecification", const=True, alias='@type') - appliesToDeliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + appliesToDeliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="The delivery method(s) to which the delivery charge or payment charge specification" "applies.", ) - appliesToPaymentMethod: Optional[Union[List[PaymentMethod], PaymentMethod]] = Field( + appliesToPaymentMethod: Optional[Union[List[Union[PaymentMethod, str]], Union[PaymentMethod, str]]] = Field( None, description="The payment method(s) to which the payment charge specification applies.", ) diff --git a/pydantic_schemaorg/PeopleAudience.py b/pydantic_schemaorg/PeopleAudience.py index 94c77dd5..36071ba6 100644 --- a/pydantic_schemaorg/PeopleAudience.py +++ b/pydantic_schemaorg/PeopleAudience.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.GenderType import GenderType -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from decimal import Decimal from pydantic_schemaorg.MedicalCondition import MedicalCondition @@ -19,24 +19,24 @@ class PeopleAudience(Audience): description="The suggested gender of the intended person or audience, for example \"male\", \"female\"," "or \"unisex\".", ) - requiredMaxAge: Optional[Union[List[int], int]] = Field( + requiredMaxAge: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Audiences defined by a person's maximum age.", ) - suggestedAge: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + suggestedAge: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The age or age range for the intended audience or person, for example 3-12 months for infants," "1-5 years for toddlers.", ) - suggestedMaxAge: Optional[Union[List[Decimal], Decimal]] = Field( + suggestedMaxAge: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Maximum recommended age in years for the audience or user.", ) - suggestedMinAge: Optional[Union[List[Decimal], Decimal]] = Field( + suggestedMinAge: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Minimum recommended age in years for the audience or user.", ) - suggestedMeasurement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + suggestedMeasurement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A suggested range of body measurements for the intended audience or person, for example" "inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size" @@ -46,11 +46,11 @@ class PeopleAudience(Audience): None, description="Audiences defined by a person's gender.", ) - healthCondition: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + healthCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="Specifying the health condition(s) of a patient, medical study, or other target audience.", ) - requiredMinAge: Optional[Union[List[int], int]] = Field( + requiredMinAge: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Audiences defined by a person's minimum age.", ) diff --git a/pydantic_schemaorg/PerformAction.py b/pydantic_schemaorg/PerformAction.py index ddfd9f60..558f984a 100644 --- a/pydantic_schemaorg/PerformAction.py +++ b/pydantic_schemaorg/PerformAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.EntertainmentBusiness import EntertainmentBusiness -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PlayAction import PlayAction @@ -11,7 +11,7 @@ class PerformAction(PlayAction): """ type_: str = Field("PerformAction", const=True, alias='@type') - entertainmentBusiness: Optional[Union[List[EntertainmentBusiness], EntertainmentBusiness]] = Field( + entertainmentBusiness: Optional[Union[List[Union[EntertainmentBusiness, str]], Union[EntertainmentBusiness, str]]] = Field( None, description="A sub property of location. The entertainment business where the action occurred.", ) diff --git a/pydantic_schemaorg/PerformanceRole.py b/pydantic_schemaorg/PerformanceRole.py index a645766e..74dd268c 100644 --- a/pydantic_schemaorg/PerformanceRole.py +++ b/pydantic_schemaorg/PerformanceRole.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Role import Role diff --git a/pydantic_schemaorg/Permit.py b/pydantic_schemaorg/Permit.py index 82df6d0f..23cf5a8c 100644 --- a/pydantic_schemaorg/Permit.py +++ b/pydantic_schemaorg/Permit.py @@ -1,8 +1,11 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Service import Service +from typing import List, Optional, Union +from pydantic_schemaorg.Duration import Duration from datetime import datetime, date from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea from pydantic_schemaorg.Intangible import Intangible @@ -13,31 +16,31 @@ class Permit(Intangible): """ type_: str = Field("Permit", const=True, alias='@type') - issuedThrough: Any = Field( + issuedThrough: Optional[Union[List[Union[Service, str]], Union[Service, str]]] = Field( None, description="The service through with the permit was granted.", ) - validFor: Any = Field( + validFor: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of validity of a permit or similar thing.", ) - validUntil: Optional[Union[List[date], date]] = Field( + validUntil: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date when the item is no longer valid.", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - permitAudience: Optional[Union[List[Audience], Audience]] = Field( + permitAudience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="The target audience for this permit.", ) - issuedBy: Optional[Union[List[Organization], Organization]] = Field( + issuedBy: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The organization issuing the ticket or permit.", ) - validIn: Any = Field( + validIn: Optional[Union[List[Union[AdministrativeArea, str]], Union[AdministrativeArea, str]]] = Field( None, description="The geographic area where a permit or similar thing is valid.", ) diff --git a/pydantic_schemaorg/Person.py b/pydantic_schemaorg/Person.py index 6954468b..002dff10 100644 --- a/pydantic_schemaorg/Person.py +++ b/pydantic_schemaorg/Person.py @@ -1,10 +1,32 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.ContactPoint import ContactPoint +from typing import List, Optional, Union +from pydantic_schemaorg.DefinedTerm import DefinedTerm +from pydantic_schemaorg.Country import Country from pydantic_schemaorg.Place import Place from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.EducationalOrganization import EducationalOrganization +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.Language import Language +from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.GenderType import GenderType +from pydantic_schemaorg.Brand import Brand +from pydantic_schemaorg.InteractionCounter import InteractionCounter +from pydantic_schemaorg.EducationalOccupationalCredential import EducationalOccupationalCredential +from pydantic_schemaorg.ProgramMembership import ProgramMembership +from pydantic_schemaorg.Distance import Distance from datetime import date +from pydantic_schemaorg.Offer import Offer +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.Occupation import Occupation +from pydantic_schemaorg.OfferCatalog import OfferCatalog +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.Demand import Demand from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.OwnershipInfo import OwnershipInfo class Person(Thing): @@ -14,19 +36,19 @@ class Person(Thing): """ type_: str = Field("Person", const=True, alias='@type') - contactPoint: Any = Field( + contactPoint: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="A contact point for a person or organization.", ) - colleagues: Any = Field( + colleagues: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A colleague of the person.", ) - jobTitle: Union[List[Union[str, Any]], Union[str, Any]] = Field( + jobTitle: Optional[Union[List[Union[str, DefinedTerm]], Union[str, DefinedTerm]]] = Field( None, description="The job title of the person (for example, Financial Manager).", ) - nationality: Any = Field( + nationality: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="Nationality of the person.", ) @@ -34,15 +56,15 @@ class Person(Thing): None, description="An honorific prefix preceding a Person's name such as Dr/Mrs/Mr.", ) - workLocation: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + workLocation: Optional[Union[List[Union[ContactPoint, Place, str]], Union[ContactPoint, Place, str]]] = Field( None, description="A contact location for a person's place of work.", ) - alumniOf: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + alumniOf: Optional[Union[List[Union[Organization, EducationalOrganization, str]], Union[Organization, EducationalOrganization, str]]] = Field( None, description="An organization that the person is an alumni of.", ) - funder: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + funder: Optional[Union[List[Union[Organization, 'Person', str]], Union[Organization, 'Person', str]]] = Field( None, description="A person or organization that supports (sponsors) something through some kind of financial" "contribution.", @@ -53,17 +75,17 @@ class Person(Thing): "to as International Location Number or ILN) of the respective organization, person," "or place. The GLN is a 13-digit number used to identify parties and physical locations.", ) - weight: Any = Field( + weight: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The weight of the product or person.", ) - knowsLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + knowsLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="Of a [[Person]], and less typically of an [[Organization]], to indicate a known language." "We do not distinguish skill levels or reading/writing/speaking/signing here. Use" "language codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47).", ) - netWorth: Any = Field( + netWorth: Optional[Union[List[Union[PriceSpecification, MonetaryAmount, str]], Union[PriceSpecification, MonetaryAmount, str]]] = Field( None, description="The total financial value of the person as calculated by subtracting assets from liabilities.", ) @@ -71,7 +93,7 @@ class Person(Thing): None, description="An award won by or for this item.", ) - relatedTo: Any = Field( + relatedTo: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="The most generic familial relation.", ) @@ -79,7 +101,7 @@ class Person(Thing): None, description="An honorific suffix following a Person's name such as M.D. /PhD/MSCSW.", ) - publishingPrinciples: Optional[Union[List[Union[AnyUrl, CreativeWork]], Union[AnyUrl, CreativeWork]]] = Field( + publishingPrinciples: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="The publishingPrinciples property indicates (typically via [[URL]]) a document describing" "the editorial principles of an [[Organization]] (or individual e.g. a [[Person]] writing" @@ -94,15 +116,15 @@ class Person(Thing): description="The International Standard of Industrial Classification of All Economic Activities" "(ISIC), Revision 4 code for a particular organization, business person, or place.", ) - birthPlace: Optional[Union[List[Place], Place]] = Field( + birthPlace: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The place where the person was born.", ) - parent: Any = Field( + parent: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A parent of this person.", ) - gender: Union[List[Union[str, Any]], Union[str, Any]] = Field( + gender: Optional[Union[List[Union[str, GenderType]], Union[str, GenderType]]] = Field( None, description="Gender of something, typically a [[Person]], but possibly also fictional characters," "animals, etc. While https://schema.org/Male and https://schema.org/Female may" @@ -120,15 +142,15 @@ class Person(Thing): description="The North American Industry Classification System (NAICS) code for a particular organization" "or business person.", ) - sibling: Any = Field( + sibling: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A sibling of the person.", ) - siblings: Any = Field( + siblings: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A sibling of the person.", ) - brand: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + brand: Optional[Union[List[Union[Organization, Brand, str]], Union[Organization, Brand, str]]] = Field( None, description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization" "or business person.", @@ -137,16 +159,16 @@ class Person(Thing): None, description="The Dun & Bradstreet DUNS number for identifying an organization or business person.", ) - interactionStatistic: Any = Field( + interactionStatistic: Optional[Union[List[Union[InteractionCounter, str]], Union[InteractionCounter, str]]] = Field( None, description="The number of interactions for the CreativeWork using the WebSite or SoftwareApplication." "The most specific child type of InteractionCounter should be used.", ) - hasCredential: Any = Field( + hasCredential: Optional[Union[List[Union[EducationalOccupationalCredential, str]], Union[EducationalOccupationalCredential, str]]] = Field( None, description="A credential awarded to the Person or Organization.", ) - memberOf: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + memberOf: Optional[Union[List[Union[ProgramMembership, Organization, str]], Union[ProgramMembership, Organization, str]]] = Field( None, description="An Organization (or ProgramMembership) to which this Person or Organization belongs.", ) @@ -154,7 +176,7 @@ class Person(Thing): None, description="Given name. In the U.S., the first name of a Person.", ) - height: Any = Field( + height: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The height of the item.", ) @@ -162,16 +184,16 @@ class Person(Thing): None, description="The Value-added Tax ID of the organization or person.", ) - affiliation: Optional[Union[List[Organization], Organization]] = Field( + affiliation: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="An organization that this person is affiliated with. For example, a school/university," "a club, or a team.", ) - children: Any = Field( + children: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A child of the person.", ) - spouse: Any = Field( + spouse: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="The person's spouse.", ) @@ -179,11 +201,11 @@ class Person(Thing): None, description="An additional name for a Person, can be used for a middle name.", ) - follows: Any = Field( + follows: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="The most generic uni-directional social relation.", ) - deathDate: Optional[Union[List[date], date]] = Field( + deathDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date of death.", ) @@ -191,24 +213,24 @@ class Person(Thing): None, description="Awards won by or for this item.", ) - makesOffer: Any = Field( + makesOffer: Optional[Union[List[Union[Offer, str]], Union[Offer, str]]] = Field( None, description="A pointer to products or services offered by the organization or person.", ) - address: Union[List[Union[str, Any]], Union[str, Any]] = Field( + address: Optional[Union[List[Union[str, PostalAddress]], Union[str, PostalAddress]]] = Field( None, description="Physical address of the item.", ) - birthDate: Optional[Union[List[date], date]] = Field( + birthDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date of birth.", ) - sponsor: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + sponsor: Optional[Union[List[Union[Organization, 'Person', str]], Union[Organization, 'Person', str]]] = Field( None, description="A person or organization that supports a thing through a pledge, promise, or financial" "contribution. e.g. a sponsor of a Medical Study or a corporate sponsor of an event.", ) - deathPlace: Optional[Union[List[Place], Place]] = Field( + deathPlace: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The place where the person died.", ) @@ -221,19 +243,19 @@ class Person(Thing): description="The Tax / Fiscal ID of the organization or person, e.g. the TIN in the US or the CIF/NIF in" "Spain.", ) - hasOccupation: Any = Field( + hasOccupation: Optional[Union[List[Union[Occupation, str]], Union[Occupation, str]]] = Field( None, description="The Person's occupation. For past professions, use Role for expressing dates.", ) - hasOfferCatalog: Any = Field( + hasOfferCatalog: Optional[Union[List[Union[OfferCatalog, str]], Union[OfferCatalog, str]]] = Field( None, description="Indicates an OfferCatalog listing for this Organization, Person, or Service.", ) - knows: Any = Field( + knows: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="The most generic bi-directional social/work relation.", ) - worksFor: Optional[Union[List[Organization], Organization]] = Field( + worksFor: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="Organizations that the person works for.", ) @@ -241,27 +263,27 @@ class Person(Thing): None, description="The telephone number.", ) - hasPOS: Optional[Union[List[Place], Place]] = Field( + hasPOS: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="Points-of-Sales operated by the organization or person.", ) - colleague: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + colleague: Optional[Union[List[Union[AnyUrl, 'Person', str]], Union[AnyUrl, 'Person', str]]] = Field( None, description="A colleague of the person.", ) - performerIn: Any = Field( + performerIn: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Event that this person is a performer or participant in.", ) - seeks: Any = Field( + seeks: Optional[Union[List[Union[Demand, str]], Union[Demand, str]]] = Field( None, description="A pointer to products or services sought by the organization or person (demand).", ) - contactPoints: Any = Field( + contactPoints: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="A contact point for a person or organization.", ) - homeLocation: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + homeLocation: Optional[Union[List[Union[ContactPoint, Place, str]], Union[ContactPoint, Place, str]]] = Field( None, description="A contact location for a person's residence.", ) @@ -270,7 +292,7 @@ class Person(Thing): description="A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting" "and radio communications to identify people, radio and TV stations, or vehicles.", ) - parents: Any = Field( + parents: Optional[Union[List[Union['Person', str]], Union['Person', str]]] = Field( None, description="A parents of the person.", ) @@ -285,7 +307,7 @@ class Person(Thing): None, description="The fax number.", ) - owns: Any = Field( + owns: Optional[Union[List[Union[Product, OwnershipInfo, str]], Union[Product, OwnershipInfo, str]]] = Field( None, description="Products owned by the organization or person.", ) diff --git a/pydantic_schemaorg/PhysicalActivity.py b/pydantic_schemaorg/PhysicalActivity.py index 1cfe0043..67b22fbe 100644 --- a/pydantic_schemaorg/PhysicalActivity.py +++ b/pydantic_schemaorg/PhysicalActivity.py @@ -1,8 +1,10 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic_schemaorg.SuperficialAnatomy import SuperficialAnatomy from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem from pydantic_schemaorg.LifestyleModification import LifestyleModification @@ -19,7 +21,7 @@ class PhysicalActivity(LifestyleModification): None, description="The characteristics of associated patients, such as age, gender, race etc.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", @@ -29,7 +31,7 @@ class PhysicalActivity(LifestyleModification): description="Changes in the normal mechanical, physical, and biochemical functions that are associated" "with this activity or condition.", ) - associatedAnatomy: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + associatedAnatomy: Optional[Union[List[Union[SuperficialAnatomy, AnatomicalStructure, AnatomicalSystem, str]], Union[SuperficialAnatomy, AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="The anatomy of the underlying organ system or structures associated with this entity.", ) diff --git a/pydantic_schemaorg/Physician.py b/pydantic_schemaorg/Physician.py index 1404f0e4..b38b6891 100644 --- a/pydantic_schemaorg/Physician.py +++ b/pydantic_schemaorg/Physician.py @@ -1,9 +1,10 @@ from pydantic import Field from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty -from typing import Any, Optional, Union, List -from pydantic_schemaorg.MedicalTherapy import MedicalTherapy +from typing import List, Optional, Union +from pydantic_schemaorg.Hospital import Hospital from pydantic_schemaorg.MedicalTest import MedicalTest from pydantic_schemaorg.MedicalProcedure import MedicalProcedure +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalBusiness import MedicalBusiness from pydantic_schemaorg.MedicalOrganization import MedicalOrganization @@ -15,15 +16,15 @@ class Physician(MedicalBusiness, MedicalOrganization): """ type_: str = Field("Physician", const=True, alias='@type') - medicalSpecialty: Optional[Union[List[MedicalSpecialty], MedicalSpecialty]] = Field( + medicalSpecialty: Optional[Union[List[Union[MedicalSpecialty, str]], Union[MedicalSpecialty, str]]] = Field( None, description="A medical specialty of the provider.", ) - hospitalAffiliation: Any = Field( + hospitalAffiliation: Optional[Union[List[Union[Hospital, str]], Union[Hospital, str]]] = Field( None, description="A hospital with which the physician or office is affiliated.", ) - availableService: Optional[Union[List[Union[MedicalTherapy, MedicalTest, MedicalProcedure]], Union[MedicalTherapy, MedicalTest, MedicalProcedure]]] = Field( + availableService: Optional[Union[List[Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]], Union[MedicalTest, MedicalProcedure, MedicalTherapy, str]]] = Field( None, description="A medical service available from this provider.", ) diff --git a/pydantic_schemaorg/Place.py b/pydantic_schemaorg/Place.py index 2333c225..f02acee0 100644 --- a/pydantic_schemaorg/Place.py +++ b/pydantic_schemaorg/Place.py @@ -1,6 +1,19 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, StrictBool, Field +from pydantic_schemaorg.GeoCoordinates import GeoCoordinates +from pydantic_schemaorg.GeoShape import GeoShape +from typing import List, Optional, Any, Union +from pydantic_schemaorg.GeospatialGeometry import GeospatialGeometry +from pydantic_schemaorg.OpeningHoursSpecification import OpeningHoursSpecification +from pydantic_schemaorg.ImageObject import ImageObject +from pydantic_schemaorg.Photograph import Photograph +from pydantic_schemaorg.AggregateRating import AggregateRating from decimal import Decimal +from pydantic_schemaorg.LocationFeatureSpecification import LocationFeatureSpecification +from pydantic_schemaorg.PostalAddress import PostalAddress +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.Review import Review +from pydantic_schemaorg.PropertyValue import PropertyValue +from pydantic_schemaorg.Map import Map from pydantic_schemaorg.Thing import Thing @@ -11,11 +24,11 @@ class Place(Thing): """ type_: str = Field("Place", const=True, alias='@type') - geo: Any = Field( + geo: Optional[Union[List[Union[GeoCoordinates, GeoShape, str]], Union[GeoCoordinates, GeoShape, str]]] = Field( None, description="The geo coordinates of the place.", ) - geoEquals: Any = Field( + geoEquals: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "are topologically equal, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM)." @@ -23,24 +36,24 @@ class Place(Thing): "the interior or boundary of one geometry intersects the exterior of the other\" (a symmetric" "relationship)", ) - publicAccess: Optional[Union[List[StrictBool], StrictBool]] = Field( + publicAccess: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A flag to signal that the [[Place]] is open to public visitors. If this property is omitted" "there is no assumed default boolean value", ) - geoDisjoint: Any = Field( + geoDisjoint: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "are topologically disjoint: they have no point in common. They form a set of disconnected" "geometries.\" (a symmetric relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM))", ) - geoTouches: Any = Field( + geoTouches: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "touch: they have at least one boundary point in common, but no interior points.\" (a symmetric" "relationship, as defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM) )", ) - specialOpeningHoursSpecification: Any = Field( + specialOpeningHoursSpecification: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="The special opening hours of a certain place. Use this to explicitly override general" "opening hours brought in scope by [[openingHoursSpecification]] or [[openingHours]].", @@ -51,26 +64,26 @@ class Place(Thing): "to as International Location Number or ILN) of the respective organization, person," "or place. The GLN is a 13-digit number used to identify parties and physical locations.", ) - hasDriveThroughService: Optional[Union[List[StrictBool], StrictBool]] = Field( + hasDriveThroughService: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether some facility (e.g. [[FoodEstablishment]], [[CovidTestingFacility]])" "offers a service that can be used by driving through in a car. In the case of [[CovidTestingFacility]]" "such facilities could potentially help with social distancing from other potentially-infected" "users.", ) - maximumAttendeeCapacity: Optional[Union[List[int], int]] = Field( + maximumAttendeeCapacity: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The total number of individuals that may attend an event or venue.", ) - photo: Any = Field( + photo: Optional[Union[List[Union[ImageObject, Photograph, str]], Union[ImageObject, Photograph, str]]] = Field( None, description="A photograph of this place.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) - containedIn: Any = Field( + containedIn: Optional[Union[List[Union['Place', str]], Union['Place', str]]] = Field( None, description="The basic containment relation between a place and one that contains it.", ) @@ -83,24 +96,24 @@ class Place(Thing): None, description="The longitude of a location. For example ```-122.08585``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).", ) - smokingAllowed: Optional[Union[List[StrictBool], StrictBool]] = Field( + smokingAllowed: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates whether it is allowed to smoke in the place, e.g. in the restaurant, hotel or" "hotel room.", ) - amenityFeature: Any = Field( + amenityFeature: Optional[Union[List[Union[LocationFeatureSpecification, str]], Union[LocationFeatureSpecification, str]]] = Field( None, description="An amenity feature (e.g. a characteristic or service) of the Accommodation. This generic" "property does not make a statement about whether the feature is included in an offer for" "the main accommodation or available at extra costs.", ) - geoCovers: Any = Field( + geoCovers: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a covering geometry to a covered geometry. \"Every point of b is a point of (the interior" "or boundary of) a\". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - containsPlace: Any = Field( + containsPlace: Optional[Union[List[Union['Place', str]], Union['Place', str]]] = Field( None, description="The basic containment relation between a place and another that it contains.", ) @@ -108,7 +121,7 @@ class Place(Thing): None, description="A slogan or motto associated with the item.", ) - containedInPlace: Any = Field( + containedInPlace: Optional[Union[List[Union['Place', str]], Union['Place', str]]] = Field( None, description="The basic containment relation between a place and one that contains it.", ) @@ -119,46 +132,46 @@ class Place(Thing): "URLs. For example, in the URL http://www.starbucks.co.uk/store-locator/etc/detail/3047" "the code \"3047\" is a branchCode for a particular branch.", ) - geoContains: Any = Field( + geoContains: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a containing geometry to a contained geometry. \"a contains b iff no points of b lie in" "the exterior of a, and at least one point of the interior of b lies in the interior of a\"." "As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - tourBookingPage: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + tourBookingPage: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A page providing information on how to book a tour of some [[Place]], such as an [[Accommodation]]" "or [[ApartmentComplex]] in a real estate setting, as well as other kinds of tours as appropriate.", ) - geoCoveredBy: Any = Field( + geoCoveredBy: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that covers it. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - photos: Any = Field( + photos: Optional[Union[List[Union[Photograph, ImageObject, str]], Union[Photograph, ImageObject, str]]] = Field( None, description="Photographs of this place.", ) - geoCrosses: Any = Field( + geoCrosses: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that crosses it: \"a crosses b: they have some but not all interior" "points in common, and the dimension of the intersection is less than that of at least one" "of them\". As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoWithin: Any = Field( + geoWithin: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to one that contains it, i.e. it is inside (i.e. within) its interior. As defined" "in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - geoIntersects: Any = Field( + geoIntersects: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents spatial relations in which two geometries (or the places they represent)" "have at least one point in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - logo: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + logo: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An associated logo.", ) @@ -166,25 +179,25 @@ class Place(Thing): None, description="The latitude of a location. For example ```37.42242``` ([WGS 84](https://en.wikipedia.org/wiki/World_Geodetic_System)).", ) - address: Union[List[Union[str, Any]], Union[str, Any]] = Field( + address: Optional[Union[List[Union[str, PostalAddress]], Union[str, PostalAddress]]] = Field( None, description="Physical address of the item.", ) - maps: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + maps: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A URL to a map of the place.", ) - events: Any = Field( + events: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past events associated with this place or organization.", ) - geoOverlaps: Any = Field( + geoOverlaps: Optional[Union[List[Union[GeospatialGeometry, 'Place', str]], Union[GeospatialGeometry, 'Place', str]]] = Field( None, description="Represents a relationship between two geometries (or the places they represent), relating" "a geometry to another that geospatially overlaps it, i.e. they have some but not all points" "in common. As defined in [DE-9IM](https://en.wikipedia.org/wiki/DE-9IM).", ) - reviews: Any = Field( + reviews: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="Review of the item.", ) @@ -192,19 +205,19 @@ class Place(Thing): None, description="The telephone number.", ) - openingHoursSpecification: Any = Field( + openingHoursSpecification: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="The opening hours of a certain place.", ) - review: Any = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - map: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + map: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A URL to a map of the place.", ) - additionalProperty: Any = Field( + additionalProperty: Optional[Union[List[Union[PropertyValue, str]], Union[PropertyValue, str]]] = Field( None, description="A property-value pair representing an additional characteristics of the entitity," "e.g. a product feature or another characteristic for which there is no matching property" @@ -213,15 +226,15 @@ class Place(Thing): "https://schema.org/gtin13, ...) will typically expect such data to be provided using" "those properties, rather than using the generic property/value mechanism.", ) - isAccessibleForFree: Optional[Union[List[StrictBool], StrictBool]] = Field( + isAccessibleForFree: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A flag to signal that the item, event, or place is accessible for free.", ) - event: Any = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) - hasMap: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + hasMap: Optional[Union[List[Union[AnyUrl, Map, str]], Union[AnyUrl, Map, str]]] = Field( None, description="A URL to a map of the place.", ) diff --git a/pydantic_schemaorg/PlanAction.py b/pydantic_schemaorg/PlanAction.py index cbbeee66..b39dbea5 100644 --- a/pydantic_schemaorg/PlanAction.py +++ b/pydantic_schemaorg/PlanAction.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.OrganizeAction import OrganizeAction @@ -12,7 +12,7 @@ class PlanAction(OrganizeAction): """ type_: str = Field("PlanAction", const=True, alias='@type') - scheduledTime: Optional[Union[List[datetime], datetime]] = Field( + scheduledTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The time the object is scheduled to.", ) diff --git a/pydantic_schemaorg/PlayAction.py b/pydantic_schemaorg/PlayAction.py index 9c3e35b5..52202556 100644 --- a/pydantic_schemaorg/PlayAction.py +++ b/pydantic_schemaorg/PlayAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Audience import Audience -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Event import Event from pydantic_schemaorg.Action import Action @@ -17,11 +17,11 @@ class PlayAction(Action): """ type_: str = Field("PlayAction", const=True, alias='@type') - audience: Optional[Union[List[Audience], Audience]] = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) - event: Optional[Union[List[Event], Event]] = Field( + event: Optional[Union[List[Union[Event, str]], Union[Event, str]]] = Field( None, description="Upcoming or past event associated with this place, organization, or action.", ) diff --git a/pydantic_schemaorg/PodcastSeries.py b/pydantic_schemaorg/PodcastSeries.py index a5777888..7eaca5c9 100644 --- a/pydantic_schemaorg/PodcastSeries.py +++ b/pydantic_schemaorg/PodcastSeries.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.DataFeed import DataFeed -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries @@ -13,12 +13,12 @@ class PodcastSeries(CreativeWorkSeries): """ type_: str = Field("PodcastSeries", const=True, alias='@type') - webFeed: Optional[Union[List[Union[AnyUrl, DataFeed]], Union[AnyUrl, DataFeed]]] = Field( + webFeed: Optional[Union[List[Union[AnyUrl, DataFeed, str]], Union[AnyUrl, DataFeed, str]]] = Field( None, description="The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped" "updates. This is usually RSS or Atom.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", diff --git a/pydantic_schemaorg/PostalAddress.py b/pydantic_schemaorg/PostalAddress.py index 847cb4bd..c07daf8f 100644 --- a/pydantic_schemaorg/PostalAddress.py +++ b/pydantic_schemaorg/PostalAddress.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Country import Country from pydantic_schemaorg.ContactPoint import ContactPoint diff --git a/pydantic_schemaorg/PostalCodeRangeSpecification.py b/pydantic_schemaorg/PostalCodeRangeSpecification.py index 77867d95..088e52ad 100644 --- a/pydantic_schemaorg/PostalCodeRangeSpecification.py +++ b/pydantic_schemaorg/PostalCodeRangeSpecification.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.StructuredValue import StructuredValue diff --git a/pydantic_schemaorg/PriceSpecification.py b/pydantic_schemaorg/PriceSpecification.py index a9e70978..f113a920 100644 --- a/pydantic_schemaorg/PriceSpecification.py +++ b/pydantic_schemaorg/PriceSpecification.py @@ -1,7 +1,8 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal from datetime import datetime, date +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.StructuredValue import StructuredValue @@ -14,12 +15,12 @@ class PriceSpecification(StructuredValue): """ type_: str = Field("PriceSpecification", const=True, alias='@type') - valueAddedTaxIncluded: Optional[Union[List[StrictBool], StrictBool]] = Field( + valueAddedTaxIncluded: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Specifies whether the applicable value-added tax (VAT) is included in the price specification" "or not.", ) - eligibleTransactionVolume: Any = Field( + eligibleTransactionVolume: Optional[Union[List[Union['PriceSpecification', str]], Union['PriceSpecification', str]]] = Field( None, description="The transaction volume, in a monetary unit, for which the offer or price specification" "is valid, e.g. for indicating a minimal purchasing volume, to express free shipping" @@ -51,24 +52,24 @@ class PriceSpecification(StructuredValue): "0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially" "similiar Unicode symbols.", ) - maxPrice: Optional[Union[List[Decimal], Decimal]] = Field( + maxPrice: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The highest price if the price is a range.", ) - minPrice: Optional[Union[List[Decimal], Decimal]] = Field( + minPrice: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The lowest price if the price is a range.", ) - validFrom: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validFrom: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date when the item becomes valid.", ) - validThrough: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + validThrough: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date after when the item is not valid. For example the end of an offer, salary period," "or a period of opening hours.", ) - eligibleQuantity: Any = Field( + eligibleQuantity: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The interval and unit of measurement of ordering quantities for which the offer or price" "specification is valid. This allows e.g. specifying that a certain freight charge is" diff --git a/pydantic_schemaorg/Product.py b/pydantic_schemaorg/Product.py index 81f47bf9..50e1dc56 100644 --- a/pydantic_schemaorg/Product.py +++ b/pydantic_schemaorg/Product.py @@ -1,12 +1,28 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.DefinedTerm import DefinedTerm -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.Demand import Demand +from pydantic_schemaorg.Offer import Offer +from pydantic_schemaorg.ProductModel import ProductModel +from pydantic_schemaorg.Distance import Distance from datetime import date +from pydantic_schemaorg.AggregateRating import AggregateRating +from pydantic_schemaorg.Country import Country from pydantic_schemaorg.Organization import Organization -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic_schemaorg.Brand import Brand from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic_schemaorg.MerchantReturnPolicy import MerchantReturnPolicy +from pydantic_schemaorg.EnergyConsumptionDetails import EnergyConsumptionDetails +from pydantic_schemaorg.Service import Service +from pydantic_schemaorg.SizeSpecification import SizeSpecification +from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.Review import Review +from pydantic_schemaorg.OfferItemCondition import OfferItemCondition +from pydantic_schemaorg.PropertyValue import PropertyValue +from pydantic_schemaorg.ProductGroup import ProductGroup class Product(Thing): @@ -23,13 +39,13 @@ class Product(Thing): "Values are typically expressed as text, although links to controlled value schemes" "are also supported.", ) - hasMeasurement: Any = Field( + hasMeasurement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A product measurement, for example the inseam of pants, the wheel size of a bicycle, or" "the gauge of a screw. Usually an exact measurement, but can also be a range of measurements" "for adjustable products, for example belts and ski bindings.", ) - offers: Any = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -42,7 +58,7 @@ class Product(Thing): None, description="The color of the product.", ) - isAccessoryOrSparePartFor: Any = Field( + isAccessoryOrSparePartFor: Optional[Union[List[Union['Product', str]], Union['Product', str]]] = Field( None, description="A pointer to another product (or multiple products) for which this product is an accessory" "or spare part.", @@ -52,18 +68,18 @@ class Product(Thing): description="The product identifier, such as ISBN. For example: ``` meta itemprop=\"productID\"" "content=\"isbn:123-456-789\" ```.", ) - model: Union[List[Union[str, Any]], Union[str, Any]] = Field( + model: Optional[Union[List[Union[str, ProductModel]], Union[str, ProductModel]]] = Field( None, description="The model of the product. Use with the URL of a ProductModel or a textual representation" "of the model identifier. The URL of the ProductModel can be from an external source. It" "is recommended to additionally provide strong product identifiers via the gtin8/gtin13/gtin14" "and mpn properties.", ) - depth: Any = Field( + depth: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The depth of the item.", ) - weight: Any = Field( + weight: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The weight of the product or person.", ) @@ -74,11 +90,11 @@ class Product(Thing): "a GTIN-13 code by simply adding a preceding zero. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - productionDate: Optional[Union[List[date], date]] = Field( + productionDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date of production of the item, e.g. vehicle.", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) @@ -97,7 +113,7 @@ class Product(Thing): description="Indicates the [NATO stock number](https://en.wikipedia.org/wiki/NATO_Stock_Number)" "(nsn) of a [[Product]].", ) - countryOfOrigin: Any = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -107,25 +123,25 @@ class Product(Thing): "case of products, the country of origin of the product. The exact interpretation of this" "may vary by context and product type, and cannot be fully enumerated here.", ) - manufacturer: Optional[Union[List[Organization], Organization]] = Field( + manufacturer: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The manufacturer of the product.", ) - brand: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + brand: Optional[Union[List[Union[Organization, Brand, str]], Union[Organization, Brand, str]]] = Field( None, description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization" "or business person.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", ) - hasMerchantReturnPolicy: Any = Field( + hasMerchantReturnPolicy: Optional[Union[List[Union[MerchantReturnPolicy, str]], Union[MerchantReturnPolicy, str]]] = Field( None, description="Specifies a MerchantReturnPolicy that may be applicable.", ) - hasEnergyConsumptionDetails: Any = Field( + hasEnergyConsumptionDetails: Optional[Union[List[Union[EnergyConsumptionDetails, str]], Union[EnergyConsumptionDetails, str]]] = Field( None, description="Defines the energy efficiency Category (also known as \"class\" or \"rating\") for" "a product according to an international energy efficiency standard.", @@ -134,27 +150,27 @@ class Product(Thing): None, description="A slogan or motto associated with the item.", ) - isSimilarTo: Any = Field( + isSimilarTo: Optional[Union[List[Union['Product', Service, str]], Union['Product', Service, str]]] = Field( None, description="A pointer to another, functionally similar product (or multiple products).", ) - height: Any = Field( + height: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The height of the item.", ) - size: Union[List[Union[str, DefinedTerm, Any]], Union[str, DefinedTerm, Any]] = Field( + size: Optional[Union[List[Union[str, SizeSpecification, DefinedTerm, QuantitativeValue]], Union[str, SizeSpecification, DefinedTerm, QuantitativeValue]]] = Field( None, description="A standardized size of a product or creative work, specified either through a simple" "textual string (for example 'XL', '32Wx34L'), a QuantitativeValue with a unitCode," "or a comprehensive and structured [[SizeSpecification]]; in other cases, the [[width]]," "[[height]], [[depth]] and [[weight]] properties may be more applicable.", ) - releaseDate: Optional[Union[List[date], date]] = Field( + releaseDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The release date of a product or product model. This can be used to distinguish the exact" "variant of a product.", ) - logo: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + logo: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An associated logo.", ) @@ -178,11 +194,11 @@ class Product(Thing): "and Check Digit used to identify trade items. See [GS1 GTIN Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin)" "for more details.", ) - width: Any = Field( + width: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The width of the item.", ) - audience: Optional[Union[List[Audience], Audience]] = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) @@ -191,11 +207,11 @@ class Product(Thing): description="The GTIN-14 code of the product, or the product to which the offer refers. See [GS1 GTIN" "Summary](http://www.gs1.org/barcodes/technical/idkeys/gtin) for more details.", ) - material: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + material: Optional[Union[List[Union[AnyUrl, str, 'Product']], Union[AnyUrl, str, 'Product']]] = Field( None, description="A material that something is made from, e.g. leather, wool, cotton, paper.", ) - isRelatedTo: Any = Field( + isRelatedTo: Optional[Union[List[Union['Product', Service, str]], Union['Product', Service, str]]] = Field( None, description="A pointer to another, somehow related product (or multiple products).", ) @@ -203,7 +219,7 @@ class Product(Thing): None, description="Indicates the [[productGroupID]] for a [[ProductGroup]] that this product [[isVariantOf]].", ) - reviews: Optional[Union[List[Review], Review]] = Field( + reviews: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="Review of the item.", ) @@ -212,7 +228,7 @@ class Product(Thing): description="The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service," "or the product to which the offer refers.", ) - isConsumableFor: Any = Field( + isConsumableFor: Optional[Union[List[Union['Product', str]], Union['Product', str]]] = Field( None, description="A pointer to another product (or multiple products) for which this product is a consumable.", ) @@ -229,17 +245,17 @@ class Product(Thing): "and [Wikipedia](https://en.wikipedia.org/wiki/Global_Trade_Item_Number) for" "more details. Left-padding of the gtin values is not required or encouraged.", ) - review: Optional[Union[List[Review], Review]] = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - itemCondition: Any = Field( + itemCondition: Optional[Union[List[Union[OfferItemCondition, str]], Union[OfferItemCondition, str]]] = Field( None, description="A predefined value from OfferItemCondition specifying the condition of the product" "or service, or the products or services included in the offer. Also used for product return" "policies to specify the condition of products accepted for returns.", ) - additionalProperty: Any = Field( + additionalProperty: Optional[Union[List[Union[PropertyValue, str]], Union[PropertyValue, str]]] = Field( None, description="A property-value pair representing an additional characteristics of the entitity," "e.g. a product feature or another characteristic for which there is no matching property" @@ -248,7 +264,7 @@ class Product(Thing): "https://schema.org/gtin13, ...) will typically expect such data to be provided using" "those properties, rather than using the generic property/value mechanism.", ) - isVariantOf: Any = Field( + isVariantOf: Optional[Union[List[Union[ProductGroup, ProductModel, str]], Union[ProductGroup, ProductModel, str]]] = Field( None, description="Indicates the kind of product that this is a variant of. In the case of [[ProductModel]]," "this is a pointer (from a ProductModel) to a base product from which this product is a variant." @@ -263,7 +279,7 @@ class Product(Thing): None, description="The place where the product was assembled.", ) - purchaseDate: Optional[Union[List[date], date]] = Field( + purchaseDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date the item e.g. vehicle was purchased by the current owner.", ) diff --git a/pydantic_schemaorg/ProductCollection.py b/pydantic_schemaorg/ProductCollection.py index 6d26d262..1cec3f97 100644 --- a/pydantic_schemaorg/ProductCollection.py +++ b/pydantic_schemaorg/ProductCollection.py @@ -1,11 +1,11 @@ from pydantic import Field from pydantic_schemaorg.TypeAndQuantityNode import TypeAndQuantityNode -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Collection import Collection +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.Collection import Collection -class ProductCollection(Collection, Product): +class ProductCollection(Product, Collection): """A set of products (either [[ProductGroup]]s or specific variants) that are listed together" "e.g. in an [[Offer]]. @@ -13,7 +13,7 @@ class ProductCollection(Collection, Product): """ type_: str = Field("ProductCollection", const=True, alias='@type') - includesObject: Optional[Union[List[TypeAndQuantityNode], TypeAndQuantityNode]] = Field( + includesObject: Optional[Union[List[Union[TypeAndQuantityNode, str]], Union[TypeAndQuantityNode, str]]] = Field( None, description="This links to a node or nodes indicating the exact quantity of the products included in" "an [[Offer]] or [[ProductCollection]].", diff --git a/pydantic_schemaorg/ProductGroup.py b/pydantic_schemaorg/ProductGroup.py index b47c599a..337dd221 100644 --- a/pydantic_schemaorg/ProductGroup.py +++ b/pydantic_schemaorg/ProductGroup.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.DefinedTerm import DefinedTerm -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product @@ -29,7 +29,7 @@ class ProductGroup(Product): None, description="Indicates a textual identifier for a ProductGroup.", ) - hasVariant: Optional[Union[List[Product], Product]] = Field( + hasVariant: Optional[Union[List[Union[Product, str]], Union[Product, str]]] = Field( None, description="Indicates a [[Product]] that is a member of this [[ProductGroup]] (or [[ProductModel]]).", ) diff --git a/pydantic_schemaorg/ProductModel.py b/pydantic_schemaorg/ProductModel.py index 9778a97c..b9b19e6d 100644 --- a/pydantic_schemaorg/ProductModel.py +++ b/pydantic_schemaorg/ProductModel.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ProductGroup import ProductGroup from pydantic_schemaorg.Product import Product @@ -10,15 +11,15 @@ class ProductModel(Product): """ type_: str = Field("ProductModel", const=True, alias='@type') - predecessorOf: Any = Field( + predecessorOf: Optional[Union[List[Union['ProductModel', str]], Union['ProductModel', str]]] = Field( None, description="A pointer from a previous, often discontinued variant of the product to its newer variant.", ) - successorOf: Any = Field( + successorOf: Optional[Union[List[Union['ProductModel', str]], Union['ProductModel', str]]] = Field( None, description="A pointer from a newer variant of a product to its previous, often discontinued predecessor.", ) - isVariantOf: Any = Field( + isVariantOf: Optional[Union[List[Union[ProductGroup, 'ProductModel', str]], Union[ProductGroup, 'ProductModel', str]]] = Field( None, description="Indicates the kind of product that this is a variant of. In the case of [[ProductModel]]," "this is a pointer (from a ProductModel) to a base product from which this product is a variant." diff --git a/pydantic_schemaorg/ProgramMembership.py b/pydantic_schemaorg/ProgramMembership.py index 81e931c9..73e32094 100644 --- a/pydantic_schemaorg/ProgramMembership.py +++ b/pydantic_schemaorg/ProgramMembership.py @@ -1,7 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Intangible import Intangible @@ -19,17 +19,17 @@ class ProgramMembership(Intangible): None, description="A unique identifier for the membership.", ) - membershipPointsEarned: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + membershipPointsEarned: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of membership points earned by the member. If necessary, the unitText can" "be used to express the units the points are issued in. (e.g. stars, miles, etc.)", ) - member: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + member: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A member of an Organization or a ProgramMembership. Organizations can be members of" "organizations; ProgramMembership is typically for individuals.", ) - members: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + members: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A member of this organization.", ) @@ -37,7 +37,7 @@ class ProgramMembership(Intangible): None, description="The program providing the membership.", ) - hostingOrganization: Optional[Union[List[Organization], Organization]] = Field( + hostingOrganization: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The organization (airline, travelers' club, etc.) the membership is made with.", ) diff --git a/pydantic_schemaorg/Property.py b/pydantic_schemaorg/Property.py index 09e78cf4..46da64de 100644 --- a/pydantic_schemaorg/Property.py +++ b/pydantic_schemaorg/Property.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Class import Class -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Enumeration import Enumeration from pydantic_schemaorg.Intangible import Intangible @@ -13,17 +13,17 @@ class Property(Intangible): """ type_: str = Field("Property", const=True, alias='@type') - domainIncludes: Optional[Union[List[Class], Class]] = Field( + domainIncludes: Optional[Union[List[Union[Class, str]], Union[Class, str]]] = Field( None, description="Relates a property to a class that is (one of) the type(s) the property is expected to be" "used on.", ) - rangeIncludes: Optional[Union[List[Class], Class]] = Field( + rangeIncludes: Optional[Union[List[Union[Class, str]], Union[Class, str]]] = Field( None, description="Relates a property to a class that constitutes (one of) the expected type(s) for values" "of the property.", ) - inverseOf: Any = Field( + inverseOf: Optional[Union[List[Union['Property', str]], Union['Property', str]]] = Field( None, description="Relates a property to a property that is its inverse. Inverse properties relate the same" "pairs of items to each other, but in reversed direction. For example, the 'alumni' and" @@ -31,7 +31,7 @@ class Property(Intangible): "inverses; in these situations RDFa and JSON-LD syntax for reverse properties can be" "used.", ) - supersededBy: Union[List[Union[Enumeration, Class, Any]], Union[Enumeration, Class, Any]] = Field( + supersededBy: Optional[Union[List[Union[Class, Enumeration, 'Property', str]], Union[Class, Enumeration, 'Property', str]]] = Field( None, description="Relates a term (i.e. a property, class or enumeration) to one that supersedes it.", ) diff --git a/pydantic_schemaorg/PropertyValue.py b/pydantic_schemaorg/PropertyValue.py index e118ff67..6fad5f99 100644 --- a/pydantic_schemaorg/PropertyValue.py +++ b/pydantic_schemaorg/PropertyValue.py @@ -1,10 +1,12 @@ -from pydantic import StrictBool, Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field, StrictBool +from typing import List, Optional, Union from decimal import Decimal -from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration +from pydantic_schemaorg.StructuredValue import StructuredValue from pydantic_schemaorg.Enumeration import Enumeration from pydantic_schemaorg.DefinedTerm import DefinedTerm -from pydantic_schemaorg.StructuredValue import StructuredValue +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration +from pydantic_schemaorg.QualitativeValue import QualitativeValue class PropertyValue(StructuredValue): @@ -32,7 +34,7 @@ class PropertyValue(StructuredValue): "several [[variableMeasured]] properties recorded for some given data object, use" "a [[PropertyValue]] for each [[variableMeasured]] and attach the corresponding [[measurementTechnique]].", ) - minValue: Optional[Union[List[Decimal], Decimal]] = Field( + minValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The lower value of some characteristic or property.", ) @@ -41,7 +43,7 @@ class PropertyValue(StructuredValue): description="A string or text indicating the unit of measurement. Useful if you cannot provide a standard" "unit code for unitCode.", ) - value: Union[List[Union[Decimal, StrictBool, str, Any]], Union[Decimal, StrictBool, str, Any]] = Field( + value: Optional[Union[List[Union[Decimal, str, StrictBool, StructuredValue]], Union[Decimal, str, StrictBool, StructuredValue]]] = Field( None, description="The value of the quantitative value or property value node. * For [[QuantitativeValue]]" "and [[MonetaryAmount]], the recommended type for values is 'Number'. * For [[PropertyValue]]," @@ -66,11 +68,11 @@ class PropertyValue(StructuredValue): description="The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL." "Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.", ) - maxValue: Optional[Union[List[Decimal], Decimal]] = Field( + maxValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The upper value of some characteristic or property.", ) - valueReference: Union[List[Union[str, MeasurementTypeEnumeration, Enumeration, DefinedTerm, Any]], Union[str, MeasurementTypeEnumeration, Enumeration, DefinedTerm, Any]] = Field( + valueReference: Optional[Union[List[Union[str, Enumeration, 'PropertyValue', DefinedTerm, QuantitativeValue, MeasurementTypeEnumeration, QualitativeValue, StructuredValue]], Union[str, Enumeration, 'PropertyValue', DefinedTerm, QuantitativeValue, MeasurementTypeEnumeration, QualitativeValue, StructuredValue]]] = Field( None, description="A secondary value that provides additional information on the original value, e.g." "a reference temperature or a type of measurement.", diff --git a/pydantic_schemaorg/PropertyValueSpecification.py b/pydantic_schemaorg/PropertyValueSpecification.py index 6576037b..b090d1e4 100644 --- a/pydantic_schemaorg/PropertyValueSpecification.py +++ b/pydantic_schemaorg/PropertyValueSpecification.py @@ -1,5 +1,5 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.Intangible import Intangible @@ -12,20 +12,20 @@ class PropertyValueSpecification(Intangible): """ type_: str = Field("PropertyValueSpecification", const=True, alias='@type') - multipleValues: Optional[Union[List[StrictBool], StrictBool]] = Field( + multipleValues: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether multiple values are allowed for the property. Default is false.", ) - valueMaxLength: Optional[Union[List[Decimal], Decimal]] = Field( + valueMaxLength: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Specifies the allowed range for number of characters in a literal value.", ) - readonlyValue: Optional[Union[List[StrictBool], StrictBool]] = Field( + readonlyValue: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether or not a property is mutable. Default is false. Specifying this for a property" "that also has a value makes it act similar to a \"hidden\" input in an HTML form.", ) - valueMinLength: Optional[Union[List[Decimal], Decimal]] = Field( + valueMinLength: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Specifies the minimum allowed range for number of characters in a literal value.", ) @@ -33,11 +33,11 @@ class PropertyValueSpecification(Intangible): None, description="Specifies a regular expression for testing literal values according to the HTML spec.", ) - valueRequired: Optional[Union[List[StrictBool], StrictBool]] = Field( + valueRequired: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Whether the property must be filled in to complete the action. Default is false.", ) - minValue: Optional[Union[List[Decimal], Decimal]] = Field( + minValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The lower value of some characteristic or property.", ) @@ -46,12 +46,12 @@ class PropertyValueSpecification(Intangible): description="Indicates the name of the PropertyValueSpecification to be used in URL templates and" "form encoding in a manner analogous to HTML's input@name.", ) - stepValue: Optional[Union[List[Decimal], Decimal]] = Field( + stepValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The stepValue attribute indicates the granularity that is expected (and required)" "of the value in a PropertyValueSpecification.", ) - maxValue: Optional[Union[List[Decimal], Decimal]] = Field( + maxValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The upper value of some characteristic or property.", ) diff --git a/pydantic_schemaorg/Protein.py b/pydantic_schemaorg/Protein.py index 834f0dbe..c386a642 100644 --- a/pydantic_schemaorg/Protein.py +++ b/pydantic_schemaorg/Protein.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.BioChemEntity import BioChemEntity diff --git a/pydantic_schemaorg/PublicationEvent.py b/pydantic_schemaorg/PublicationEvent.py index 3d96b8ac..9f94db5b 100644 --- a/pydantic_schemaorg/PublicationEvent.py +++ b/pydantic_schemaorg/PublicationEvent.py @@ -1,7 +1,8 @@ from pydantic import StrictBool, Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.BroadcastService import BroadcastService from pydantic_schemaorg.Event import Event @@ -14,15 +15,15 @@ class PublicationEvent(Event): """ type_: str = Field("PublicationEvent", const=True, alias='@type') - publishedBy: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + publishedBy: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An agent associated with the publication event.", ) - publishedOn: Any = Field( + publishedOn: Optional[Union[List[Union[BroadcastService, str]], Union[BroadcastService, str]]] = Field( None, description="A broadcast service associated with the publication event.", ) - free: Optional[Union[List[StrictBool], StrictBool]] = Field( + free: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="A flag to signal that the item, event, or place is accessible for free.", ) diff --git a/pydantic_schemaorg/PublicationIssue.py b/pydantic_schemaorg/PublicationIssue.py index d55d4681..19d5d030 100644 --- a/pydantic_schemaorg/PublicationIssue.py +++ b/pydantic_schemaorg/PublicationIssue.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/PublicationVolume.py b/pydantic_schemaorg/PublicationVolume.py index ab48fa07..710e73ee 100644 --- a/pydantic_schemaorg/PublicationVolume.py +++ b/pydantic_schemaorg/PublicationVolume.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/QualitativeValue.py b/pydantic_schemaorg/QualitativeValue.py index 8def1be5..641cfcc1 100644 --- a/pydantic_schemaorg/QualitativeValue.py +++ b/pydantic_schemaorg/QualitativeValue.py @@ -1,9 +1,10 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PropertyValue import PropertyValue -from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration from pydantic_schemaorg.Enumeration import Enumeration from pydantic_schemaorg.DefinedTerm import DefinedTerm +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration from pydantic_schemaorg.StructuredValue import StructuredValue @@ -15,37 +16,37 @@ class QualitativeValue(Enumeration): """ type_: str = Field("QualitativeValue", const=True, alias='@type') - lesser: Any = Field( + lesser: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is lesser" "than the object.", ) - nonEqual: Any = Field( + nonEqual: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is not equal" "to the object.", ) - equal: Any = Field( + equal: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is equal to" "the object.", ) - lesserOrEqual: Any = Field( + lesserOrEqual: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is lesser" "than or equal to the object.", ) - greaterOrEqual: Any = Field( + greaterOrEqual: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is greater" "than or equal to the object.", ) - greater: Any = Field( + greater: Optional[Union[List[Union['QualitativeValue', str]], Union['QualitativeValue', str]]] = Field( None, description="This ordering relation for qualitative values indicates that the subject is greater" "than the object.", ) - additionalProperty: Optional[Union[List[PropertyValue], PropertyValue]] = Field( + additionalProperty: Optional[Union[List[Union[PropertyValue, str]], Union[PropertyValue, str]]] = Field( None, description="A property-value pair representing an additional characteristics of the entitity," "e.g. a product feature or another characteristic for which there is no matching property" @@ -54,7 +55,7 @@ class QualitativeValue(Enumeration): "https://schema.org/gtin13, ...) will typically expect such data to be provided using" "those properties, rather than using the generic property/value mechanism.", ) - valueReference: Union[List[Union[str, MeasurementTypeEnumeration, PropertyValue, Enumeration, DefinedTerm, StructuredValue, Any]], Union[str, MeasurementTypeEnumeration, PropertyValue, Enumeration, DefinedTerm, StructuredValue, Any]] = Field( + valueReference: Optional[Union[List[Union[str, Enumeration, PropertyValue, DefinedTerm, QuantitativeValue, MeasurementTypeEnumeration, 'QualitativeValue', StructuredValue]], Union[str, Enumeration, PropertyValue, DefinedTerm, QuantitativeValue, MeasurementTypeEnumeration, 'QualitativeValue', StructuredValue]]] = Field( None, description="A secondary value that provides additional information on the original value, e.g." "a reference temperature or a type of measurement.", diff --git a/pydantic_schemaorg/QuantitativeValue.py b/pydantic_schemaorg/QuantitativeValue.py index 4d749371..6e848a6e 100644 --- a/pydantic_schemaorg/QuantitativeValue.py +++ b/pydantic_schemaorg/QuantitativeValue.py @@ -1,11 +1,11 @@ -from pydantic import StrictBool, Field, AnyUrl +from pydantic import AnyUrl, StrictBool, Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.StructuredValue import StructuredValue from pydantic_schemaorg.PropertyValue import PropertyValue -from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration from pydantic_schemaorg.Enumeration import Enumeration from pydantic_schemaorg.DefinedTerm import DefinedTerm +from pydantic_schemaorg.MeasurementTypeEnumeration import MeasurementTypeEnumeration from pydantic_schemaorg.QualitativeValue import QualitativeValue @@ -16,7 +16,7 @@ class QuantitativeValue(StructuredValue): """ type_: str = Field("QuantitativeValue", const=True, alias='@type') - minValue: Optional[Union[List[Decimal], Decimal]] = Field( + minValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The lower value of some characteristic or property.", ) @@ -25,7 +25,7 @@ class QuantitativeValue(StructuredValue): description="A string or text indicating the unit of measurement. Useful if you cannot provide a standard" "unit code for unitCode.", ) - value: Optional[Union[List[Union[Decimal, StrictBool, str, StructuredValue]], Union[Decimal, StrictBool, str, StructuredValue]]] = Field( + value: Optional[Union[List[Union[Decimal, str, StrictBool, StructuredValue]], Union[Decimal, str, StrictBool, StructuredValue]]] = Field( None, description="The value of the quantitative value or property value node. * For [[QuantitativeValue]]" "and [[MonetaryAmount]], the recommended type for values is 'Number'. * For [[PropertyValue]]," @@ -39,11 +39,11 @@ class QuantitativeValue(StructuredValue): description="The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL." "Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.", ) - maxValue: Optional[Union[List[Decimal], Decimal]] = Field( + maxValue: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The upper value of some characteristic or property.", ) - additionalProperty: Optional[Union[List[PropertyValue], PropertyValue]] = Field( + additionalProperty: Optional[Union[List[Union[PropertyValue, str]], Union[PropertyValue, str]]] = Field( None, description="A property-value pair representing an additional characteristics of the entitity," "e.g. a product feature or another characteristic for which there is no matching property" @@ -52,7 +52,7 @@ class QuantitativeValue(StructuredValue): "https://schema.org/gtin13, ...) will typically expect such data to be provided using" "those properties, rather than using the generic property/value mechanism.", ) - valueReference: Union[List[Union[str, MeasurementTypeEnumeration, PropertyValue, Enumeration, DefinedTerm, StructuredValue, QualitativeValue, Any]], Union[str, MeasurementTypeEnumeration, PropertyValue, Enumeration, DefinedTerm, StructuredValue, QualitativeValue, Any]] = Field( + valueReference: Optional[Union[List[Union[str, Enumeration, PropertyValue, DefinedTerm, 'QuantitativeValue', MeasurementTypeEnumeration, QualitativeValue, StructuredValue]], Union[str, Enumeration, PropertyValue, DefinedTerm, 'QuantitativeValue', MeasurementTypeEnumeration, QualitativeValue, StructuredValue]]] = Field( None, description="A secondary value that provides additional information on the original value, e.g." "a reference temperature or a type of measurement.", diff --git a/pydantic_schemaorg/QuantitativeValueDistribution.py b/pydantic_schemaorg/QuantitativeValueDistribution.py index af1070a1..323a23ce 100644 --- a/pydantic_schemaorg/QuantitativeValueDistribution.py +++ b/pydantic_schemaorg/QuantitativeValueDistribution.py @@ -1,6 +1,7 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.StructuredValue import StructuredValue @@ -11,27 +12,27 @@ class QuantitativeValueDistribution(StructuredValue): """ type_: str = Field("QuantitativeValueDistribution", const=True, alias='@type') - percentile75: Optional[Union[List[Decimal], Decimal]] = Field( + percentile75: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The 75th percentile value.", ) - duration: Any = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - percentile25: Optional[Union[List[Decimal], Decimal]] = Field( + percentile25: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The 25th percentile value.", ) - percentile90: Optional[Union[List[Decimal], Decimal]] = Field( + percentile90: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The 90th percentile value.", ) - percentile10: Optional[Union[List[Decimal], Decimal]] = Field( + percentile10: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The 10th percentile value.", ) - median: Optional[Union[List[Decimal], Decimal]] = Field( + median: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The median value.", ) diff --git a/pydantic_schemaorg/Question.py b/pydantic_schemaorg/Question.py index d8ed08bc..f964b467 100644 --- a/pydantic_schemaorg/Question.py +++ b/pydantic_schemaorg/Question.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.Answer import Answer +from pydantic_schemaorg.ItemList import ItemList from pydantic_schemaorg.Comment import Comment @@ -17,16 +19,16 @@ class Question(Comment): "the format of question being given. Example: \"Multiple choice\", \"Open ended\"," "\"Flashcard\".", ) - answerCount: Optional[Union[List[int], int]] = Field( + answerCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of answers this question has received.", ) - suggestedAnswer: Any = Field( + suggestedAnswer: Optional[Union[List[Union[Answer, ItemList, str]], Union[Answer, ItemList, str]]] = Field( None, description="An answer (possibly one of several, possibly incorrect) to a Question, e.g. on a Question/Answer" "site.", ) - acceptedAnswer: Any = Field( + acceptedAnswer: Optional[Union[List[Union[ItemList, Answer, str]], Union[ItemList, Answer, str]]] = Field( None, description="The answer(s) that has been accepted as best, typically on a Question/Answer site. Sites" "vary in their selection mechanisms, e.g. drawing on community opinion and/or the view" diff --git a/pydantic_schemaorg/Quotation.py b/pydantic_schemaorg/Quotation.py index 8da9e3ee..6e305276 100644 --- a/pydantic_schemaorg/Quotation.py +++ b/pydantic_schemaorg/Quotation.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreativeWork import CreativeWork @@ -15,7 +15,7 @@ class Quotation(CreativeWork): """ type_: str = Field("Quotation", const=True, alias='@type') - spokenByCharacter: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + spokenByCharacter: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The (e.g. fictional) character, Person or Organization to whom the quotation is attributed" "within the containing CreativeWork.", diff --git a/pydantic_schemaorg/RadioSeries.py b/pydantic_schemaorg/RadioSeries.py index 3ccad167..9bee6f58 100644 --- a/pydantic_schemaorg/RadioSeries.py +++ b/pydantic_schemaorg/RadioSeries.py @@ -1,8 +1,11 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason +from pydantic_schemaorg.VideoObject import VideoObject from pydantic_schemaorg.Episode import Episode from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries @@ -13,64 +16,64 @@ class RadioSeries(CreativeWorkSeries): """ type_: str = Field("RadioSeries", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - containsSeason: Any = Field( + containsSeason: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season that is part of the media series.", ) - numberOfSeasons: Optional[Union[List[int], int]] = Field( + numberOfSeasons: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of seasons in this series.", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - episodes: Optional[Union[List[Episode], Episode]] = Field( + episodes: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a TV/radio series or season.", ) - numberOfEpisodes: Optional[Union[List[int], int]] = Field( + numberOfEpisodes: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of episodes in this season or series.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - seasons: Any = Field( + seasons: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - season: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + season: Optional[Union[List[Union[AnyUrl, CreativeWorkSeason, str]], Union[AnyUrl, CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - episode: Optional[Union[List[Episode], Episode]] = Field( + episode: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a tv, radio or game media within a series or season.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/Rating.py b/pydantic_schemaorg/Rating.py index 473f3a9b..e7c0fb86 100644 --- a/pydantic_schemaorg/Rating.py +++ b/pydantic_schemaorg/Rating.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Intangible import Intangible @@ -17,7 +17,7 @@ class Rating(Intangible): None, description="The lowest value allowed in this rating system. If worstRating is omitted, 1 is assumed.", ) - author: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + author: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The author of this content or rating. Please note that author is special in that HTML 5" "provides a special mechanism for indicating authorship via the rel tag. That is equivalent" diff --git a/pydantic_schemaorg/RealEstateListing.py b/pydantic_schemaorg/RealEstateListing.py index 014c0d8d..57117062 100644 --- a/pydantic_schemaorg/RealEstateListing.py +++ b/pydantic_schemaorg/RealEstateListing.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime, date from pydantic_schemaorg.WebPage import WebPage @@ -15,12 +15,12 @@ class RealEstateListing(WebPage): """ type_: str = Field("RealEstateListing", const=True, alias='@type') - leaseLength: Optional[Union[List[Union[Duration, QuantitativeValue]], Union[Duration, QuantitativeValue]]] = Field( + leaseLength: Optional[Union[List[Union[Duration, QuantitativeValue, str]], Union[Duration, QuantitativeValue, str]]] = Field( None, description="Length of the lease for some [[Accommodation]], either particular to some [[Offer]]" "or in some cases intrinsic to the property.", ) - datePosted: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + datePosted: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Publication date of an online listing.", ) diff --git a/pydantic_schemaorg/ReceiveAction.py b/pydantic_schemaorg/ReceiveAction.py index 540df997..6e7af804 100644 --- a/pydantic_schemaorg/ReceiveAction.py +++ b/pydantic_schemaorg/ReceiveAction.py @@ -1,8 +1,8 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DeliveryMethod import DeliveryMethod from pydantic_schemaorg.TransferAction import TransferAction @@ -18,11 +18,11 @@ class ReceiveAction(TransferAction): """ type_: str = Field("ReceiveAction", const=True, alias='@type') - sender: Optional[Union[List[Union[Organization, Audience, Person]], Union[Organization, Audience, Person]]] = Field( + sender: Optional[Union[List[Union[Audience, Organization, Person, str]], Union[Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the sending end of the action.", ) - deliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + deliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="A sub property of instrument. The method of delivery.", ) diff --git a/pydantic_schemaorg/Recipe.py b/pydantic_schemaorg/Recipe.py index fb11dfff..180cba7f 100644 --- a/pydantic_schemaorg/Recipe.py +++ b/pydantic_schemaorg/Recipe.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.ItemList import ItemList from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.NutritionInformation import NutritionInformation from pydantic_schemaorg.RestrictedDiet import RestrictedDiet @@ -23,7 +23,7 @@ class Recipe(HowTo): description="A step in making the recipe, in the form of a single item (document, video, etc.) or an ordered" "list with HowToStep and/or HowToSection items.", ) - cookTime: Optional[Union[List[Duration], Duration]] = Field( + cookTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The time it takes to actually cook the dish, in [ISO 8601 duration format](http://en.wikipedia.org/wiki/ISO_8601).", ) @@ -35,7 +35,7 @@ class Recipe(HowTo): None, description="The cuisine of the recipe (for example, French or Ethiopian).", ) - nutrition: Optional[Union[List[NutritionInformation], NutritionInformation]] = Field( + nutrition: Optional[Union[List[Union[NutritionInformation, str]], Union[NutritionInformation, str]]] = Field( None, description="Nutrition information about the recipe or menu item.", ) @@ -47,7 +47,7 @@ class Recipe(HowTo): None, description="The category of the recipe—for example, appetizer, entree, etc.", ) - suitableForDiet: Optional[Union[List[RestrictedDiet], RestrictedDiet]] = Field( + suitableForDiet: Optional[Union[List[Union[RestrictedDiet, str]], Union[RestrictedDiet, str]]] = Field( None, description="Indicates a dietary restriction or guideline for which this recipe or menu item is suitable," "e.g. diabetic, halal etc.", diff --git a/pydantic_schemaorg/Recommendation.py b/pydantic_schemaorg/Recommendation.py index 598277f0..ece4a9ff 100644 --- a/pydantic_schemaorg/Recommendation.py +++ b/pydantic_schemaorg/Recommendation.py @@ -1,7 +1,7 @@ -from pydantic import Field, AnyUrl -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic import AnyUrl, Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from typing import List, Optional, Union from pydantic_schemaorg.Review import Review @@ -16,7 +16,7 @@ class Recommendation(Review): """ type_: str = Field("Recommendation", const=True, alias='@type') - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", diff --git a/pydantic_schemaorg/RentAction.py b/pydantic_schemaorg/RentAction.py index 4ad402b5..ace7f7a3 100644 --- a/pydantic_schemaorg/RentAction.py +++ b/pydantic_schemaorg/RentAction.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.RealEstateAgent import RealEstateAgent from pydantic_schemaorg.TradeAction import TradeAction @@ -15,11 +15,11 @@ class RentAction(TradeAction): """ type_: str = Field("RentAction", const=True, alias='@type') - landlord: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + landlord: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A sub property of participant. The owner of the real estate property.", ) - realEstateAgent: Optional[Union[List[RealEstateAgent], RealEstateAgent]] = Field( + realEstateAgent: Optional[Union[List[Union[RealEstateAgent, str]], Union[RealEstateAgent, str]]] = Field( None, description="A sub property of participant. The real estate agent involved in the action.", ) diff --git a/pydantic_schemaorg/RentalCarReservation.py b/pydantic_schemaorg/RentalCarReservation.py index d619950f..0cbe3a0f 100644 --- a/pydantic_schemaorg/RentalCarReservation.py +++ b/pydantic_schemaorg/RentalCarReservation.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime from pydantic_schemaorg.Reservation import Reservation @@ -13,19 +13,19 @@ class RentalCarReservation(Reservation): """ type_: str = Field("RentalCarReservation", const=True, alias='@type') - pickupLocation: Optional[Union[List[Place], Place]] = Field( + pickupLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="Where a taxi will pick up a passenger or a rental car can be picked up.", ) - dropoffLocation: Optional[Union[List[Place], Place]] = Field( + dropoffLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="Where a rental car can be dropped off.", ) - pickupTime: Optional[Union[List[datetime], datetime]] = Field( + pickupTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="When a taxi will pickup a passenger or a rental car can be picked up.", ) - dropoffTime: Optional[Union[List[datetime], datetime]] = Field( + dropoffTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="When a rental car can be dropped off.", ) diff --git a/pydantic_schemaorg/RepaymentSpecification.py b/pydantic_schemaorg/RepaymentSpecification.py index ea1bf3ec..84e3cae5 100644 --- a/pydantic_schemaorg/RepaymentSpecification.py +++ b/pydantic_schemaorg/RepaymentSpecification.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount +from typing import List, Optional, Union from decimal import Decimal from pydantic_schemaorg.StructuredValue import StructuredValue @@ -11,26 +12,26 @@ class RepaymentSpecification(StructuredValue): """ type_: str = Field("RepaymentSpecification", const=True, alias='@type') - loanPaymentAmount: Any = Field( + loanPaymentAmount: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="The amount of money to pay in a single payment.", ) - numberOfLoanPayments: Optional[Union[List[Decimal], Decimal]] = Field( + numberOfLoanPayments: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The number of payments contractually required at origination to repay the loan. For" "monthly paying loans this is the number of months from the contractual first payment" "date to the maturity date.", ) - loanPaymentFrequency: Optional[Union[List[Decimal], Decimal]] = Field( + loanPaymentFrequency: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Frequency of payments due, i.e. number of months between payments. This is defined as" "a frequency, i.e. the reciprocal of a period of time.", ) - earlyPrepaymentPenalty: Any = Field( + earlyPrepaymentPenalty: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="The amount to be paid as a penalty in the event of early payment of the loan.", ) - downPayment: Union[List[Union[Decimal, Any]], Union[Decimal, Any]] = Field( + downPayment: Optional[Union[List[Union[Decimal, MonetaryAmount, str]], Union[Decimal, MonetaryAmount, str]]] = Field( None, description="a type of payment made in cash during the onset of the purchase of an expensive good/service." "The payment typically represents only a percentage of the full purchase price.", diff --git a/pydantic_schemaorg/ReplaceAction.py b/pydantic_schemaorg/ReplaceAction.py index 58a75f1e..937e5dd3 100644 --- a/pydantic_schemaorg/ReplaceAction.py +++ b/pydantic_schemaorg/ReplaceAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.UpdateAction import UpdateAction @@ -11,11 +11,11 @@ class ReplaceAction(UpdateAction): """ type_: str = Field("ReplaceAction", const=True, alias='@type') - replacer: Optional[Union[List[Thing], Thing]] = Field( + replacer: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A sub property of object. The object that replaces.", ) - replacee: Optional[Union[List[Thing], Thing]] = Field( + replacee: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A sub property of object. The object that is being replaced.", ) diff --git a/pydantic_schemaorg/ReplyAction.py b/pydantic_schemaorg/ReplyAction.py index abd13811..e743740f 100644 --- a/pydantic_schemaorg/ReplyAction.py +++ b/pydantic_schemaorg/ReplyAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Comment import Comment -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CommunicateAction import CommunicateAction @@ -12,7 +12,7 @@ class ReplyAction(CommunicateAction): """ type_: str = Field("ReplyAction", const=True, alias='@type') - resultComment: Optional[Union[List[Comment], Comment]] = Field( + resultComment: Optional[Union[List[Union[Comment, str]], Union[Comment, str]]] = Field( None, description="A sub property of result. The Comment created or sent as a result of this action.", ) diff --git a/pydantic_schemaorg/Report.py b/pydantic_schemaorg/Report.py index f5b7e443..223bc6a4 100644 --- a/pydantic_schemaorg/Report.py +++ b/pydantic_schemaorg/Report.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Article import Article diff --git a/pydantic_schemaorg/Reservation.py b/pydantic_schemaorg/Reservation.py index 75852387..436fe940 100644 --- a/pydantic_schemaorg/Reservation.py +++ b/pydantic_schemaorg/Reservation.py @@ -1,9 +1,14 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ProgramMembership import ProgramMembership from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.Person import Person from datetime import datetime from decimal import Decimal +from pydantic_schemaorg.PriceSpecification import PriceSpecification +from pydantic_schemaorg.ReservationStatusType import ReservationStatusType from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.Ticket import Ticket from pydantic_schemaorg.Intangible import Intangible @@ -21,16 +26,16 @@ class Reservation(Intangible): None, description="A unique identifier for the reservation.", ) - programMembershipUsed: Any = Field( + programMembershipUsed: Optional[Union[List[Union[ProgramMembership, str]], Union[ProgramMembership, str]]] = Field( None, description="Any membership in a frequent flyer, hotel loyalty program, etc. being applied to the" "reservation.", ) - underName: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + underName: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization the reservation or ticket is for.", ) - modifiedTime: Optional[Union[List[datetime], datetime]] = Field( + modifiedTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date and time the reservation was modified.", ) @@ -42,7 +47,7 @@ class Reservation(Intangible): "for cryptocurrencies e.g. \"BTC\"; well known names for [Local Exchange Tradings Systems](https://en.wikipedia.org/wiki/Local_exchange_trading_system)" "(LETS) and other currency types e.g. \"Ithaca HOUR\".", ) - totalPrice: Union[List[Union[Decimal, str, Any]], Union[Decimal, str, Any]] = Field( + totalPrice: Optional[Union[List[Union[Decimal, str, PriceSpecification]], Union[Decimal, str, PriceSpecification]]] = Field( None, description="The total price for the reservation or ticket, including applicable taxes, shipping," "etc. Usage guidelines: * Use values from 0123456789 (Unicode 'DIGIT ZERO' (U+0030)" @@ -50,36 +55,36 @@ class Reservation(Intangible): "'.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid" "using these symbols as a readability separator.", ) - bookingAgent: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + bookingAgent: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="'bookingAgent' is an out-dated term indicating a 'broker' that serves as a booking agent.", ) - reservationStatus: Any = Field( + reservationStatus: Optional[Union[List[Union[ReservationStatusType, str]], Union[ReservationStatusType, str]]] = Field( None, description="The current status of the reservation.", ) - provider: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." "A provider may also serve as the seller.", ) - bookingTime: Optional[Union[List[datetime], datetime]] = Field( + bookingTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="The date and time the reservation was booked.", ) - reservationFor: Optional[Union[List[Thing], Thing]] = Field( + reservationFor: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The thing -- flight, event, restaurant,etc. being reserved.", ) - broker: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + broker: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity that arranges for an exchange between a buyer and a seller. In most cases a broker" "never acquires or releases ownership of a product or service involved in an exchange." "If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms" "are preferred.", ) - reservedTicket: Any = Field( + reservedTicket: Optional[Union[List[Union[Ticket, str]], Union[Ticket, str]]] = Field( None, description="A ticket associated with the reservation.", ) diff --git a/pydantic_schemaorg/ReservationPackage.py b/pydantic_schemaorg/ReservationPackage.py index 7f6c4e5b..f31b52da 100644 --- a/pydantic_schemaorg/ReservationPackage.py +++ b/pydantic_schemaorg/ReservationPackage.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Reservation import Reservation -from typing import Any, Optional, Union, List +from typing import List, Optional, Union class ReservationPackage(Reservation): @@ -10,7 +10,7 @@ class ReservationPackage(Reservation): """ type_: str = Field("ReservationPackage", const=True, alias='@type') - subReservation: Optional[Union[List[Reservation], Reservation]] = Field( + subReservation: Optional[Union[List[Union[Reservation, str]], Union[Reservation, str]]] = Field( None, description="The individual reservations included in the package. Typically a repeated property.", ) diff --git a/pydantic_schemaorg/Residence.py b/pydantic_schemaorg/Residence.py index ca8beddb..5280518f 100644 --- a/pydantic_schemaorg/Residence.py +++ b/pydantic_schemaorg/Residence.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.FloorPlan import FloorPlan +from typing import List, Optional, Union from pydantic_schemaorg.Place import Place @@ -10,7 +11,7 @@ class Residence(Place): """ type_: str = Field("Residence", const=True, alias='@type') - accommodationFloorPlan: Any = Field( + accommodationFloorPlan: Optional[Union[List[Union[FloorPlan, str]], Union[FloorPlan, str]]] = Field( None, description="A floorplan of some [[Accommodation]].", ) diff --git a/pydantic_schemaorg/RespiratoryTherapy.py b/pydantic_schemaorg/RespiratoryTherapy.py index 593235c5..abd16a8d 100644 --- a/pydantic_schemaorg/RespiratoryTherapy.py +++ b/pydantic_schemaorg/RespiratoryTherapy.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalSpecialty import MedicalSpecialty +from pydantic_schemaorg.MedicalTherapy import MedicalTherapy -class RespiratoryTherapy(MedicalTherapy, MedicalSpecialty): +class RespiratoryTherapy(MedicalSpecialty, MedicalTherapy): """The therapy that is concerned with the maintenance or improvement of respiratory function" "(as in patients with pulmonary disease). diff --git a/pydantic_schemaorg/ReturnAction.py b/pydantic_schemaorg/ReturnAction.py index 0d916536..f9eb7763 100644 --- a/pydantic_schemaorg/ReturnAction.py +++ b/pydantic_schemaorg/ReturnAction.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from pydantic_schemaorg.ContactPoint import ContactPoint -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TransferAction import TransferAction @@ -15,7 +15,7 @@ class ReturnAction(TransferAction): """ type_: str = Field("ReturnAction", const=True, alias='@type') - recipient: Optional[Union[List[Union[Organization, Audience, Person, ContactPoint]], Union[Organization, Audience, Person, ContactPoint]]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/Review.py b/pydantic_schemaorg/Review.py index c1746c3a..74aa84de 100644 --- a/pydantic_schemaorg/Review.py +++ b/pydantic_schemaorg/Review.py @@ -1,5 +1,9 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.ItemList import ItemList +from pydantic_schemaorg.WebContent import WebContent +from pydantic_schemaorg.ListItem import ListItem +from pydantic_schemaorg.Rating import Rating from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.CreativeWork import CreativeWork @@ -11,7 +15,7 @@ class Review(CreativeWork): """ type_: str = Field("Review", const=True, alias='@type') - associatedMediaReview: Any = Field( + associatedMediaReview: Optional[Union[List[Union['Review', str]], Union['Review', str]]] = Field( None, description="An associated [[MediaReview]], related by specific common content, topic or claim." "The expectation is that this property would be most typically used in cases where a single" @@ -19,7 +23,7 @@ class Review(CreativeWork): "would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be" "used on [[MediaReview]].", ) - positiveNotes: Union[List[Union[str, Any]], Union[str, Any]] = Field( + positiveNotes: Optional[Union[List[Union[str, ItemList, WebContent, ListItem]], Union[str, ItemList, WebContent, ListItem]]] = Field( None, description="Indicates, in the context of a [[Review]] (e.g. framed as 'pro' vs 'con' considerations)," "positive considerations - either as unstructured text, or a list.", @@ -28,13 +32,13 @@ class Review(CreativeWork): None, description="This Review or Rating is relevant to this part or facet of the itemReviewed.", ) - reviewRating: Any = Field( + reviewRating: Optional[Union[List[Union[Rating, str]], Union[Rating, str]]] = Field( None, description="The rating given in this review. Note that reviews can themselves be rated. The ```reviewRating```" "applies to rating given by the review. The [[aggregateRating]] property applies to" "the review itself, as a creative work.", ) - associatedClaimReview: Any = Field( + associatedClaimReview: Optional[Union[List[Union['Review', str]], Union['Review', str]]] = Field( None, description="An associated [[ClaimReview]], related by specific common content, topic or claim." "The expectation is that this property would be most typically used in cases where a single" @@ -42,7 +46,7 @@ class Review(CreativeWork): "would commonly be used on a [[ClaimReview]], while [[relatedClaimReview]] would be" "used on [[MediaReview]].", ) - associatedReview: Any = Field( + associatedReview: Optional[Union[List[Union['Review', str]], Union['Review', str]]] = Field( None, description="An associated [[Review]].", ) @@ -50,12 +54,12 @@ class Review(CreativeWork): None, description="The actual body of the review.", ) - negativeNotes: Union[List[Union[str, Any]], Union[str, Any]] = Field( + negativeNotes: Optional[Union[List[Union[str, ItemList, WebContent, ListItem]], Union[str, ItemList, WebContent, ListItem]]] = Field( None, description="Indicates, in the context of a [[Review]] (e.g. framed as 'pro' vs 'con' considerations)," "negative considerations - either as unstructured text, or a list.", ) - itemReviewed: Optional[Union[List[Thing], Thing]] = Field( + itemReviewed: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The item that is being reviewed/rated.", ) diff --git a/pydantic_schemaorg/ReviewAction.py b/pydantic_schemaorg/ReviewAction.py index 3ef7303f..aebaf4e0 100644 --- a/pydantic_schemaorg/ReviewAction.py +++ b/pydantic_schemaorg/ReviewAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Review import Review -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AssessAction import AssessAction @@ -12,7 +12,7 @@ class ReviewAction(AssessAction): """ type_: str = Field("ReviewAction", const=True, alias='@type') - resultReview: Optional[Union[List[Review], Review]] = Field( + resultReview: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A sub property of result. The review that resulted in the performing of the action.", ) diff --git a/pydantic_schemaorg/Role.py b/pydantic_schemaorg/Role.py index 5c4d2f7b..5f8f8547 100644 --- a/pydantic_schemaorg/Role.py +++ b/pydantic_schemaorg/Role.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from datetime import datetime, date from pydantic_schemaorg.Intangible import Intangible @@ -22,7 +22,7 @@ class Role(Intangible): "of creators for a comic book might fill the roles named 'inker', 'penciller', and 'letterer';" "or an athlete in a SportsTeam might play in the position named 'Quarterback'.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) @@ -31,7 +31,7 @@ class Role(Intangible): description="A position played, performed or filled by a person or organization, as part of an organization." "For example, an athlete in a SportsTeam might play in the position named 'Quarterback'.", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) diff --git a/pydantic_schemaorg/RsvpAction.py b/pydantic_schemaorg/RsvpAction.py index e59410af..a12d5aa6 100644 --- a/pydantic_schemaorg/RsvpAction.py +++ b/pydantic_schemaorg/RsvpAction.py @@ -1,6 +1,6 @@ from pydantic import Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Comment import Comment from pydantic_schemaorg.RsvpResponseType import RsvpResponseType from pydantic_schemaorg.InformAction import InformAction @@ -13,15 +13,15 @@ class RsvpAction(InformAction): """ type_: str = Field("RsvpAction", const=True, alias='@type') - additionalNumberOfGuests: Optional[Union[List[Decimal], Decimal]] = Field( + additionalNumberOfGuests: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="If responding yes, the number of guests who will attend in addition to the invitee.", ) - comment: Optional[Union[List[Comment], Comment]] = Field( + comment: Optional[Union[List[Union[Comment, str]], Union[Comment, str]]] = Field( None, description="Comments, typically from users.", ) - rsvpResponse: Optional[Union[List[RsvpResponseType], RsvpResponseType]] = Field( + rsvpResponse: Optional[Union[List[Union[RsvpResponseType, str]], Union[RsvpResponseType, str]]] = Field( None, description="The response (yes, no, maybe) to the RSVP.", ) diff --git a/pydantic_schemaorg/Schedule.py b/pydantic_schemaorg/Schedule.py index 21521245..6a5c04f5 100644 --- a/pydantic_schemaorg/Schedule.py +++ b/pydantic_schemaorg/Schedule.py @@ -1,6 +1,6 @@ from pydantic import Field from datetime import datetime, time, date -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DayOfWeek import DayOfWeek from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.Intangible import Intangible @@ -19,7 +19,7 @@ class Schedule(Intangible): """ type_: str = Field("Schedule", const=True, alias='@type') - exceptDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + exceptDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Defines a [[Date]] or [[DateTime]] during which a scheduled [[Event]] will not take" "place. The property allows exceptions to a [[Schedule]] to be specified. If an exception" @@ -40,20 +40,20 @@ class Schedule(Intangible): "using either [[DayOfWeek]], or alternatively [[Text]] conforming to iCal's syntax" "for byDay recurrence rules.", ) - byMonthDay: Optional[Union[List[int], int]] = Field( + byMonthDay: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Defines the day(s) of the month on which a recurring [[Event]] takes place. Specified" "as an [[Integer]] between 1-31.", ) - duration: Optional[Union[List[Duration], Duration]] = Field( + duration: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="The duration of the item (movie, audio recording, event, etc.) in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601).", ) - repeatCount: Optional[Union[List[int], int]] = Field( + repeatCount: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Defines the number of times a recurring [[Event]] will take place", ) - endTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + endTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The endTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to end. For actions that span a period of time, when the action" @@ -62,7 +62,7 @@ class Schedule(Intangible): "Event uses startDate/endDate instead of startTime/endTime, even when describing" "dates with times. This situation may be clarified in future revisions.", ) - endDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + endDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The end date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) @@ -71,22 +71,22 @@ class Schedule(Intangible): description="Defines the frequency at which [[Event]]s will occur according to a schedule [[Schedule]]." "The intervals between events should be defined as a [[Duration]] of time.", ) - byMonthWeek: Optional[Union[List[int], int]] = Field( + byMonthWeek: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Defines the week(s) of the month on which a recurring Event takes place. Specified as" "an Integer between 1-5. For clarity, byMonthWeek is best used in conjunction with byDay" "to indicate concepts like the first and third Mondays of a month.", ) - byMonth: Optional[Union[List[int], int]] = Field( + byMonth: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Defines the month(s) of the year on which a recurring [[Event]] takes place. Specified" "as an [[Integer]] between 1-12. January is 1.", ) - startDate: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + startDate: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The start date and time of the item (in [ISO 8601 date format](http://en.wikipedia.org/wiki/ISO_8601)).", ) - startTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + startTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The startTime of something. For a reserved event or service (e.g. FoodEstablishmentReservation)," "the time that it is expected to start. For actions that span a period of time, when the action" diff --git a/pydantic_schemaorg/ScreeningEvent.py b/pydantic_schemaorg/ScreeningEvent.py index b8f5c3eb..ddb10f76 100644 --- a/pydantic_schemaorg/ScreeningEvent.py +++ b/pydantic_schemaorg/ScreeningEvent.py @@ -1,5 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Movie import Movie +from typing import List, Optional, Any, Union +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Event import Event @@ -10,11 +12,11 @@ class ScreeningEvent(Event): """ type_: str = Field("ScreeningEvent", const=True, alias='@type') - workPresented: Any = Field( + workPresented: Optional[Union[List[Union[Movie, str]], Union[Movie, str]]] = Field( None, description="The movie presented during this event.", ) - subtitleLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + subtitleLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).", ) diff --git a/pydantic_schemaorg/SearchAction.py b/pydantic_schemaorg/SearchAction.py index 2830af8c..10a793e9 100644 --- a/pydantic_schemaorg/SearchAction.py +++ b/pydantic_schemaorg/SearchAction.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Action import Action diff --git a/pydantic_schemaorg/Seat.py b/pydantic_schemaorg/Seat.py index 09746984..360510f8 100644 --- a/pydantic_schemaorg/Seat.py +++ b/pydantic_schemaorg/Seat.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.QualitativeValue import QualitativeValue from pydantic_schemaorg.Intangible import Intangible diff --git a/pydantic_schemaorg/SeekToAction.py b/pydantic_schemaorg/SeekToAction.py index e82e5de5..904fd8a2 100644 --- a/pydantic_schemaorg/SeekToAction.py +++ b/pydantic_schemaorg/SeekToAction.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.HyperTocEntry import HyperTocEntry from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.HyperTocEntry import HyperTocEntry +from typing import List, Optional, Union from pydantic_schemaorg.Action import Action @@ -13,7 +13,7 @@ class SeekToAction(Action): """ type_: str = Field("SeekToAction", const=True, alias='@type') - startOffset: Optional[Union[List[Union[Decimal, HyperTocEntry]], Union[Decimal, HyperTocEntry]]] = Field( + startOffset: Optional[Union[List[Union[Decimal, HyperTocEntry, str]], Union[Decimal, HyperTocEntry, str]]] = Field( None, description="The start time of the clip expressed as the number of seconds from the beginning of the" "work.", diff --git a/pydantic_schemaorg/SellAction.py b/pydantic_schemaorg/SellAction.py index 07f61a2c..78b5a667 100644 --- a/pydantic_schemaorg/SellAction.py +++ b/pydantic_schemaorg/SellAction.py @@ -1,7 +1,8 @@ from pydantic import Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.WarrantyPromise import WarrantyPromise from pydantic_schemaorg.TradeAction import TradeAction @@ -13,12 +14,12 @@ class SellAction(TradeAction): """ type_: str = Field("SellAction", const=True, alias='@type') - buyer: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + buyer: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant/person/organization that bought the" "object.", ) - warrantyPromise: Any = Field( + warrantyPromise: Optional[Union[List[Union[WarrantyPromise, str]], Union[WarrantyPromise, str]]] = Field( None, description="The warranty promise(s) included in the offer.", ) diff --git a/pydantic_schemaorg/SendAction.py b/pydantic_schemaorg/SendAction.py index 37dcb28e..785a033d 100644 --- a/pydantic_schemaorg/SendAction.py +++ b/pydantic_schemaorg/SendAction.py @@ -1,8 +1,10 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.DeliveryMethod import DeliveryMethod from pydantic_schemaorg.TransferAction import TransferAction @@ -16,11 +18,11 @@ class SendAction(TransferAction): """ type_: str = Field("SendAction", const=True, alias='@type') - recipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) - deliveryMethod: Any = Field( + deliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="A sub property of instrument. The method of delivery.", ) diff --git a/pydantic_schemaorg/Service.py b/pydantic_schemaorg/Service.py index 6a768883..e1b13832 100644 --- a/pydantic_schemaorg/Service.py +++ b/pydantic_schemaorg/Service.py @@ -1,15 +1,24 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Demand import Demand -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Offer import Offer +from typing import List, Optional, Union +from pydantic_schemaorg.AdministrativeArea import AdministrativeArea +from pydantic_schemaorg.GeoShape import GeoShape from pydantic_schemaorg.Place import Place from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.AggregateRating import AggregateRating from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.Brand import Brand from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory from pydantic_schemaorg.Product import Product from pydantic_schemaorg.GovernmentBenefitsType import GovernmentBenefitsType +from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.OfferCatalog import OfferCatalog +from pydantic_schemaorg.OpeningHoursSpecification import OpeningHoursSpecification from pydantic_schemaorg.Review import Review from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.ServiceChannel import ServiceChannel from pydantic_schemaorg.Intangible import Intangible @@ -20,7 +29,7 @@ class Service(Intangible): """ type_: str = Field("Service", const=True, alias='@type') - offers: Union[List[Union[Demand, Any]], Union[Demand, Any]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -29,11 +38,11 @@ class Service(Intangible): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - areaServed: Union[List[Union[str, Place, Any]], Union[str, Place, Any]] = Field( + areaServed: Optional[Union[List[Union[str, AdministrativeArea, GeoShape, Place]], Union[str, AdministrativeArea, GeoShape, Place]]] = Field( None, description="The geographic area where a service or offered item is provided.", ) - serviceOutput: Optional[Union[List[Thing], Thing]] = Field( + serviceOutput: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The tangible thing generated by the service, e.g. a passport, permit, etc.", ) @@ -41,7 +50,7 @@ class Service(Intangible): None, description="Indicates the mobility of a provided service (e.g. 'static', 'dynamic').", ) - aggregateRating: Any = Field( + aggregateRating: Optional[Union[List[Union[AggregateRating, str]], Union[AggregateRating, str]]] = Field( None, description="The overall rating, based on a collection of reviews or ratings, of the item.", ) @@ -53,16 +62,16 @@ class Service(Intangible): None, description="Human-readable terms of service documentation.", ) - produces: Optional[Union[List[Thing], Thing]] = Field( + produces: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The tangible thing generated by the service, e.g. a passport, permit, etc.", ) - brand: Union[List[Union[Organization, Any]], Union[Organization, Any]] = Field( + brand: Optional[Union[List[Union[Organization, Brand, str]], Union[Organization, Brand, str]]] = Field( None, description="The brand(s) associated with a product or service, or the brand(s) maintained by an organization" "or business person.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", @@ -71,7 +80,7 @@ class Service(Intangible): None, description="A slogan or motto associated with the item.", ) - isSimilarTo: Union[List[Union[Product, Any]], Union[Product, Any]] = Field( + isSimilarTo: Optional[Union[List[Union[Product, 'Service', str]], Union[Product, 'Service', str]]] = Field( None, description="A pointer to another, functionally similar product (or multiple products).", ) @@ -79,52 +88,52 @@ class Service(Intangible): None, description="The type of service being offered, e.g. veterans' benefits, emergency relief, etc.", ) - logo: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + logo: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An associated logo.", ) - audience: Optional[Union[List[Audience], Audience]] = Field( + audience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="An intended audience, i.e. a group for whom something was created.", ) - serviceArea: Union[List[Union[Place, Any]], Union[Place, Any]] = Field( + serviceArea: Optional[Union[List[Union[AdministrativeArea, GeoShape, Place, str]], Union[AdministrativeArea, GeoShape, Place, str]]] = Field( None, description="The geographic area where the service is provided.", ) - hasOfferCatalog: Any = Field( + hasOfferCatalog: Optional[Union[List[Union[OfferCatalog, str]], Union[OfferCatalog, str]]] = Field( None, description="Indicates an OfferCatalog listing for this Organization, Person, or Service.", ) - isRelatedTo: Union[List[Union[Product, Any]], Union[Product, Any]] = Field( + isRelatedTo: Optional[Union[List[Union[Product, 'Service', str]], Union[Product, 'Service', str]]] = Field( None, description="A pointer to another, somehow related product (or multiple products).", ) - hoursAvailable: Any = Field( + hoursAvailable: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="The hours during which this service or contact is available.", ) - review: Optional[Union[List[Review], Review]] = Field( + review: Optional[Union[List[Union[Review, str]], Union[Review, str]]] = Field( None, description="A review of the item.", ) - provider: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." "A provider may also serve as the seller.", ) - availableChannel: Any = Field( + availableChannel: Optional[Union[List[Union[ServiceChannel, str]], Union[ServiceChannel, str]]] = Field( None, description="A means of accessing the service (e.g. a phone bank, a web site, a location, etc.).", ) - broker: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + broker: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="An entity that arranges for an exchange between a buyer and a seller. In most cases a broker" "never acquires or releases ownership of a product or service involved in an exchange." "If it is not clear whether an entity is a broker, seller, or buyer, the latter two terms" "are preferred.", ) - serviceAudience: Optional[Union[List[Audience], Audience]] = Field( + serviceAudience: Optional[Union[List[Union[Audience, str]], Union[Audience, str]]] = Field( None, description="The audience eligible for this service.", ) diff --git a/pydantic_schemaorg/ServiceChannel.py b/pydantic_schemaorg/ServiceChannel.py index 1e65efb3..26ea9160 100644 --- a/pydantic_schemaorg/ServiceChannel.py +++ b/pydantic_schemaorg/ServiceChannel.py @@ -1,10 +1,11 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Duration import Duration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Place import Place from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Service import Service from pydantic_schemaorg.ContactPoint import ContactPoint +from pydantic_schemaorg.Language import Language from pydantic_schemaorg.Intangible import Intangible @@ -16,36 +17,36 @@ class ServiceChannel(Intangible): """ type_: str = Field("ServiceChannel", const=True, alias='@type') - processingTime: Optional[Union[List[Duration], Duration]] = Field( + processingTime: Optional[Union[List[Union[Duration, str]], Union[Duration, str]]] = Field( None, description="Estimated processing time for the service using this channel.", ) - serviceLocation: Optional[Union[List[Place], Place]] = Field( + serviceLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="The location (e.g. civic structure, local business, etc.) where a person can go to access" "the service.", ) - servicePostalAddress: Optional[Union[List[PostalAddress], PostalAddress]] = Field( + servicePostalAddress: Optional[Union[List[Union[PostalAddress, str]], Union[PostalAddress, str]]] = Field( None, description="The address for accessing the service by mail.", ) - serviceUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + serviceUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The website to access the service.", ) - providesService: Optional[Union[List[Service], Service]] = Field( + providesService: Optional[Union[List[Union[Service, str]], Union[Service, str]]] = Field( None, description="The service provided by this channel.", ) - serviceSmsNumber: Optional[Union[List[ContactPoint], ContactPoint]] = Field( + serviceSmsNumber: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="The number to access the service by text message.", ) - servicePhone: Optional[Union[List[ContactPoint], ContactPoint]] = Field( + servicePhone: Optional[Union[List[Union[ContactPoint, str]], Union[ContactPoint, str]]] = Field( None, description="The phone number to use to access the service.", ) - availableLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + availableLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="A language someone may use with or at the item, service or place. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" diff --git a/pydantic_schemaorg/ShippingDeliveryTime.py b/pydantic_schemaorg/ShippingDeliveryTime.py index 5f685b68..1ecbb9a0 100644 --- a/pydantic_schemaorg/ShippingDeliveryTime.py +++ b/pydantic_schemaorg/ShippingDeliveryTime.py @@ -1,7 +1,8 @@ from pydantic import Field from pydantic_schemaorg.QuantitativeValue import QuantitativeValue -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import time +from pydantic_schemaorg.OpeningHoursSpecification import OpeningHoursSpecification from pydantic_schemaorg.StructuredValue import StructuredValue @@ -13,12 +14,12 @@ class ShippingDeliveryTime(StructuredValue): """ type_: str = Field("ShippingDeliveryTime", const=True, alias='@type') - transitTime: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + transitTime: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The typical delay the order has been sent for delivery and the goods reach the final customer." "Typical properties: minValue, maxValue, unitCode (d for DAY).", ) - cutoffTime: Optional[Union[List[time], time]] = Field( + cutoffTime: Optional[Union[List[Union[time, str]], Union[time, str]]] = Field( None, description="Order cutoff time allows merchants to describe the time after which they will no longer" "process orders received on that day. For orders processed after cutoff time, one day" @@ -27,7 +28,7 @@ class ShippingDeliveryTime(StructuredValue): "using the ISO-8601 Time format, e.g. \"23:30:00-05:00\" would represent 6:30 pm Eastern" "Standard Time (EST) which is 5 hours behind Coordinated Universal Time (UTC).", ) - handlingTime: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + handlingTime: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The typical delay between the receipt of the order and the goods either leaving the warehouse" "or being prepared for pickup, in case the delivery method is on site pickup. Typical properties:" @@ -35,7 +36,7 @@ class ShippingDeliveryTime(StructuredValue): "business days (if a unitCode is used, coded as \"d\"), i.e. only counting days when the" "business normally operates.", ) - businessDays: Any = Field( + businessDays: Optional[Union[List[Union[OpeningHoursSpecification, str]], Union[OpeningHoursSpecification, str]]] = Field( None, description="Days of the week when the merchant typically operates, indicated via opening hours markup.", ) diff --git a/pydantic_schemaorg/ShippingRateSettings.py b/pydantic_schemaorg/ShippingRateSettings.py index eccd0d1b..7e3cb330 100644 --- a/pydantic_schemaorg/ShippingRateSettings.py +++ b/pydantic_schemaorg/ShippingRateSettings.py @@ -1,6 +1,7 @@ from pydantic import StrictBool, Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.DefinedRegion import DefinedRegion +from pydantic_schemaorg.MonetaryAmount import MonetaryAmount from pydantic_schemaorg.DeliveryChargeSpecification import DeliveryChargeSpecification from pydantic_schemaorg.StructuredValue import StructuredValue @@ -20,27 +21,27 @@ class ShippingRateSettings(StructuredValue): description="Label to match an [[OfferShippingDetails]] with a [[ShippingRateSettings]] (within" "the context of a [[shippingSettingsLink]] cross-reference).", ) - doesNotShip: Optional[Union[List[StrictBool], StrictBool]] = Field( + doesNotShip: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="Indicates when shipping to a particular [[shippingDestination]] is not available.", ) - shippingDestination: Optional[Union[List[DefinedRegion], DefinedRegion]] = Field( + shippingDestination: Optional[Union[List[Union[DefinedRegion, str]], Union[DefinedRegion, str]]] = Field( None, description="indicates (possibly multiple) shipping destinations. These can be defined in several" "ways e.g. postalCode ranges.", ) - shippingRate: Any = Field( + shippingRate: Optional[Union[List[Union[MonetaryAmount, str]], Union[MonetaryAmount, str]]] = Field( None, description="The shipping rate is the cost of shipping to the specified destination. Typically, the" "maxValue and currency values (of the [[MonetaryAmount]]) are most appropriate.", ) - freeShippingThreshold: Union[List[Union[DeliveryChargeSpecification, Any]], Union[DeliveryChargeSpecification, Any]] = Field( + freeShippingThreshold: Optional[Union[List[Union[DeliveryChargeSpecification, MonetaryAmount, str]], Union[DeliveryChargeSpecification, MonetaryAmount, str]]] = Field( None, description="A monetary value above which (or equal to) the shipping rate becomes free. Intended to" "be used via an [[OfferShippingDetails]] with [[shippingSettingsLink]] matching" "this [[ShippingRateSettings]].", ) - isUnlabelledFallback: Optional[Union[List[StrictBool], StrictBool]] = Field( + isUnlabelledFallback: Optional[Union[List[Union[StrictBool, str]], Union[StrictBool, str]]] = Field( None, description="This can be marked 'true' to indicate that some published [[DeliveryTimeSettings]]" "or [[ShippingRateSettings]] are intended to apply to all [[OfferShippingDetails]]" diff --git a/pydantic_schemaorg/SingleFamilyResidence.py b/pydantic_schemaorg/SingleFamilyResidence.py index 70641edd..af7f4e57 100644 --- a/pydantic_schemaorg/SingleFamilyResidence.py +++ b/pydantic_schemaorg/SingleFamilyResidence.py @@ -1,7 +1,7 @@ from pydantic import Field -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.House import House @@ -12,13 +12,13 @@ class SingleFamilyResidence(House): """ type_: str = Field("SingleFamilyResidence", const=True, alias='@type') - numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - occupancy: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + occupancy: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The allowed total occupancy for the accommodation in persons (including infants etc)." "For individual accommodations, this is not necessarily the legal maximum but defines" diff --git a/pydantic_schemaorg/SizeSpecification.py b/pydantic_schemaorg/SizeSpecification.py index 32819a6b..16ff1998 100644 --- a/pydantic_schemaorg/SizeSpecification.py +++ b/pydantic_schemaorg/SizeSpecification.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.SizeSystemEnumeration import SizeSystemEnumeration -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.GenderType import GenderType from pydantic_schemaorg.SizeGroupEnumeration import SizeGroupEnumeration @@ -23,7 +23,7 @@ class SizeSpecification(QualitativeValue): "\"GS1\" or \"ISO-EN13402\"), country code (for example \"US\" or \"JP\"), or a measuring" "system (for example \"Metric\" or \"Imperial\").", ) - hasMeasurement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + hasMeasurement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A product measurement, for example the inseam of pants, the wheel size of a bicycle, or" "the gauge of a screw. Usually an exact measurement, but can also be a range of measurements" @@ -41,12 +41,12 @@ class SizeSpecification(QualitativeValue): "products. Multiple values can be combined, for example \"men's big and tall\", \"petite" "maternity\" or \"regular\"", ) - suggestedAge: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + suggestedAge: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The age or age range for the intended audience or person, for example 3-12 months for infants," "1-5 years for toddlers.", ) - suggestedMeasurement: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + suggestedMeasurement: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="A suggested range of body measurements for the intended audience or person, for example" "inseam between 32 and 34 inches or height between 170 and 190 cm. Typically found on a size" diff --git a/pydantic_schemaorg/SocialMediaPosting.py b/pydantic_schemaorg/SocialMediaPosting.py index 42f5a890..ec6ed8e2 100644 --- a/pydantic_schemaorg/SocialMediaPosting.py +++ b/pydantic_schemaorg/SocialMediaPosting.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Article import Article @@ -11,7 +11,7 @@ class SocialMediaPosting(Article): """ type_: str = Field("SocialMediaPosting", const=True, alias='@type') - sharedContent: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + sharedContent: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="A CreativeWork such as an image, video, or audio clip shared as part of this posting.", ) diff --git a/pydantic_schemaorg/SoftwareApplication.py b/pydantic_schemaorg/SoftwareApplication.py index cc38df77..f9e4e5b7 100644 --- a/pydantic_schemaorg/SoftwareApplication.py +++ b/pydantic_schemaorg/SoftwareApplication.py @@ -1,6 +1,8 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Any, Union +from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.DataFeed import DataFeed class SoftwareApplication(CreativeWork): @@ -18,11 +20,11 @@ class SoftwareApplication(CreativeWork): None, description="Processor architecture required to run the application (e.g. IA64).", ) - installUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + installUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="URL at which the app may be installed, if different from the URL of the item.", ) - screenshot: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + screenshot: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="A link to a screenshot image of the app.", ) @@ -35,7 +37,7 @@ class SoftwareApplication(CreativeWork): None, description="Operating systems supported (Windows 7, OSX 10.6, Android 1.6).", ) - softwareAddOn: Any = Field( + softwareAddOn: Optional[Union[List[Union['SoftwareApplication', str]], Union['SoftwareApplication', str]]] = Field( None, description="Additional content for a software application.", ) @@ -59,7 +61,7 @@ class SoftwareApplication(CreativeWork): "and shared libraries that are not included in the application distribution package," "but required to run the application (Examples: DirectX, Java or .NET runtime).", ) - softwareHelp: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + softwareHelp: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Software application help.", ) @@ -81,7 +83,7 @@ class SoftwareApplication(CreativeWork): None, description="Description of what changed in this version.", ) - downloadUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + downloadUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="If the file can be downloaded, URL to download the binary.", ) @@ -91,7 +93,7 @@ class SoftwareApplication(CreativeWork): "and shared libraries that are not included in the application distribution package," "but required to run the application (Examples: DirectX, Java or .NET runtime).", ) - supportingData: Any = Field( + supportingData: Optional[Union[List[Union[DataFeed, str]], Union[DataFeed, str]]] = Field( None, description="Supporting data for a SoftwareApplication.", ) diff --git a/pydantic_schemaorg/SoftwareSourceCode.py b/pydantic_schemaorg/SoftwareSourceCode.py index 6a7111d4..d50b6719 100644 --- a/pydantic_schemaorg/SoftwareSourceCode.py +++ b/pydantic_schemaorg/SoftwareSourceCode.py @@ -1,5 +1,6 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.ComputerLanguage import ComputerLanguage from pydantic_schemaorg.SoftwareApplication import SoftwareApplication from pydantic_schemaorg.CreativeWork import CreativeWork @@ -12,7 +13,7 @@ class SoftwareSourceCode(CreativeWork): """ type_: str = Field("SoftwareSourceCode", const=True, alias='@type') - codeRepository: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + codeRepository: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="Link to the repository where the un-compiled, human readable code and related code is" "located (SVN, github, CodePlex).", @@ -22,7 +23,7 @@ class SoftwareSourceCode(CreativeWork): description="Runtime platform or script interpreter dependencies (Example - Java v1, Python2.3," ".Net Framework 3.0).", ) - programmingLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + programmingLanguage: Optional[Union[List[Union[str, ComputerLanguage]], Union[str, ComputerLanguage]]] = Field( None, description="The computer programming language.", ) @@ -41,7 +42,7 @@ class SoftwareSourceCode(CreativeWork): description="What type of code sample: full (compile ready) solution, code snippet, inline code," "scripts, template.", ) - targetProduct: Optional[Union[List[SoftwareApplication], SoftwareApplication]] = Field( + targetProduct: Optional[Union[List[Union[SoftwareApplication, str]], Union[SoftwareApplication, str]]] = Field( None, description="Target Operating System / Product to which the code applies. If applies to several versions," "just the product name can be used.", diff --git a/pydantic_schemaorg/SolveMathAction.py b/pydantic_schemaorg/SolveMathAction.py index be6cb8ef..70d46d72 100644 --- a/pydantic_schemaorg/SolveMathAction.py +++ b/pydantic_schemaorg/SolveMathAction.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Action import Action diff --git a/pydantic_schemaorg/SomeProducts.py b/pydantic_schemaorg/SomeProducts.py index b8800bdc..e8c14d29 100644 --- a/pydantic_schemaorg/SomeProducts.py +++ b/pydantic_schemaorg/SomeProducts.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product @@ -10,7 +11,7 @@ class SomeProducts(Product): """ type_: str = Field("SomeProducts", const=True, alias='@type') - inventoryLevel: Any = Field( + inventoryLevel: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The current approximate inventory level for the item or items.", ) diff --git a/pydantic_schemaorg/SpeakableSpecification.py b/pydantic_schemaorg/SpeakableSpecification.py index 46f06930..9b9a5779 100644 --- a/pydantic_schemaorg/SpeakableSpecification.py +++ b/pydantic_schemaorg/SpeakableSpecification.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Intangible import Intangible diff --git a/pydantic_schemaorg/SpecialAnnouncement.py b/pydantic_schemaorg/SpecialAnnouncement.py index 0d8e0806..83cd0628 100644 --- a/pydantic_schemaorg/SpecialAnnouncement.py +++ b/pydantic_schemaorg/SpecialAnnouncement.py @@ -1,12 +1,13 @@ -from pydantic import Field, AnyUrl -from pydantic_schemaorg.LocalBusiness import LocalBusiness +from pydantic import AnyUrl, Field from pydantic_schemaorg.CivicStructure import CivicStructure -from typing import Any, Optional, Union, List +from pydantic_schemaorg.LocalBusiness import LocalBusiness +from typing import List, Optional, Union from pydantic_schemaorg.WebContent import WebContent -from pydantic_schemaorg.Dataset import Dataset +from pydantic_schemaorg.GovernmentService import GovernmentService from pydantic_schemaorg.Observation import Observation -from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory +from pydantic_schemaorg.Dataset import Dataset from pydantic_schemaorg.Thing import Thing +from pydantic_schemaorg.PhysicalActivityCategory import PhysicalActivityCategory from datetime import datetime, date from pydantic_schemaorg.DataFeed import DataFeed from pydantic_schemaorg.CreativeWork import CreativeWork @@ -64,66 +65,66 @@ class SpecialAnnouncement(CreativeWork): """ type_: str = Field("SpecialAnnouncement", const=True, alias='@type') - announcementLocation: Optional[Union[List[Union[LocalBusiness, CivicStructure]], Union[LocalBusiness, CivicStructure]]] = Field( + announcementLocation: Optional[Union[List[Union[CivicStructure, LocalBusiness, str]], Union[CivicStructure, LocalBusiness, str]]] = Field( None, description="Indicates a specific [[CivicStructure]] or [[LocalBusiness]] associated with the" "SpecialAnnouncement. For example, a specific testing facility or business with special" "opening hours. For a larger geographic region like a quarantine of an entire region," "use [[spatialCoverage]].", ) - quarantineGuidelines: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + quarantineGuidelines: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Guidelines about quarantine rules, e.g. in the context of a pandemic.", ) - governmentBenefitsInfo: Any = Field( + governmentBenefitsInfo: Optional[Union[List[Union[GovernmentService, str]], Union[GovernmentService, str]]] = Field( None, description="governmentBenefitsInfo provides information about government benefits associated" "with a SpecialAnnouncement.", ) - diseaseSpreadStatistics: Optional[Union[List[Union[AnyUrl, Dataset, Observation, WebContent]], Union[AnyUrl, Dataset, Observation, WebContent]]] = Field( + diseaseSpreadStatistics: Optional[Union[List[Union[AnyUrl, Observation, WebContent, Dataset, str]], Union[AnyUrl, Observation, WebContent, Dataset, str]]] = Field( None, description="Statistical information about the spread of a disease, either as [[WebContent]], or" "described directly as a [[Dataset]], or the specific [[Observation]]s in the dataset." "When a [[WebContent]] URL is provided, the page indicated might also contain more such" "markup.", ) - travelBans: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + travelBans: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Information about travel bans, e.g. in the context of a pandemic.", ) - category: Optional[Union[List[Union[AnyUrl, str, PhysicalActivityCategory, Thing]], Union[AnyUrl, str, PhysicalActivityCategory, Thing]]] = Field( + category: Optional[Union[List[Union[AnyUrl, str, Thing, PhysicalActivityCategory]], Union[AnyUrl, str, Thing, PhysicalActivityCategory]]] = Field( None, description="A category for the item. Greater signs or slashes can be used to informally indicate a" "category hierarchy.", ) - schoolClosuresInfo: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + schoolClosuresInfo: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Information about school closures.", ) - datePosted: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + datePosted: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="Publication date of an online listing.", ) - webFeed: Optional[Union[List[Union[AnyUrl, DataFeed]], Union[AnyUrl, DataFeed]]] = Field( + webFeed: Optional[Union[List[Union[AnyUrl, DataFeed, str]], Union[AnyUrl, DataFeed, str]]] = Field( None, description="The URL for a feed, e.g. associated with a podcast series, blog, or series of date-stamped" "updates. This is usually RSS or Atom.", ) - gettingTestedInfo: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + gettingTestedInfo: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Information about getting tested (for a [[MedicalCondition]]), e.g. in the context" "of a pandemic.", ) - newsUpdatesAndGuidelines: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + newsUpdatesAndGuidelines: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Indicates a page with news updates and guidelines. This could often be (but is not required" "to be) the main page containing [[SpecialAnnouncement]] markup on a site.", ) - publicTransportClosuresInfo: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + publicTransportClosuresInfo: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Information about public transport closures.", ) - diseasePreventionInfo: Optional[Union[List[Union[AnyUrl, WebContent]], Union[AnyUrl, WebContent]]] = Field( + diseasePreventionInfo: Optional[Union[List[Union[AnyUrl, WebContent, str]], Union[AnyUrl, WebContent, str]]] = Field( None, description="Information about disease prevention.", ) diff --git a/pydantic_schemaorg/SportsEvent.py b/pydantic_schemaorg/SportsEvent.py index 59ee00e6..1ef1c2d4 100644 --- a/pydantic_schemaorg/SportsEvent.py +++ b/pydantic_schemaorg/SportsEvent.py @@ -1,7 +1,7 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Person import Person +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.SportsTeam import SportsTeam +from pydantic_schemaorg.Person import Person from pydantic_schemaorg.Event import Event @@ -16,15 +16,15 @@ class SportsEvent(Event): None, description="A type of sport (e.g. Baseball).", ) - awayTeam: Optional[Union[List[Union[Person, SportsTeam]], Union[Person, SportsTeam]]] = Field( + awayTeam: Optional[Union[List[Union[SportsTeam, Person, str]], Union[SportsTeam, Person, str]]] = Field( None, description="The away team in a sports event.", ) - homeTeam: Optional[Union[List[Union[Person, SportsTeam]], Union[Person, SportsTeam]]] = Field( + homeTeam: Optional[Union[List[Union[SportsTeam, Person, str]], Union[SportsTeam, Person, str]]] = Field( None, description="The home team in a sports event.", ) - competitor: Optional[Union[List[Union[Person, SportsTeam]], Union[Person, SportsTeam]]] = Field( + competitor: Optional[Union[List[Union[SportsTeam, Person, str]], Union[SportsTeam, Person, str]]] = Field( None, description="A competitor in a sports event.", ) diff --git a/pydantic_schemaorg/SportsOrganization.py b/pydantic_schemaorg/SportsOrganization.py index 7372713a..3350f292 100644 --- a/pydantic_schemaorg/SportsOrganization.py +++ b/pydantic_schemaorg/SportsOrganization.py @@ -1,5 +1,5 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union from pydantic_schemaorg.Organization import Organization diff --git a/pydantic_schemaorg/SportsTeam.py b/pydantic_schemaorg/SportsTeam.py index 22a50f35..a50ef28b 100644 --- a/pydantic_schemaorg/SportsTeam.py +++ b/pydantic_schemaorg/SportsTeam.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.GenderType import GenderType -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Person import Person from pydantic_schemaorg.SportsOrganization import SportsOrganization @@ -21,11 +21,11 @@ class SportsTeam(SportsOrganization): "of sports teams. As with the gender of individuals, we do not try to enumerate all possibilities." "A mixed-gender [[SportsTeam]] can be indicated with a text value of \"Mixed\".", ) - athlete: Optional[Union[List[Person], Person]] = Field( + athlete: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person that acts as performing member of a sports team; a player as opposed to a coach.", ) - coach: Optional[Union[List[Person], Person]] = Field( + coach: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A person that acts in a coaching role for a sports team.", ) diff --git a/pydantic_schemaorg/StadiumOrArena.py b/pydantic_schemaorg/StadiumOrArena.py index db3ee088..55ee1975 100644 --- a/pydantic_schemaorg/StadiumOrArena.py +++ b/pydantic_schemaorg/StadiumOrArena.py @@ -1,9 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.SportsActivityLocation import SportsActivityLocation from pydantic_schemaorg.CivicStructure import CivicStructure +from pydantic_schemaorg.SportsActivityLocation import SportsActivityLocation -class StadiumOrArena(SportsActivityLocation, CivicStructure): +class StadiumOrArena(CivicStructure, SportsActivityLocation): """A stadium. See https://schema.org/StadiumOrArena. diff --git a/pydantic_schemaorg/StatisticalPopulation.py b/pydantic_schemaorg/StatisticalPopulation.py index 9e533648..a91a7038 100644 --- a/pydantic_schemaorg/StatisticalPopulation.py +++ b/pydantic_schemaorg/StatisticalPopulation.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Class import Class from pydantic_schemaorg.Intangible import Intangible @@ -22,18 +22,18 @@ class StatisticalPopulation(Intangible): """ type_: str = Field("StatisticalPopulation", const=True, alias='@type') - numConstraints: Optional[Union[List[int], int]] = Field( + numConstraints: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Indicates the number of constraints (not counting [[populationType]]) defined for" "a particular [[StatisticalPopulation]]. This helps applications understand if they" "have access to a sufficiently complete description of a [[StatisticalPopulation]].", ) - constrainingProperty: Optional[Union[List[int], int]] = Field( + constrainingProperty: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="Indicates a property used as a constraint to define a [[StatisticalPopulation]] with" "respect to the set of entities corresponding to an indicated type (via [[populationType]]).", ) - populationType: Optional[Union[List[Class], Class]] = Field( + populationType: Optional[Union[List[Union[Class, str]], Union[Class, str]]] = Field( None, description="Indicates the populationType common to all members of a [[StatisticalPopulation]].", ) diff --git a/pydantic_schemaorg/Substance.py b/pydantic_schemaorg/Substance.py index 46e79e51..e774f78d 100644 --- a/pydantic_schemaorg/Substance.py +++ b/pydantic_schemaorg/Substance.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.MaximumDoseSchedule import MaximumDoseSchedule from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -15,7 +16,7 @@ class Substance(MedicalEntity): None, description="An active ingredient, typically chemical compounds and/or biologic substances.", ) - maximumIntake: Any = Field( + maximumIntake: Optional[Union[List[Union[MaximumDoseSchedule, str]], Union[MaximumDoseSchedule, str]]] = Field( None, description="Recommended intake of this supplement for a given population as defined by a specific" "recommending authority.", diff --git a/pydantic_schemaorg/Suite.py b/pydantic_schemaorg/Suite.py index 430a46ed..a92fad56 100644 --- a/pydantic_schemaorg/Suite.py +++ b/pydantic_schemaorg/Suite.py @@ -1,8 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from decimal import Decimal -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.BedDetails import BedDetails +from pydantic_schemaorg.BedType import BedType from pydantic_schemaorg.Accommodation import Accommodation @@ -17,20 +18,20 @@ class Suite(Accommodation): """ type_: str = Field("Suite", const=True, alias='@type') - numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfRooms: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of rooms (excluding bathrooms and closets) of the accommodation or lodging" "business. Typical unit code(s): ROM for room or C62 for no unit. The type of room can be" "put in the unitText property of the QuantitativeValue.", ) - bed: Union[List[Union[str, BedDetails, Any]], Union[str, BedDetails, Any]] = Field( + bed: Optional[Union[List[Union[str, BedDetails, BedType]], Union[str, BedDetails, BedType]]] = Field( None, description="The type of bed or beds included in the accommodation. For the single case of just one bed" "of a certain type, you use bed directly with a text. If you want to indicate the quantity" "of a certain kind of bed, use an instance of BedDetails. For more detailed information," "use the amenityFeature property.", ) - occupancy: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + occupancy: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The allowed total occupancy for the accommodation in persons (including infants etc)." "For individual accommodations, this is not necessarily the legal maximum but defines" diff --git a/pydantic_schemaorg/SuperficialAnatomy.py b/pydantic_schemaorg/SuperficialAnatomy.py index fd1e7813..fb33cee9 100644 --- a/pydantic_schemaorg/SuperficialAnatomy.py +++ b/pydantic_schemaorg/SuperficialAnatomy.py @@ -1,6 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem from pydantic_schemaorg.MedicalCondition import MedicalCondition from pydantic_schemaorg.MedicalTherapy import MedicalTherapy from pydantic_schemaorg.MedicalEntity import MedicalEntity @@ -33,15 +34,15 @@ class SuperficialAnatomy(MedicalEntity): "of the superficial anatomy can suggest underlying medical conditions or courses of" "treatment.", ) - relatedAnatomy: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + relatedAnatomy: Optional[Union[List[Union[AnatomicalStructure, AnatomicalSystem, str]], Union[AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="Anatomical systems or structures that relate to the superficial anatomy.", ) - relatedCondition: Optional[Union[List[MedicalCondition], MedicalCondition]] = Field( + relatedCondition: Optional[Union[List[Union[MedicalCondition, str]], Union[MedicalCondition, str]]] = Field( None, description="A medical condition associated with this anatomy.", ) - relatedTherapy: Optional[Union[List[MedicalTherapy], MedicalTherapy]] = Field( + relatedTherapy: Optional[Union[List[Union[MedicalTherapy, str]], Union[MedicalTherapy, str]]] = Field( None, description="A medical therapy related to this anatomy.", ) diff --git a/pydantic_schemaorg/TVClip.py b/pydantic_schemaorg/TVClip.py index 7d634b10..25f7a141 100644 --- a/pydantic_schemaorg/TVClip.py +++ b/pydantic_schemaorg/TVClip.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.TVSeries import TVSeries -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Clip import Clip @@ -11,7 +11,7 @@ class TVClip(Clip): """ type_: str = Field("TVClip", const=True, alias='@type') - partOfTVSeries: Optional[Union[List[TVSeries], TVSeries]] = Field( + partOfTVSeries: Optional[Union[List[Union[TVSeries, str]], Union[TVSeries, str]]] = Field( None, description="The TV series to which this episode or season belongs.", ) diff --git a/pydantic_schemaorg/TVEpisode.py b/pydantic_schemaorg/TVEpisode.py index 2b825894..4bd5025b 100644 --- a/pydantic_schemaorg/TVEpisode.py +++ b/pydantic_schemaorg/TVEpisode.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Language import Language -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Country import Country from pydantic_schemaorg.TVSeries import TVSeries from pydantic_schemaorg.Episode import Episode @@ -17,7 +17,7 @@ class TVEpisode(Episode): None, description="Languages in which subtitles/captions are available, in [IETF BCP 47 standard format](http://tools.ietf.org/html/bcp47).", ) - countryOfOrigin: Optional[Union[List[Country], Country]] = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -37,7 +37,7 @@ class TVEpisode(Episode): "their multiple expressions, it is possible to use [[titleEIDR]] alone (for a general" "description), or alongside [[editEIDR]] for a more edit-specific description.", ) - partOfTVSeries: Optional[Union[List[TVSeries], TVSeries]] = Field( + partOfTVSeries: Optional[Union[List[Union[TVSeries, str]], Union[TVSeries, str]]] = Field( None, description="The TV series to which this episode or season belongs.", ) diff --git a/pydantic_schemaorg/TVSeason.py b/pydantic_schemaorg/TVSeason.py index 7b1b6b2a..71137565 100644 --- a/pydantic_schemaorg/TVSeason.py +++ b/pydantic_schemaorg/TVSeason.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Country import Country -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TVSeries import TVSeries from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason from pydantic_schemaorg.CreativeWork import CreativeWork @@ -13,7 +13,7 @@ class TVSeason(CreativeWorkSeason, CreativeWork): """ type_: str = Field("TVSeason", const=True, alias='@type') - countryOfOrigin: Optional[Union[List[Country], Country]] = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -23,7 +23,7 @@ class TVSeason(CreativeWorkSeason, CreativeWork): "case of products, the country of origin of the product. The exact interpretation of this" "may vary by context and product type, and cannot be fully enumerated here.", ) - partOfTVSeries: Optional[Union[List[TVSeries], TVSeries]] = Field( + partOfTVSeries: Optional[Union[List[Union[TVSeries, str]], Union[TVSeries, str]]] = Field( None, description="The TV series to which this episode or season belongs.", ) diff --git a/pydantic_schemaorg/TVSeries.py b/pydantic_schemaorg/TVSeries.py index 9f494eee..376fcc91 100644 --- a/pydantic_schemaorg/TVSeries.py +++ b/pydantic_schemaorg/TVSeries.py @@ -1,45 +1,49 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason +from pydantic_schemaorg.VideoObject import VideoObject from pydantic_schemaorg.Episode import Episode +from pydantic_schemaorg.Country import Country from pydantic_schemaorg.Organization import Organization -from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries +from pydantic_schemaorg.CreativeWork import CreativeWork -class TVSeries(CreativeWork, CreativeWorkSeries): +class TVSeries(CreativeWorkSeries, CreativeWork): """CreativeWorkSeries dedicated to TV broadcast and associated online delivery. See https://schema.org/TVSeries. """ type_: str = Field("TVSeries", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - containsSeason: Any = Field( + containsSeason: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season that is part of the media series.", ) - numberOfSeasons: Optional[Union[List[int], int]] = Field( + numberOfSeasons: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of seasons in this series.", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - episodes: Optional[Union[List[Episode], Episode]] = Field( + episodes: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a TV/radio series or season.", ) - numberOfEpisodes: Optional[Union[List[int], int]] = Field( + numberOfEpisodes: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of episodes in this season or series.", ) - countryOfOrigin: Any = Field( + countryOfOrigin: Optional[Union[List[Union[Country, str]], Union[Country, str]]] = Field( None, description="The country of origin of something, including products as well as creative works such" "as movie and TV content. In the case of TV and movie, this would be the country of the principle" @@ -49,39 +53,39 @@ class TVSeries(CreativeWork, CreativeWorkSeries): "case of products, the country of origin of the product. The exact interpretation of this" "may vary by context and product type, and cannot be fully enumerated here.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", ) - seasons: Any = Field( + seasons: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - season: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + season: Optional[Union[List[Union[AnyUrl, CreativeWorkSeason, str]], Union[AnyUrl, CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - episode: Optional[Union[List[Episode], Episode]] = Field( + episode: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a tv, radio or game media within a series or season.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/TaxiReservation.py b/pydantic_schemaorg/TaxiReservation.py index 95da6cdb..664cb08c 100644 --- a/pydantic_schemaorg/TaxiReservation.py +++ b/pydantic_schemaorg/TaxiReservation.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from pydantic_schemaorg.Place import Place from datetime import datetime from pydantic_schemaorg.Reservation import Reservation @@ -14,15 +15,15 @@ class TaxiReservation(Reservation): """ type_: str = Field("TaxiReservation", const=True, alias='@type') - partySize: Union[List[Union[int, Any]], Union[int, Any]] = Field( + partySize: Optional[Union[List[Union[int, QuantitativeValue, str]], Union[int, QuantitativeValue, str]]] = Field( None, description="Number of people the reservation should accommodate.", ) - pickupLocation: Optional[Union[List[Place], Place]] = Field( + pickupLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="Where a taxi will pick up a passenger or a rental car can be picked up.", ) - pickupTime: Optional[Union[List[datetime], datetime]] = Field( + pickupTime: Optional[Union[List[Union[datetime, str]], Union[datetime, str]]] = Field( None, description="When a taxi will pickup a passenger or a rental car can be picked up.", ) diff --git a/pydantic_schemaorg/Taxon.py b/pydantic_schemaorg/Taxon.py index b7c3ed25..20037290 100644 --- a/pydantic_schemaorg/Taxon.py +++ b/pydantic_schemaorg/Taxon.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.DefinedTerm import DefinedTerm -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PropertyValue import PropertyValue from pydantic_schemaorg.Thing import Thing @@ -12,15 +12,15 @@ class Taxon(Thing): """ type_: str = Field("Taxon", const=True, alias='@type') - hasDefinedTerm: Optional[Union[List[DefinedTerm], DefinedTerm]] = Field( + hasDefinedTerm: Optional[Union[List[Union[DefinedTerm, str]], Union[DefinedTerm, str]]] = Field( None, description="A Defined Term contained in this term set.", ) - childTaxon: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + childTaxon: Optional[Union[List[Union[AnyUrl, str, 'Taxon']], Union[AnyUrl, str, 'Taxon']]] = Field( None, description="Closest child taxa of the taxon in question.", ) - parentTaxon: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + parentTaxon: Optional[Union[List[Union[AnyUrl, str, 'Taxon']], Union[AnyUrl, str, 'Taxon']]] = Field( None, description="Closest parent taxon of the taxon in question.", ) diff --git a/pydantic_schemaorg/TechArticle.py b/pydantic_schemaorg/TechArticle.py index 6038396f..17b51334 100644 --- a/pydantic_schemaorg/TechArticle.py +++ b/pydantic_schemaorg/TechArticle.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.Article import Article diff --git a/pydantic_schemaorg/TherapeuticProcedure.py b/pydantic_schemaorg/TherapeuticProcedure.py index afe6b22c..2b63fb3d 100644 --- a/pydantic_schemaorg/TherapeuticProcedure.py +++ b/pydantic_schemaorg/TherapeuticProcedure.py @@ -1,6 +1,8 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.DoseSchedule import DoseSchedule +from typing import List, Optional, Union from pydantic_schemaorg.MedicalEntity import MedicalEntity +from pydantic_schemaorg.Drug import Drug from pydantic_schemaorg.MedicalProcedure import MedicalProcedure @@ -12,19 +14,19 @@ class TherapeuticProcedure(MedicalProcedure): """ type_: str = Field("TherapeuticProcedure", const=True, alias='@type') - doseSchedule: Any = Field( + doseSchedule: Optional[Union[List[Union[DoseSchedule, str]], Union[DoseSchedule, str]]] = Field( None, description="A dosing schedule for the drug for a given population, either observed, recommended," "or maximum dose based on the type used.", ) - adverseOutcome: Optional[Union[List[MedicalEntity], MedicalEntity]] = Field( + adverseOutcome: Optional[Union[List[Union[MedicalEntity, str]], Union[MedicalEntity, str]]] = Field( None, description="A possible complication and/or side effect of this therapy. If it is known that an adverse" "outcome is serious (resulting in death, disability, or permanent damage; requiring" "hospitalization; or is otherwise life-threatening or requires immediate medical" "attention), tag it as a seriouseAdverseOutcome instead.", ) - drug: Any = Field( + drug: Optional[Union[List[Union[Drug, str]], Union[Drug, str]]] = Field( None, description="Specifying a drug or medicine used in a medication procedure.", ) diff --git a/pydantic_schemaorg/Thesis.py b/pydantic_schemaorg/Thesis.py index 3280c521..91f0af5e 100644 --- a/pydantic_schemaorg/Thesis.py +++ b/pydantic_schemaorg/Thesis.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/Thing.py b/pydantic_schemaorg/Thing.py index 15355a5c..c9a1e399 100644 --- a/pydantic_schemaorg/Thing.py +++ b/pydantic_schemaorg/Thing.py @@ -1,5 +1,10 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from pydantic_schemaorg.CreativeWork import CreativeWork +from typing import List, Optional, Union +from pydantic_schemaorg.PropertyValue import PropertyValue +from pydantic_schemaorg.Action import Action +from pydantic_schemaorg.Event import Event +from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.SchemaOrgBase import SchemaOrgBase @@ -10,13 +15,13 @@ class Thing(SchemaOrgBase): """ type_: str = Field("Thing", const=True, alias='@type') - mainEntityOfPage: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + mainEntityOfPage: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Indicates a page (or other CreativeWork) for which this thing is the main entity being" "described. See [background notes](/docs/datamodel.html#mainEntityBackground)" "for details.", ) - additionalType: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + additionalType: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="An additional type for the item, typically used for adding more specific types from external" "vocabularies in microdata syntax. This is a relationship between something and a class" @@ -24,7 +29,7 @@ class Thing(SchemaOrgBase): "attribute - for multiple types. Schema.org tools may have only weaker understanding" "of extra types, in particular those defined externally.", ) - url: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + url: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="URL of the item.", ) @@ -32,7 +37,7 @@ class Thing(SchemaOrgBase): None, description="An alias for the item.", ) - sameAs: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + sameAs: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="URL of a reference Web page that unambiguously indicates the item's identity. E.g. the" "URL of the item's Wikipedia page, Wikidata entry, or official website.", @@ -41,19 +46,19 @@ class Thing(SchemaOrgBase): None, description="The name of the item.", ) - identifier: Union[List[Union[AnyUrl, str, Any]], Union[AnyUrl, str, Any]] = Field( + identifier: Optional[Union[List[Union[AnyUrl, str, PropertyValue]], Union[AnyUrl, str, PropertyValue]]] = Field( None, description="The identifier property represents any kind of identifier for any kind of [[Thing]]," "such as ISBNs, GTIN codes, UUIDs etc. Schema.org provides dedicated properties for" "representing many of these, either as textual strings or as URL (URI) links. See [background" "notes](/docs/datamodel.html#identifierBg) for more details.", ) - potentialAction: Any = Field( + potentialAction: Optional[Union[List[Union[Action, str]], Union[Action, str]]] = Field( None, description="Indicates a potential Action, which describes an idealized action in which this thing" "would play an 'object' role.", ) - subjectOf: Any = Field( + subjectOf: Optional[Union[List[Union[CreativeWork, Event, str]], Union[CreativeWork, Event, str]]] = Field( None, description="A CreativeWork or Event about this Thing.", ) @@ -67,7 +72,7 @@ class Thing(SchemaOrgBase): "other, similar items. Information from other properties (in particular, name) may" "be necessary for the description to be useful for disambiguation.", ) - image: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + image: Optional[Union[List[Union[AnyUrl, ImageObject, str]], Union[AnyUrl, ImageObject, str]]] = Field( None, description="An image of the item. This can be a [[URL]] or a fully described [[ImageObject]].", ) diff --git a/pydantic_schemaorg/Ticket.py b/pydantic_schemaorg/Ticket.py index b774e5b5..86cd45dc 100644 --- a/pydantic_schemaorg/Ticket.py +++ b/pydantic_schemaorg/Ticket.py @@ -1,10 +1,11 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List -from pydantic_schemaorg.PriceSpecification import PriceSpecification +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.PriceSpecification import PriceSpecification from datetime import datetime, date +from pydantic_schemaorg.Seat import Seat from pydantic_schemaorg.Intangible import Intangible @@ -15,7 +16,7 @@ class Ticket(Intangible): """ type_: str = Field("Ticket", const=True, alias='@type') - underName: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + underName: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The person or organization the reservation or ticket is for.", ) @@ -43,15 +44,15 @@ class Ticket(Intangible): "'.' (Unicode 'FULL STOP' (U+002E)) rather than ',' to indicate a decimal point. Avoid" "using these symbols as a readability separator.", ) - dateIssued: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + dateIssued: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The date the ticket was issued.", ) - ticketedSeat: Any = Field( + ticketedSeat: Optional[Union[List[Union[Seat, str]], Union[Seat, str]]] = Field( None, description="The seat associated with the ticket.", ) - issuedBy: Optional[Union[List[Organization], Organization]] = Field( + issuedBy: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The organization issuing the ticket or permit.", ) diff --git a/pydantic_schemaorg/TipAction.py b/pydantic_schemaorg/TipAction.py index 29a31bc7..129f6ceb 100644 --- a/pydantic_schemaorg/TipAction.py +++ b/pydantic_schemaorg/TipAction.py @@ -1,8 +1,9 @@ from pydantic import Field -from pydantic_schemaorg.Organization import Organization +from pydantic_schemaorg.ContactPoint import ContactPoint from pydantic_schemaorg.Audience import Audience +from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.TradeAction import TradeAction @@ -13,7 +14,7 @@ class TipAction(TradeAction): """ type_: str = Field("TipAction", const=True, alias='@type') - recipient: Union[List[Union[Organization, Audience, Person, Any]], Union[Organization, Audience, Person, Any]] = Field( + recipient: Optional[Union[List[Union[ContactPoint, Audience, Organization, Person, str]], Union[ContactPoint, Audience, Organization, Person, str]]] = Field( None, description="A sub property of participant. The participant who is at the receiving end of the action.", ) diff --git a/pydantic_schemaorg/TouristAttraction.py b/pydantic_schemaorg/TouristAttraction.py index c6d36136..9160b458 100644 --- a/pydantic_schemaorg/TouristAttraction.py +++ b/pydantic_schemaorg/TouristAttraction.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Language import Language +from typing import List, Optional, Union from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.Place import Place @@ -15,7 +16,7 @@ class TouristAttraction(Place): """ type_: str = Field("TouristAttraction", const=True, alias='@type') - availableLanguage: Union[List[Union[str, Any]], Union[str, Any]] = Field( + availableLanguage: Optional[Union[List[Union[str, Language]], Union[str, Language]]] = Field( None, description="A language someone may use with or at the item, service or place. Please use one of the language" "codes from the [IETF BCP 47 standard](http://tools.ietf.org/html/bcp47). See also" diff --git a/pydantic_schemaorg/TouristDestination.py b/pydantic_schemaorg/TouristDestination.py index db427b25..15c8c1b7 100644 --- a/pydantic_schemaorg/TouristDestination.py +++ b/pydantic_schemaorg/TouristDestination.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.TouristAttraction import TouristAttraction -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Audience import Audience from pydantic_schemaorg.Place import Place @@ -19,7 +19,7 @@ class TouristDestination(Place): """ type_: str = Field("TouristDestination", const=True, alias='@type') - includesAttraction: Optional[Union[List[TouristAttraction], TouristAttraction]] = Field( + includesAttraction: Optional[Union[List[Union[TouristAttraction, str]], Union[TouristAttraction, str]]] = Field( None, description="Attraction located at destination.", ) diff --git a/pydantic_schemaorg/TouristTrip.py b/pydantic_schemaorg/TouristTrip.py index a086bd76..71c15393 100644 --- a/pydantic_schemaorg/TouristTrip.py +++ b/pydantic_schemaorg/TouristTrip.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Audience import Audience -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Trip import Trip diff --git a/pydantic_schemaorg/TrackAction.py b/pydantic_schemaorg/TrackAction.py index 4af38e49..5abfc23a 100644 --- a/pydantic_schemaorg/TrackAction.py +++ b/pydantic_schemaorg/TrackAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.DeliveryMethod import DeliveryMethod -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.FindAction import FindAction @@ -14,7 +14,7 @@ class TrackAction(FindAction): """ type_: str = Field("TrackAction", const=True, alias='@type') - deliveryMethod: Optional[Union[List[DeliveryMethod], DeliveryMethod]] = Field( + deliveryMethod: Optional[Union[List[Union[DeliveryMethod, str]], Union[DeliveryMethod, str]]] = Field( None, description="A sub property of instrument. The method of delivery.", ) diff --git a/pydantic_schemaorg/TradeAction.py b/pydantic_schemaorg/TradeAction.py index 78e9e8be..57402cb0 100644 --- a/pydantic_schemaorg/TradeAction.py +++ b/pydantic_schemaorg/TradeAction.py @@ -1,6 +1,7 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.PriceSpecification import PriceSpecification from pydantic_schemaorg.Action import Action @@ -38,7 +39,7 @@ class TradeAction(Action): "0123456789 (Unicode 'DIGIT ZERO' (U+0030) to 'DIGIT NINE' (U+0039)) rather than superficially" "similiar Unicode symbols.", ) - priceSpecification: Any = Field( + priceSpecification: Optional[Union[List[Union[PriceSpecification, str]], Union[PriceSpecification, str]]] = Field( None, description="One or more detailed price specifications, indicating the unit price and delivery or" "payment charges.", diff --git a/pydantic_schemaorg/TrainTrip.py b/pydantic_schemaorg/TrainTrip.py index 8c102d53..85f8119b 100644 --- a/pydantic_schemaorg/TrainTrip.py +++ b/pydantic_schemaorg/TrainTrip.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.TrainStation import TrainStation +from typing import List, Optional, Union from pydantic_schemaorg.Trip import Trip @@ -10,7 +11,7 @@ class TrainTrip(Trip): """ type_: str = Field("TrainTrip", const=True, alias='@type') - arrivalStation: Any = Field( + arrivalStation: Optional[Union[List[Union[TrainStation, str]], Union[TrainStation, str]]] = Field( None, description="The station where the train trip ends.", ) @@ -30,7 +31,7 @@ class TrainTrip(Trip): None, description="The name of the train (e.g. The Orient Express).", ) - departureStation: Any = Field( + departureStation: Optional[Union[List[Union[TrainStation, str]], Union[TrainStation, str]]] = Field( None, description="The station from which the train departs.", ) diff --git a/pydantic_schemaorg/TransferAction.py b/pydantic_schemaorg/TransferAction.py index 045ed3d0..a202d4ca 100644 --- a/pydantic_schemaorg/TransferAction.py +++ b/pydantic_schemaorg/TransferAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Place import Place -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Action import Action @@ -12,12 +12,12 @@ class TransferAction(Action): """ type_: str = Field("TransferAction", const=True, alias='@type') - fromLocation: Optional[Union[List[Place], Place]] = Field( + fromLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The original location of the object or the agent before the" "action.", ) - toLocation: Optional[Union[List[Place], Place]] = Field( + toLocation: Optional[Union[List[Union[Place, str]], Union[Place, str]]] = Field( None, description="A sub property of location. The final location of the object or the agent after the action.", ) diff --git a/pydantic_schemaorg/TravelAction.py b/pydantic_schemaorg/TravelAction.py index 83b0c375..e325f101 100644 --- a/pydantic_schemaorg/TravelAction.py +++ b/pydantic_schemaorg/TravelAction.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.Distance import Distance +from typing import List, Optional, Union from pydantic_schemaorg.MoveAction import MoveAction @@ -11,7 +12,7 @@ class TravelAction(MoveAction): """ type_: str = Field("TravelAction", const=True, alias='@type') - distance: Any = Field( + distance: Optional[Union[List[Union[Distance, str]], Union[Distance, str]]] = Field( None, description="The distance travelled, e.g. exercising or travelling.", ) diff --git a/pydantic_schemaorg/Trip.py b/pydantic_schemaorg/Trip.py index 1ca7b1f3..4a1aa169 100644 --- a/pydantic_schemaorg/Trip.py +++ b/pydantic_schemaorg/Trip.py @@ -1,7 +1,7 @@ from pydantic import Field from pydantic_schemaorg.Demand import Demand from pydantic_schemaorg.Offer import Offer -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime, time from pydantic_schemaorg.ItemList import ItemList from pydantic_schemaorg.Place import Place @@ -17,7 +17,7 @@ class Trip(Intangible): """ type_: str = Field("Trip", const=True, alias='@type') - offers: Optional[Union[List[Union[Demand, Offer]], Union[Demand, Offer]]] = Field( + offers: Optional[Union[List[Union[Demand, Offer, str]], Union[Demand, Offer, str]]] = Field( None, description="An offer to provide this item—for example, an offer to sell a product, rent the" "DVD of a movie, perform a service, or give away tickets to an event. Use [[businessFunction]]" @@ -26,31 +26,31 @@ class Trip(Intangible): "of common types, it can be used in others. In that case, using a second type, such as Product" "or a subtype of Product, can clarify the nature of the offer.", ) - departureTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + departureTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The expected departure time.", ) - itinerary: Optional[Union[List[Union[ItemList, Place]], Union[ItemList, Place]]] = Field( + itinerary: Optional[Union[List[Union[ItemList, Place, str]], Union[ItemList, Place, str]]] = Field( None, description="Destination(s) ( [[Place]] ) that make up a trip. For a trip where destination order is" "important use [[ItemList]] to specify that order (see examples).", ) - subTrip: Any = Field( + subTrip: Optional[Union[List[Union['Trip', str]], Union['Trip', str]]] = Field( None, description="Identifies a [[Trip]] that is a subTrip of this Trip. For example Day 1, Day 2, etc. of a" "multi-day trip.", ) - arrivalTime: Optional[Union[List[Union[datetime, time]], Union[datetime, time]]] = Field( + arrivalTime: Optional[Union[List[Union[datetime, time, str]], Union[datetime, time, str]]] = Field( None, description="The expected arrival time.", ) - provider: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + provider: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The service provider, service operator, or service performer; the goods producer." "Another party (a seller) may offer those services or goods on behalf of the provider." "A provider may also serve as the seller.", ) - partOfTrip: Any = Field( + partOfTrip: Optional[Union[List[Union['Trip', str]], Union['Trip', str]]] = Field( None, description="Identifies that this [[Trip]] is a subTrip of another Trip. For example Day 1, Day 2, etc." "of a multi-day trip.", diff --git a/pydantic_schemaorg/TypeAndQuantityNode.py b/pydantic_schemaorg/TypeAndQuantityNode.py index 9a072fd6..ba44fd93 100644 --- a/pydantic_schemaorg/TypeAndQuantityNode.py +++ b/pydantic_schemaorg/TypeAndQuantityNode.py @@ -1,7 +1,8 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List -from pydantic_schemaorg.Service import Service +from pydantic import AnyUrl, Field +from pydantic_schemaorg.BusinessFunction import BusinessFunction +from typing import List, Optional, Union from pydantic_schemaorg.Product import Product +from pydantic_schemaorg.Service import Service from decimal import Decimal from pydantic_schemaorg.StructuredValue import StructuredValue @@ -14,12 +15,12 @@ class TypeAndQuantityNode(StructuredValue): """ type_: str = Field("TypeAndQuantityNode", const=True, alias='@type') - businessFunction: Any = Field( + businessFunction: Optional[Union[List[Union[BusinessFunction, str]], Union[BusinessFunction, str]]] = Field( None, description="The business function (e.g. sell, lease, repair, dispose) of the offer or component" "of a bundle (TypeAndQuantityNode). The default is http://purl.org/goodrelations/v1#Sell.", ) - typeOfGood: Optional[Union[List[Union[Service, Product]], Union[Service, Product]]] = Field( + typeOfGood: Optional[Union[List[Union[Product, Service, str]], Union[Product, Service, str]]] = Field( None, description="The product that this structured value is referring to.", ) @@ -33,7 +34,7 @@ class TypeAndQuantityNode(StructuredValue): description="The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL." "Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.", ) - amountOfThisGood: Optional[Union[List[Decimal], Decimal]] = Field( + amountOfThisGood: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The quantity of the goods included in the offer.", ) diff --git a/pydantic_schemaorg/UnitPriceSpecification.py b/pydantic_schemaorg/UnitPriceSpecification.py index 8d232ed8..31e7f26d 100644 --- a/pydantic_schemaorg/UnitPriceSpecification.py +++ b/pydantic_schemaorg/UnitPriceSpecification.py @@ -1,7 +1,8 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from decimal import Decimal -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.PriceTypeEnumeration import PriceTypeEnumeration +from pydantic_schemaorg.Duration import Duration from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.PriceComponentTypeEnumeration import PriceComponentTypeEnumeration from pydantic_schemaorg.PriceSpecification import PriceSpecification @@ -14,13 +15,13 @@ class UnitPriceSpecification(PriceSpecification): """ type_: str = Field("UnitPriceSpecification", const=True, alias='@type') - billingStart: Optional[Union[List[Decimal], Decimal]] = Field( + billingStart: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="Specifies after how much time this price (or price component) becomes valid and billing" "starts. Can be used, for example, to model a price increase after the first year of a subscription." "The unit of measurement is specified by the unitCode property.", ) - billingIncrement: Optional[Union[List[Decimal], Decimal]] = Field( + billingIncrement: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="This property specifies the minimal quantity and rounding increment that will be the" "basis for the billing. The unit of measurement is specified by the unitCode property.", @@ -39,14 +40,14 @@ class UnitPriceSpecification(PriceSpecification): "PriceTypeEnumeration or as a free form text string for price types that are not already" "predefined in PriceTypeEnumeration.", ) - billingDuration: Union[List[Union[Decimal, QuantitativeValue, Any]], Union[Decimal, QuantitativeValue, Any]] = Field( + billingDuration: Optional[Union[List[Union[Decimal, Duration, QuantitativeValue, str]], Union[Decimal, Duration, QuantitativeValue, str]]] = Field( None, description="Specifies for how long this price (or price component) will be billed. Can be used, for" "example, to model the contractual duration of a subscription or payment plan. Type can" "be either a Duration or a Number (in which case the unit of measurement, for example month," "is specified by the unitCode property).", ) - referenceQuantity: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + referenceQuantity: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The reference quantity for which a certain price applies, e.g. 1 EUR per 4 kWh of electricity." "This property is a replacement for unitOfMeasurement for the advanced cases where the" @@ -57,7 +58,7 @@ class UnitPriceSpecification(PriceSpecification): description="The unit of measurement given using the UN/CEFACT Common Code (3 characters) or a URL." "Other codes than the UN/CEFACT Common Code may be used with a prefix followed by a colon.", ) - priceComponentType: Optional[Union[List[PriceComponentTypeEnumeration], PriceComponentTypeEnumeration]] = Field( + priceComponentType: Optional[Union[List[Union[PriceComponentTypeEnumeration, str]], Union[PriceComponentTypeEnumeration, str]]] = Field( None, description="Identifies a price component (for example, a line item on an invoice), part of the total" "price for an offer.", diff --git a/pydantic_schemaorg/UpdateAction.py b/pydantic_schemaorg/UpdateAction.py index d49516b6..fd38c138 100644 --- a/pydantic_schemaorg/UpdateAction.py +++ b/pydantic_schemaorg/UpdateAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Thing import Thing -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Action import Action @@ -11,11 +11,11 @@ class UpdateAction(Action): """ type_: str = Field("UpdateAction", const=True, alias='@type') - collection: Optional[Union[List[Thing], Thing]] = Field( + collection: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A sub property of object. The collection target of the action.", ) - targetCollection: Optional[Union[List[Thing], Thing]] = Field( + targetCollection: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A sub property of object. The collection target of the action.", ) diff --git a/pydantic_schemaorg/UserComments.py b/pydantic_schemaorg/UserComments.py index 2048764b..da371782 100644 --- a/pydantic_schemaorg/UserComments.py +++ b/pydantic_schemaorg/UserComments.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from datetime import datetime, date from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person @@ -16,7 +16,7 @@ class UserComments(UserInteraction): """ type_: str = Field("UserComments", const=True, alias='@type') - discusses: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + discusses: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Specifies the CreativeWork associated with the UserComment.", ) @@ -24,15 +24,15 @@ class UserComments(UserInteraction): None, description="The text of the UserComment.", ) - replyToUrl: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + replyToUrl: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The URL at which a reply may be posted to the specified UserComment.", ) - commentTime: Optional[Union[List[Union[datetime, date]], Union[datetime, date]]] = Field( + commentTime: Optional[Union[List[Union[datetime, date, str]], Union[datetime, date, str]]] = Field( None, description="The time at which the UserComment was made.", ) - creator: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + creator: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="The creator/author of this CreativeWork. This is the same as the Author property for" "CreativeWork.", diff --git a/pydantic_schemaorg/Vehicle.py b/pydantic_schemaorg/Vehicle.py index 992190a4..e0f4d943 100644 --- a/pydantic_schemaorg/Vehicle.py +++ b/pydantic_schemaorg/Vehicle.py @@ -1,10 +1,11 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.QualitativeValue import QualitativeValue -from typing import Any, Optional, Union, List -from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from typing import List, Optional, Union from decimal import Decimal +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.CarUsageType import CarUsageType from datetime import date +from pydantic_schemaorg.DriveWheelConfigurationValue import DriveWheelConfigurationValue from pydantic_schemaorg.SteeringPositionValue import SteeringPositionValue from pydantic_schemaorg.EngineSpecification import EngineSpecification from pydantic_schemaorg.Product import Product @@ -26,7 +27,7 @@ class Vehicle(Product): None, description="A textual description of known damages, both repaired and unrepaired.", ) - numberOfDoors: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfDoors: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of doors. Typical unit code(s): C62", ) @@ -36,11 +37,11 @@ class Vehicle(Product): "driving school, or as a taxi. The legislation in many countries requires this information" "to be revealed when offering a car for sale.", ) - productionDate: Optional[Union[List[date], date]] = Field( + productionDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date of production of the item, e.g. vehicle.", ) - mileageFromOdometer: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + mileageFromOdometer: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The total distance travelled by the particular vehicle since its initial production," "as read from its odometer. Typical unit code(s): KMT for kilometers, SMI for statute" @@ -51,11 +52,11 @@ class Vehicle(Product): description="The Vehicle Identification Number (VIN) is a unique serial number used by the automotive" "industry to identify individual motor vehicles.", ) - numberOfAxles: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfAxles: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of axles. Typical unit code(s): C62", ) - fuelConsumption: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + fuelConsumption: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The amount of fuel consumed for traveling a particular distance or temporal duration" "with the given vehicle (e.g. liters per 100 km). * Note 1: There are unfortunately no standard" @@ -70,19 +71,19 @@ class Vehicle(Product): None, description="The color or color combination of the interior of the vehicle.", ) - seatingCapacity: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + seatingCapacity: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of persons that can be seated (e.g. in a vehicle), both in terms of the physical" "space available, and in terms of limitations set by law. Typical unit code(s): C62 for" "persons", ) - cargoVolume: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + cargoVolume: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The available volume for cargo or luggage. For automobiles, this is usually the trunk" "volume. Typical unit code(s): LTR for liters, FTQ for cubic foot/feet Note: You can use" "[[minValue]] and [[maxValue]] to indicate ranges.", ) - fuelEfficiency: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + fuelEfficiency: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The distance traveled per unit of fuel used; most commonly miles per gallon (mpg) or kilometers" "per liter (km/L). * Note 1: There are unfortunately no standard unit codes for miles per" @@ -93,17 +94,17 @@ class Vehicle(Product): "speed (\"at 80 km/h\") or usage pattern (\"city traffic\"). You can use [[valueReference]]" "to link the value for the fuel economy to another value.", ) - driveWheelConfiguration: Union[List[Union[str, Any]], Union[str, Any]] = Field( + driveWheelConfiguration: Optional[Union[List[Union[str, DriveWheelConfigurationValue]], Union[str, DriveWheelConfigurationValue]]] = Field( None, description="The drive wheel configuration, i.e. which roadwheels will receive torque from the vehicle's" "engine via the drivetrain.", ) - wheelbase: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + wheelbase: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The distance between the centers of the front and rear wheels. Typical unit code(s):" "CMT for centimeters, MTR for meters, INH for inches, FOT for foot/feet", ) - fuelCapacity: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + fuelCapacity: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The capacity of the fuel tank or in the case of electric cars, the battery. If there are" "multiple components for storage, this should indicate the total of all storage of the" @@ -115,7 +116,7 @@ class Vehicle(Product): description="A short text indicating the configuration of the vehicle, e.g. '5dr hatchback ST 2.5" "MT 225 hp' or 'limited edition'.", ) - payload: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + payload: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted weight of passengers and cargo, EXCLUDING the weight of the empty vehicle." "Typical unit code(s): KGM for kilogram, LBR for pound * Note 1: Many databases specify" @@ -136,7 +137,7 @@ class Vehicle(Product): "wood, etc.). While most interior types are characterized by the material used, an interior" "type can also be based on vehicle usage or target audience.", ) - speed: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + speed: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The speed range of the vehicle. If the vehicle is powered by an engine, the upper limit" "of the speed range (indicated by [[maxValue]] should be the maximum speed achievable" @@ -146,7 +147,7 @@ class Vehicle(Product): "the speed range. You can link to information about how the given value has been determined" "using the [[valueReference]] property.", ) - emissionsCO2: Optional[Union[List[Decimal], Decimal]] = Field( + emissionsCO2: Optional[Union[List[Union[Decimal, str]], Union[Decimal, str]]] = Field( None, description="The CO2 emissions in g/km. When used in combination with a QuantitativeValue, put \"g/km\"" "into the unitText property of that value, since there is no UN/CEFACT Common Code for" @@ -156,7 +157,7 @@ class Vehicle(Product): None, description="Indicates the design and body style of the vehicle (e.g. station wagon, hatchback, etc.).", ) - trailerWeight: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + trailerWeight: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted weight of a trailer attached to the vehicle. Typical unit code(s): KGM" "for kilogram, LBR for pound * Note 1: You can indicate additional information in the [[name]]" @@ -164,7 +165,7 @@ class Vehicle(Product): "node that provides additional information using [[valueReference]]. * Note 3: Note" "that you can use [[minValue]] and [[maxValue]] to indicate ranges.", ) - numberOfForwardGears: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfForwardGears: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The total number of forward gears available for the transmission system of the vehicle." "Typical unit code(s): C62", @@ -173,25 +174,25 @@ class Vehicle(Product): None, description="The number or type of airbags in the vehicle.", ) - modelDate: Optional[Union[List[date], date]] = Field( + modelDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The release date of a vehicle model (often used to differentiate versions of the same" "make and model).", ) - dateVehicleFirstRegistered: Optional[Union[List[date], date]] = Field( + dateVehicleFirstRegistered: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date of the first registration of the vehicle with the respective public authorities.", ) - steeringPosition: Optional[Union[List[SteeringPositionValue], SteeringPositionValue]] = Field( + steeringPosition: Optional[Union[List[Union[SteeringPositionValue, str]], Union[SteeringPositionValue, str]]] = Field( None, description="The position of the steering wheel or similar device (mostly for cars).", ) - numberOfPreviousOwners: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + numberOfPreviousOwners: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of owners of the vehicle, including the current one. Typical unit code(s):" "C62", ) - accelerationTime: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + accelerationTime: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The time needed to accelerate the vehicle from a given start velocity to a given target" "velocity. Typical unit code(s): SEC for seconds * Note: There are unfortunately no standard" @@ -199,7 +200,7 @@ class Vehicle(Product): "and indicate the velocities in the [[name]] of the [[QuantitativeValue]], or use [[valueReference]]" "with a [[QuantitativeValue]] of 0..60 mph or 0..100 km/h to specify the reference speeds.", ) - weightTotal: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + weightTotal: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted total weight of the loaded vehicle, including passengers and cargo and" "the weight of the empty vehicle. Typical unit code(s): KGM for kilogram, LBR for pound" @@ -213,7 +214,7 @@ class Vehicle(Product): description="The type of component used for transmitting the power from a rotating power source to" "the wheels or other relevant component(s) (\"gearbox\" for cars).", ) - vehicleEngine: Optional[Union[List[EngineSpecification], EngineSpecification]] = Field( + vehicleEngine: Optional[Union[List[Union[EngineSpecification, str]], Union[EngineSpecification, str]]] = Field( None, description="Information about the engine or engines of the vehicle.", ) @@ -222,7 +223,7 @@ class Vehicle(Product): description="A [callsign](https://en.wikipedia.org/wiki/Call_sign), as used in broadcasting" "and radio communications to identify people, radio and TV stations, or vehicles.", ) - tongueWeight: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + tongueWeight: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The permitted vertical load (TWR) of a trailer attached to the vehicle. Also referred" "to as Tongue Load Rating (TLR) or Vertical Load Rating (VLR) Typical unit code(s): KGM" @@ -231,18 +232,18 @@ class Vehicle(Product): "node that provides additional information using [[valueReference]]. * Note 3: Note" "that you can use [[minValue]] and [[maxValue]] to indicate ranges.", ) - vehicleSeatingCapacity: Optional[Union[List[Union[Decimal, QuantitativeValue]], Union[Decimal, QuantitativeValue]]] = Field( + vehicleSeatingCapacity: Optional[Union[List[Union[Decimal, QuantitativeValue, str]], Union[Decimal, QuantitativeValue, str]]] = Field( None, description="The number of passengers that can be seated in the vehicle, both in terms of the physical" "space available, and in terms of limitations set by law. Typical unit code(s): C62 for" "persons.", ) - vehicleModelDate: Optional[Union[List[date], date]] = Field( + vehicleModelDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The release date of a vehicle model (often used to differentiate versions of the same" "make and model).", ) - purchaseDate: Optional[Union[List[date], date]] = Field( + purchaseDate: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="The date the item e.g. vehicle was purchased by the current owner.", ) diff --git a/pydantic_schemaorg/Vein.py b/pydantic_schemaorg/Vein.py index 62d9de24..2d4d5a3a 100644 --- a/pydantic_schemaorg/Vein.py +++ b/pydantic_schemaorg/Vein.py @@ -1,7 +1,8 @@ from pydantic import Field from pydantic_schemaorg.AnatomicalStructure import AnatomicalStructure -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Vessel import Vessel +from pydantic_schemaorg.AnatomicalSystem import AnatomicalSystem class Vein(Vessel): @@ -11,16 +12,16 @@ class Vein(Vessel): """ type_: str = Field("Vein", const=True, alias='@type') - tributary: Optional[Union[List[AnatomicalStructure], AnatomicalStructure]] = Field( + tributary: Optional[Union[List[Union[AnatomicalStructure, str]], Union[AnatomicalStructure, str]]] = Field( None, description="The anatomical or organ system that the vein flows into; a larger structure that the vein" "connects to.", ) - drainsTo: Any = Field( + drainsTo: Optional[Union[List[Union[Vessel, str]], Union[Vessel, str]]] = Field( None, description="The vasculature that the vein drains into.", ) - regionDrained: Union[List[Union[AnatomicalStructure, Any]], Union[AnatomicalStructure, Any]] = Field( + regionDrained: Optional[Union[List[Union[AnatomicalStructure, AnatomicalSystem, str]], Union[AnatomicalStructure, AnatomicalSystem, str]]] = Field( None, description="The anatomical or organ system drained by this vessel; generally refers to a specific" "part of an organ.", diff --git a/pydantic_schemaorg/VideoGame.py b/pydantic_schemaorg/VideoGame.py index 3dafd1e5..5caac306 100644 --- a/pydantic_schemaorg/VideoGame.py +++ b/pydantic_schemaorg/VideoGame.py @@ -1,9 +1,12 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.VideoObject import VideoObject from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.GamePlayMode import GamePlayMode from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.GameServer import GameServer +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.SoftwareApplication import SoftwareApplication from pydantic_schemaorg.Game import Game @@ -16,16 +19,16 @@ class VideoGame(SoftwareApplication, Game): """ type_: str = Field("VideoGame", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", @@ -35,34 +38,34 @@ class VideoGame(SoftwareApplication, Game): description="The electronic systems used to play video" "games.", ) - playMode: Optional[Union[List[GamePlayMode], GamePlayMode]] = Field( + playMode: Optional[Union[List[Union[GamePlayMode, str]], Union[GamePlayMode, str]]] = Field( None, description="Indicates whether this game is multi-player, co-op or single-player. The game can be" "marked as multi-player, co-op and single-player at the same time.", ) - cheatCode: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + cheatCode: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Cheat codes to the game.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - gameTip: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + gameTip: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Links to tips, tactics, etc.", ) - gameServer: Any = Field( + gameServer: Optional[Union[List[Union[GameServer, str]], Union[GameServer, str]]] = Field( None, description="The server on which it is possible to play the game.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/VideoGameSeries.py b/pydantic_schemaorg/VideoGameSeries.py index 7e790af0..12b9bba2 100644 --- a/pydantic_schemaorg/VideoGameSeries.py +++ b/pydantic_schemaorg/VideoGameSeries.py @@ -1,11 +1,17 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union +from pydantic_schemaorg.CreativeWorkSeason import CreativeWorkSeason +from pydantic_schemaorg.PostalAddress import PostalAddress from pydantic_schemaorg.Place import Place +from pydantic_schemaorg.VideoObject import VideoObject +from pydantic_schemaorg.Episode import Episode from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Thing import Thing from pydantic_schemaorg.GamePlayMode import GamePlayMode from pydantic_schemaorg.CreativeWork import CreativeWork +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue +from pydantic_schemaorg.MusicGroup import MusicGroup from pydantic_schemaorg.CreativeWorkSeries import CreativeWorkSeries @@ -16,41 +22,41 @@ class VideoGameSeries(CreativeWorkSeries): """ type_: str = Field("VideoGameSeries", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - containsSeason: Any = Field( + containsSeason: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season that is part of the media series.", ) - numberOfSeasons: Optional[Union[List[int], int]] = Field( + numberOfSeasons: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of seasons in this series.", ) - gameLocation: Union[List[Union[AnyUrl, Place, Any]], Union[AnyUrl, Place, Any]] = Field( + gameLocation: Optional[Union[List[Union[AnyUrl, PostalAddress, Place, str]], Union[AnyUrl, PostalAddress, Place, str]]] = Field( None, description="Real or fictional location of the game (or part of game).", ) - trailer: Any = Field( + trailer: Optional[Union[List[Union[VideoObject, str]], Union[VideoObject, str]]] = Field( None, description="The trailer of a movie or tv/radio series, season, episode, etc.", ) - episodes: Any = Field( + episodes: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a TV/radio series or season.", ) - numberOfEpisodes: Optional[Union[List[int], int]] = Field( + numberOfEpisodes: Optional[Union[List[Union[int, str]], Union[int, str]]] = Field( None, description="The number of episodes in this season or series.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", ) - productionCompany: Optional[Union[List[Organization], Organization]] = Field( + productionCompany: Optional[Union[List[Union[Organization, str]], Union[Organization, str]]] = Field( None, description="The production company or studio responsible for the item e.g. series, video game, episode" "etc.", @@ -60,57 +66,57 @@ class VideoGameSeries(CreativeWorkSeries): description="The electronic systems used to play video" "games.", ) - seasons: Any = Field( + seasons: Optional[Union[List[Union[CreativeWorkSeason, str]], Union[CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - season: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + season: Optional[Union[List[Union[AnyUrl, CreativeWorkSeason, str]], Union[AnyUrl, CreativeWorkSeason, str]]] = Field( None, description="A season in a media series.", ) - playMode: Optional[Union[List[GamePlayMode], GamePlayMode]] = Field( + playMode: Optional[Union[List[Union[GamePlayMode, str]], Union[GamePlayMode, str]]] = Field( None, description="Indicates whether this game is multi-player, co-op or single-player. The game can be" "marked as multi-player, co-op and single-player at the same time.", ) - characterAttribute: Optional[Union[List[Thing], Thing]] = Field( + characterAttribute: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="A piece of data that represents a particular aspect of a fictional character (skill," "power, character points, advantage, disadvantage).", ) - cheatCode: Optional[Union[List[CreativeWork], CreativeWork]] = Field( + cheatCode: Optional[Union[List[Union[CreativeWork, str]], Union[CreativeWork, str]]] = Field( None, description="Cheat codes to the game.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - quest: Optional[Union[List[Thing], Thing]] = Field( + quest: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="The task that a player-controlled character, or group of characters may complete in" "order to gain a reward.", ) - gameItem: Optional[Union[List[Thing], Thing]] = Field( + gameItem: Optional[Union[List[Union[Thing, str]], Union[Thing, str]]] = Field( None, description="An item is an object within the game world that can be collected by a player or, occasionally," "a non-player character.", ) - numberOfPlayers: Any = Field( + numberOfPlayers: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="Indicate how many people can play this game (minimum, maximum, or range).", ) - episode: Any = Field( + episode: Optional[Union[List[Union[Episode, str]], Union[Episode, str]]] = Field( None, description="An episode of a tv, radio or game media within a series or season.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/VideoObject.py b/pydantic_schemaorg/VideoObject.py index f2310b9a..16a0c4a1 100644 --- a/pydantic_schemaorg/VideoObject.py +++ b/pydantic_schemaorg/VideoObject.py @@ -1,8 +1,9 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.ImageObject import ImageObject from pydantic_schemaorg.MediaObject import MediaObject +from pydantic_schemaorg.MusicGroup import MusicGroup class VideoObject(MediaObject): @@ -12,12 +13,12 @@ class VideoObject(MediaObject): """ type_: str = Field("VideoObject", const=True, alias='@type') - actors: Optional[Union[List[Person], Person]] = Field( + actors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc. Actors can be associated with individual" "items or with a series, episode, clip.", ) - thumbnail: Optional[Union[List[ImageObject], ImageObject]] = Field( + thumbnail: Optional[Union[List[Union[ImageObject, str]], Union[ImageObject, str]]] = Field( None, description="Thumbnail image for an image or video.", ) @@ -29,7 +30,7 @@ class VideoObject(MediaObject): None, description="The quality of the video.", ) - director: Optional[Union[List[Person], Person]] = Field( + director: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video gaming etc. content, or of an event. Directors" "can be associated with individual items or with a series, episode, clip.", @@ -38,12 +39,12 @@ class VideoObject(MediaObject): None, description="The frame size of the video.", ) - actor: Optional[Union[List[Person], Person]] = Field( + actor: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="An actor, e.g. in tv, radio, movie, video games etc., or in an event. Actors can be associated" "with individual items or with a series, episode, clip.", ) - directors: Optional[Union[List[Person], Person]] = Field( + directors: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A director of e.g. tv, radio, movie, video games etc. content. Directors can be associated" "with individual items or with a series, episode, clip.", @@ -57,7 +58,7 @@ class VideoObject(MediaObject): description="The caption for this object. For downloadable machine formats (closed caption, subtitles" "etc.) use MediaObject and indicate the [[encodingFormat]].", ) - musicBy: Union[List[Union[Person, Any]], Union[Person, Any]] = Field( + musicBy: Optional[Union[List[Union[MusicGroup, Person, str]], Union[MusicGroup, Person, str]]] = Field( None, description="The composer of the soundtrack.", ) diff --git a/pydantic_schemaorg/VisualArtwork.py b/pydantic_schemaorg/VisualArtwork.py index b77ce343..81ae7fdf 100644 --- a/pydantic_schemaorg/VisualArtwork.py +++ b/pydantic_schemaorg/VisualArtwork.py @@ -1,5 +1,7 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.Distance import Distance +from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.Person import Person from pydantic_schemaorg.CreativeWork import CreativeWork @@ -15,7 +17,7 @@ class VisualArtwork(CreativeWork): None, description="The supporting materials for the artwork, e.g. Canvas, Paper, Wood, Board, etc.", ) - depth: Any = Field( + depth: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The depth of the item.", ) @@ -25,11 +27,11 @@ class VisualArtwork(CreativeWork): "a limited edition of 20 prints, 'artEdition' refers to the total number of copies (in" "this example \"20\").", ) - colorist: Optional[Union[List[Person], Person]] = Field( + colorist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds color to inked drawings.", ) - height: Any = Field( + height: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The height of the item.", ) @@ -38,16 +40,16 @@ class VisualArtwork(CreativeWork): description="The material used. (e.g. Oil, Watercolour, Acrylic, Linoprint, Marble, Cyanotype," "Digital, Lithograph, DryPoint, Intaglio, Pastel, Woodcut, Pencil, Mixed Media, etc.)", ) - artist: Optional[Union[List[Person], Person]] = Field( + artist: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The primary artist for a work in a medium other than pencils or digital line art--for example," "if the primary artwork is done in watercolors or digital paints.", ) - width: Any = Field( + width: Optional[Union[List[Union[Distance, QuantitativeValue, str]], Union[Distance, QuantitativeValue, str]]] = Field( None, description="The width of the item.", ) - letterer: Optional[Union[List[Person], Person]] = Field( + letterer: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who adds lettering, including speech balloons and sound effects, to" "artwork.", @@ -60,11 +62,11 @@ class VisualArtwork(CreativeWork): None, description="A material used as a surface in some artwork, e.g. Canvas, Paper, Wood, Board, etc.", ) - penciler: Optional[Union[List[Person], Person]] = Field( + penciler: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who draws the primary narrative artwork.", ) - inker: Optional[Union[List[Person], Person]] = Field( + inker: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="The individual who traces over the pencil drawings in ink after pencils are complete.", ) diff --git a/pydantic_schemaorg/VoteAction.py b/pydantic_schemaorg/VoteAction.py index 51fdeedd..80e0ef97 100644 --- a/pydantic_schemaorg/VoteAction.py +++ b/pydantic_schemaorg/VoteAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.ChooseAction import ChooseAction @@ -11,7 +11,7 @@ class VoteAction(ChooseAction): """ type_: str = Field("VoteAction", const=True, alias='@type') - candidate: Optional[Union[List[Person], Person]] = Field( + candidate: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A sub property of object. The candidate subject of this action.", ) diff --git a/pydantic_schemaorg/WarrantyPromise.py b/pydantic_schemaorg/WarrantyPromise.py index a92ac632..fe4b3f3d 100644 --- a/pydantic_schemaorg/WarrantyPromise.py +++ b/pydantic_schemaorg/WarrantyPromise.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.WarrantyScope import WarrantyScope -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.QuantitativeValue import QuantitativeValue from pydantic_schemaorg.StructuredValue import StructuredValue @@ -13,11 +13,11 @@ class WarrantyPromise(StructuredValue): """ type_: str = Field("WarrantyPromise", const=True, alias='@type') - warrantyScope: Optional[Union[List[WarrantyScope], WarrantyScope]] = Field( + warrantyScope: Optional[Union[List[Union[WarrantyScope, str]], Union[WarrantyScope, str]]] = Field( None, description="The scope of the warranty promise.", ) - durationOfWarranty: Optional[Union[List[QuantitativeValue], QuantitativeValue]] = Field( + durationOfWarranty: Optional[Union[List[Union[QuantitativeValue, str]], Union[QuantitativeValue, str]]] = Field( None, description="The duration of the warranty promise. Common unitCode values are ANN for year, MON for" "months, or DAY for days.", diff --git a/pydantic_schemaorg/WebAPI.py b/pydantic_schemaorg/WebAPI.py index 525fad6a..a9d349a4 100644 --- a/pydantic_schemaorg/WebAPI.py +++ b/pydantic_schemaorg/WebAPI.py @@ -1,6 +1,6 @@ -from pydantic import Field, AnyUrl +from pydantic import AnyUrl, Field from pydantic_schemaorg.CreativeWork import CreativeWork -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.Service import Service @@ -11,7 +11,7 @@ class WebAPI(Service): """ type_: str = Field("WebAPI", const=True, alias='@type') - documentation: Optional[Union[List[Union[AnyUrl, CreativeWork]], Union[AnyUrl, CreativeWork]]] = Field( + documentation: Optional[Union[List[Union[AnyUrl, CreativeWork, str]], Union[AnyUrl, CreativeWork, str]]] = Field( None, description="Further documentation describing the Web API in more detail.", ) diff --git a/pydantic_schemaorg/WebApplication.py b/pydantic_schemaorg/WebApplication.py index 91a996a3..21cecd51 100644 --- a/pydantic_schemaorg/WebApplication.py +++ b/pydantic_schemaorg/WebApplication.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.SoftwareApplication import SoftwareApplication diff --git a/pydantic_schemaorg/WebPage.py b/pydantic_schemaorg/WebPage.py index 755b3413..bf5c3aa9 100644 --- a/pydantic_schemaorg/WebPage.py +++ b/pydantic_schemaorg/WebPage.py @@ -1,8 +1,12 @@ -from pydantic import Field, AnyUrl -from typing import Any, Optional, Union, List +from pydantic import AnyUrl, Field +from typing import List, Optional, Union +from pydantic_schemaorg.SpeakableSpecification import SpeakableSpecification from pydantic_schemaorg.Organization import Organization from pydantic_schemaorg.Person import Person +from pydantic_schemaorg.BreadcrumbList import BreadcrumbList +from pydantic_schemaorg.ImageObject import ImageObject from datetime import date +from pydantic_schemaorg.WebPageElement import WebPageElement from pydantic_schemaorg.Specialty import Specialty from pydantic_schemaorg.CreativeWork import CreativeWork @@ -17,12 +21,12 @@ class WebPage(CreativeWork): """ type_: str = Field("WebPage", const=True, alias='@type') - significantLink: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + significantLink: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="One of the more significant URLs on the page. Typically, these are the non-navigation" "links that are clicked on the most.", ) - speakable: Union[List[Union[AnyUrl, Any]], Union[AnyUrl, Any]] = Field( + speakable: Optional[Union[List[Union[AnyUrl, SpeakableSpecification, str]], Union[AnyUrl, SpeakableSpecification, str]]] = Field( None, description="Indicates sections of a Web page that are particularly 'speakable' in the sense of being" "highlighted as being especially appropriate for text-to-speech conversion. Other" @@ -39,37 +43,37 @@ class WebPage(CreativeWork): "to pick out document section(s) as speakable. For this we define a supporting type, [[SpeakableSpecification]]" "which is defined to be a possible value of the *speakable* property.", ) - significantLinks: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + significantLinks: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="The most significant URLs on the page. Typically, these are the non-navigation links" "that are clicked on the most.", ) - relatedLink: Optional[Union[List[AnyUrl], AnyUrl]] = Field( + relatedLink: Optional[Union[List[Union[AnyUrl, str]], Union[AnyUrl, str]]] = Field( None, description="A link related to this web page, for example to other related web pages.", ) - reviewedBy: Optional[Union[List[Union[Organization, Person]], Union[Organization, Person]]] = Field( + reviewedBy: Optional[Union[List[Union[Organization, Person, str]], Union[Organization, Person, str]]] = Field( None, description="People or organizations that have reviewed the content on this web page for accuracy" "and/or completeness.", ) - breadcrumb: Union[List[Union[str, Any]], Union[str, Any]] = Field( + breadcrumb: Optional[Union[List[Union[str, BreadcrumbList]], Union[str, BreadcrumbList]]] = Field( None, description="A set of links that can help a user understand and navigate a website hierarchy.", ) - primaryImageOfPage: Any = Field( + primaryImageOfPage: Optional[Union[List[Union[ImageObject, str]], Union[ImageObject, str]]] = Field( None, description="Indicates the main image on the page.", ) - lastReviewed: Optional[Union[List[date], date]] = Field( + lastReviewed: Optional[Union[List[Union[date, str]], Union[date, str]]] = Field( None, description="Date on which the content on this web page was last reviewed for accuracy and/or completeness.", ) - mainContentOfPage: Any = Field( + mainContentOfPage: Optional[Union[List[Union[WebPageElement, str]], Union[WebPageElement, str]]] = Field( None, description="Indicates if this web page element is the main subject of the page.", ) - specialty: Optional[Union[List[Specialty], Specialty]] = Field( + specialty: Optional[Union[List[Union[Specialty, str]], Union[Specialty, str]]] = Field( None, description="One of the domain specialities to which this web page's content applies.", ) diff --git a/pydantic_schemaorg/WebPageElement.py b/pydantic_schemaorg/WebPageElement.py index 4db04785..ab6d159e 100644 --- a/pydantic_schemaorg/WebPageElement.py +++ b/pydantic_schemaorg/WebPageElement.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/WebSite.py b/pydantic_schemaorg/WebSite.py index 42770323..6b47ce1e 100644 --- a/pydantic_schemaorg/WebSite.py +++ b/pydantic_schemaorg/WebSite.py @@ -1,5 +1,5 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from typing import List, Optional, Any, Union from pydantic_schemaorg.CreativeWork import CreativeWork diff --git a/pydantic_schemaorg/WinAction.py b/pydantic_schemaorg/WinAction.py index 48782f70..7f8e9329 100644 --- a/pydantic_schemaorg/WinAction.py +++ b/pydantic_schemaorg/WinAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Person import Person -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.AchieveAction import AchieveAction @@ -11,7 +11,7 @@ class WinAction(AchieveAction): """ type_: str = Field("WinAction", const=True, alias='@type') - loser: Optional[Union[List[Person], Person]] = Field( + loser: Optional[Union[List[Union[Person, str]], Union[Person, str]]] = Field( None, description="A sub property of participant. The loser of the action.", ) diff --git a/pydantic_schemaorg/WorkBasedProgram.py b/pydantic_schemaorg/WorkBasedProgram.py index 32f7274c..3fb2efa5 100644 --- a/pydantic_schemaorg/WorkBasedProgram.py +++ b/pydantic_schemaorg/WorkBasedProgram.py @@ -1,5 +1,6 @@ from pydantic import Field -from typing import Any, Optional, Union, List +from pydantic_schemaorg.MonetaryAmountDistribution import MonetaryAmountDistribution +from typing import List, Optional, Union from pydantic_schemaorg.CategoryCode import CategoryCode from pydantic_schemaorg.EducationalOccupationalProgram import EducationalOccupationalProgram @@ -14,7 +15,7 @@ class WorkBasedProgram(EducationalOccupationalProgram): """ type_: str = Field("WorkBasedProgram", const=True, alias='@type') - trainingSalary: Any = Field( + trainingSalary: Optional[Union[List[Union[MonetaryAmountDistribution, str]], Union[MonetaryAmountDistribution, str]]] = Field( None, description="The estimated salary earned while in the program.", ) diff --git a/pydantic_schemaorg/WriteAction.py b/pydantic_schemaorg/WriteAction.py index 32509f51..978d1579 100644 --- a/pydantic_schemaorg/WriteAction.py +++ b/pydantic_schemaorg/WriteAction.py @@ -1,6 +1,6 @@ from pydantic import Field from pydantic_schemaorg.Language import Language -from typing import Any, Optional, Union, List +from typing import List, Optional, Union from pydantic_schemaorg.CreateAction import CreateAction @@ -11,7 +11,7 @@ class WriteAction(CreateAction): """ type_: str = Field("WriteAction", const=True, alias='@type') - language: Optional[Union[List[Language], Language]] = Field( + language: Optional[Union[List[Union[Language, str]], Union[Language, str]]] = Field( None, description="A sub property of instrument. The language used on this action.", ) diff --git a/src/schema_org.py b/src/schema_org.py index 21e8b754..90a4991e 100644 --- a/src/schema_org.py +++ b/src/schema_org.py @@ -52,6 +52,7 @@ def _fields_for_model(self, name: str) -> List[Tuple[str, Dict]]: field.get("@type") == "rdf:Property" and f"schema:{name}" in self._to_set(field.get("schema:domainIncludes")))] + # TODO: refactor this ugly code def extract_fields(self, name: str): fields: List[PydanticField] = [] imports = self._get_default_imports() @@ -64,16 +65,17 @@ def extract_fields(self, name: str): reverse=True): if field_type in data_type_map: pydantic_types += (data_type_map[field_type][0],) + if data_type_map[field_type][1]: + if data_type_map[field_type][1] not in imports.keys(): + imports[data_type_map[field_type][1]] = set() + imports[data_type_map[field_type][1]].add(data_type_map[field_type][2]) else: - # this must be a generated class - imports.update({f'{PACKAGE_NAME}.{field_type}': {field_type}}) - pydantic_types += (field_type,) - - for field_type in field_types: - if field_type in data_type_map.keys() and data_type_map[field_type][1]: - if data_type_map[field_type][1] and data_type_map[field_type][1] not in imports.keys(): - imports[data_type_map[field_type][1]] = set() - imports[data_type_map[field_type][1]].add(data_type_map[field_type][2]) + if name != field_type: + imports.update({f'{PACKAGE_NAME}.{field_type}': {field_type}}) + pydantic_types += (field_type,) + else: #if type is self-reference + pydantic_types += (f'\'{field_type}\'', ) + if field_parent_types != field_types: pydantic_types = pydantic_types + ("Any",)