Skip to content

Commit

Permalink
https://github.com/lexiq-legal/pydantic_schemaorg/issues/1
Browse files Browse the repository at this point in the history
  • Loading branch information
crbaker89 committed Jan 7, 2022
1 parent 68c1cfb commit a184c4e
Show file tree
Hide file tree
Showing 379 changed files with 2,544 additions and 2,099 deletions.
4 changes: 2 additions & 2 deletions pydantic_schemaorg/3DModel.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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.",
Expand Down
2 changes: 1 addition & 1 deletion pydantic_schemaorg/APIReference.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
31 changes: 17 additions & 14 deletions pydantic_schemaorg/Accommodation.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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):"
Expand All @@ -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.",
Expand All @@ -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).",
Expand Down
30 changes: 18 additions & 12 deletions pydantic_schemaorg/Action.py
Original file line number Diff line number Diff line change
@@ -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):
Expand All @@ -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"
Expand All @@ -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"
Expand Down
23 changes: 13 additions & 10 deletions pydantic_schemaorg/ActionAccessSpecification.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions pydantic_schemaorg/AggregateOffer.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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]]"
Expand All @@ -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.",
)
Expand Down
8 changes: 4 additions & 4 deletions pydantic_schemaorg/AggregateRating.py
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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.",
)
Expand Down
5 changes: 3 additions & 2 deletions pydantic_schemaorg/Airline.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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).",
)
Expand Down
2 changes: 1 addition & 1 deletion pydantic_schemaorg/Airport.py
Original file line number Diff line number Diff line change
@@ -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


Expand Down
6 changes: 3 additions & 3 deletions pydantic_schemaorg/AlignmentObject.py
Original file line number Diff line number Diff line change
@@ -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


Expand All @@ -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.",
)
Expand Down
Loading

0 comments on commit a184c4e

Please sign in to comment.