diff --git a/predicthq/endpoints/schemas.py b/predicthq/endpoints/schemas.py index 4e05a8a..6d27c3c 100644 --- a/predicthq/endpoints/schemas.py +++ b/predicthq/endpoints/schemas.py @@ -211,6 +211,14 @@ class Options: exclude = BooleanType() +class Entity(Model): + + class Options: + serialize_when_none = False + + id = StringType() + + class LimitMixin(Model): limit = IntType(min_value=1) diff --git a/predicthq/endpoints/v1/events/schemas.py b/predicthq/endpoints/v1/events/schemas.py index ad315aa..5cc1ad1 100644 --- a/predicthq/endpoints/v1/events/schemas.py +++ b/predicthq/endpoints/v1/events/schemas.py @@ -5,7 +5,7 @@ PaginatedMixin, SortableMixin, Model, ResultSet, ListType, StringType, GeoJSONPointType, StringListType, StringModelType, Area, ModelType, IntRange, IntType, DateTimeRange, DateTimeType, FloatType, ResultType, DictType, DateType, Place, Signal, DateAround, - LocationAround, BooleanType, BrandUnsafe + LocationAround, BooleanType, BrandUnsafe, Entity ) @@ -36,6 +36,7 @@ class Options: signal = ModelType(Signal) relevance = ListType(StringType) brand_unsafe = ModelType(BrandUnsafe) + entity = ModelType(Entity) class Entities(Model):