Skip to content

Commit

Permalink
Merge a256281 into 6970473
Browse files Browse the repository at this point in the history
  • Loading branch information
ron-phq committed Feb 14, 2021
2 parents 6970473 + a256281 commit 9b89de2
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 43 deletions.
88 changes: 46 additions & 42 deletions predicthq/endpoints/v1/events/schemas.py
Expand Up @@ -13,37 +13,39 @@ class SearchParams(PaginatedMixin, SortableMixin, Model):
class Options:
serialize_when_none = False

active = ModelType(DateTimeRange)
cancelled = ModelType(DateTimeRange)
category = ListType(StringType)
country = ListType(StringType)
deleted_reason = StringType(choices=('cancelled', 'duplicate', 'invalid', 'postponed'))
end = ModelType(DateTimeRange)
end_around = ModelType(DateAround)
id = ListType(StringType)
q = StringType()
label = ListType(StringType)
category = ListType(StringType)
location_around = ModelType(LocationAround)
place = ModelType(Place)
postponed = ModelType(DateTimeRange)
q = StringType()
relevance = ListType(StringType)
start = ModelType(DateTimeRange)
start_around = ModelType(DateAround)
end = ModelType(DateTimeRange)
end_around = ModelType(DateAround)
active = ModelType(DateTimeRange)
updated = ModelType(DateTimeRange)
state = ListType(StringType(choices=('active', 'deleted'), default='active'))
deleted_reason = StringType(choices=('cancelled', 'duplicate', 'invalid', 'postponed'))
rank = ModelType(IntRange)
rank_level = ListType(IntType(min_value=1, max_value=5))
updated = ModelType(DateTimeRange)
within = StringListType(StringModelType(Area), separator="+")

# `local_rank`, `aviation_rank`, and `phq_attendance` are paid features.
# If you haven't subscribed to a paid feature, using it as a
# search param will have no effect on your search results.
local_rank = ModelType(IntRange)
local_rank_level = ListType(IntType(min_value=1, max_value=5))
# The below parameters are only available if they are enabled in your plan.
# If you are not subscribed to a feature, using the parameter will have no
# effect on your search results.
aviation_rank = ModelType(IntRange)
aviation_rank_level = ListType(IntType(min_value=1, max_value=5))
phq_attendance = ModelType(IntRange)

country = ListType(StringType)
location_around = ModelType(LocationAround)
within = StringListType(StringModelType(Area), separator="+")
place = ModelType(Place)
relevance = ListType(StringType)
brand_unsafe = ModelType(BrandUnsafe)
entity = ModelType(Entity)
local_rank = ModelType(IntRange)
local_rank_level = ListType(IntType(min_value=1, max_value=5))
phq_attendance = ModelType(IntRange)
predicted_end = ModelType(DateTimeRange)
rank = ModelType(IntRange)
rank_level = ListType(IntType(min_value=1, max_value=5))


class Entities(Model):
Expand All @@ -62,35 +64,37 @@ class Event(Model):
class Options:
serialize_when_none = True

id = StringType()
title = StringType()
cancelled = DateTimeType()
category = StringType()
country = StringType()
deleted_reason = StringType()
description = StringType()
start = DateTimeType()
end = DateTimeType()
timezone = StringType()
duplicate_of_id = StringType()
duration = IntType()
category = StringType()
end = DateTimeType()
first_seen = DateTimeType()
id = StringType()
labels = ListType(StringType())
country = StringType()
rank = IntType()

# `local_rank`, `aviation_rank`, and `phq_attendance` are paid features.
# They will only show up in your response body if you
# have subscribed to them.
local_rank = IntType()
aviation_rank = IntType()
phq_attendance = IntType()

entities = ListType(ModelType(Entities))
location = GeoJSONPointType()
place_hierarchies = ListType(ListType(StringType()))
scope = StringType()
postponed = DateTimeType()
relevance = FloatType()
scope = StringType()
start = DateTimeType()
state = StringType()
first_seen = DateTimeType()
timezone = StringType()
title = StringType()
updated = DateTimeType()
deleted_reason = StringType()
duplicate_of_id = StringType()

# The below fields are only available if they are enabled in your plan.
aviation_rank = IntType() # Aviation Rank add-on
brand_safe = BooleanType()
entities = ListType(ModelType(Entities)) # Venues and addresses add-on
local_rank = IntType() # Local Rank add-on
phq_attendance = IntType() # PHQ Attendance add-on
predicted_end = DateTimeType()
private = BooleanType() # Loop add-on
rank = IntType() # PHQ Rank add-on


class EventResultSet(ResultSet):
Expand Down
2 changes: 1 addition & 1 deletion predicthq/version.py
@@ -1 +1 @@
__version__ = '1.5.2'
__version__ = '1.6.0'

0 comments on commit 9b89de2

Please sign in to comment.