Event
A comprehensive system for representing various types of events including single dates, date ranges, and custom events.
EventType
Section titled “EventType”Defines the different types of events that can be represented
Options
Section titled “Options”Value | Description |
---|---|
singleDate | A single date (and possible time) |
dateRange | A period of time with a start and end date |
other | Other event type (e.g., a recurring event) |
Formats
Section titled “Formats”A JSON example of this model.
singleDate
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: EventType.yamltype: stringenum: - singleDate - dateRange - otherdescription: |- Type of event (e.g., a single date, a date range, or a custom event)
- singleDate: A single date (and possible time) - dateRange: A period of time with a start and end date - other: Other event type (e.g., a recurring event)
The TypeSpec code for this model.
/** Type of event (e.g., a single date, a date range, or a custom event) * * - singleDate: A single date (and possible time) * - dateRange: A period of time with a start and end date * - other: Other event type (e.g., a recurring event) */enum EventType { /** A single date with no time */ singleDate,
/** A range of dates with no time */ dateRange,
/** Other event type */ other,}
The Python code for this model.
class EventType(StrEnum): """Type of event (e.g., a single date, a date range, or a custom event)."""
SINGLE_DATE = "singleDate" DATE_RANGE = "dateRange" OTHER = "other"
The Event
union represents all possible event types.
Sub-types
Section titled “Sub-types”Sub-type | Description |
---|---|
SingleDateEvent | A single date (and possible time) |
DateRangeEvent | A period of time with a start and end date |
OtherEvent | Other event type (e.g., a recurring event) |
Formats
Section titled “Formats”A JSON example of this model.
{ "name": "Application Deadline", "eventType": "singleDate", "date": "2024-04-30", "time": "17:00:00", "description": "Final deadline for all submissions"}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: Event.yamlanyOf: - $ref: SingleDateEvent.yaml description: A single date event - $ref: DateRangeEvent.yaml description: A date range event - $ref: OtherEvent.yaml description: Other event typedescription: Union of all event types
The TypeSpec code for this model.
/** Union of all event types */union Event { /** A single date event */ singleDate: SingleDateEvent,
/** A date range event */ dateRange: DateRangeEvent,
/** Other event type */ other: OtherEvent,}
The Python code for this model.
Event = Union[SingleDateEvent, DateRangeEvent, OtherEvent]
EventBase
Section titled “EventBase”Base model for all events with common properties
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Human-readable name of the event |
eventType | EventType | Yes | Type of event (singleDate, dateRange, or other) |
description | string | No | Description of what this event represents |
Formats
Section titled “Formats”A JSON example of this model.
{ "name": "Application Deadline", "eventType": "singleDate", "description": "Final deadline for all submissions"}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: EventBase.yamltype: objectproperties: name: type: string description: Human-readable name of the event (e.g., 'Application posted', 'Question deadline') eventType: $ref: EventType.yaml description: Type of event description: type: string description: Description of what this event representsrequired: - name - eventTypedescription: Base model for all events
The TypeSpec code for this model.
/** Base model for all events */@discriminator("eventType")model EventBase { /** Human-readable name of the event (e.g., 'Application posted', 'Question deadline') */ name: string;
/** Type of event */ eventType: EventType;
/** Description of what this event represents */ description?: string;}
The Python code for this model.
class EventBase(CommonGrantsBaseModel): """Base model for all events."""
name: str = Field( ..., description="Human-readable name of the event (e.g., 'Application posted', 'Question deadline')", min_length=1, ) event_type: EventType = Field( ..., alias="eventType", description="Type of event", ) description: Optional[str] = Field( default=None, description="Description of what this event represents", )
SingleDateEvent
Section titled “SingleDateEvent”Represents an event that has a specific date (and optional time) associated with it.
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Human-readable name of the event |
eventType | EventType.singleDate | Yes | Must be “singleDate” |
date | isoDate | Yes | Date of the event in ISO 8601 format: YYYY-MM-DD |
time | isoTime | No | Time of the event in ISO 8601 format: HH:MM:SS |
description | string | No | Description of what this event represents |
Formats
Section titled “Formats”A JSON example of this model.
{ "name": "Application Deadline", "eventType": "singleDate", "date": "2024-04-30", "time": "17:00:00", "description": "Final deadline for all submissions"}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: SingleDateEvent.yamltype: objectproperties: eventType: type: string const: singleDate description: Type of event date: $ref: isoDate.yaml description: "Date of the event in in ISO 8601 format: YYYY-MM-DD" time: $ref: isoTime.yaml description: "Time of the event in ISO 8601 format: HH:MM:SS"required: - eventType - dateallOf: - $ref: EventBase.yamlunevaluatedProperties: not: {}examples: - name: Opportunity close date eventType: singleDate date: 2024-12-31 time: 17:00:00 description: Opportunity closes for all applications - name: Application posted date eventType: singleDate date: 2024-01-15 description: Opportunity is posted publiclydescription: Description of an event that has a date (and possible time) associated with it
The TypeSpec code for this model.
/** Description of an event that has a date (and possible time) associated with it */@example(Examples.Event.postedDate, #{ title: "Opportunity posted date" })@example(Examples.Event.closeDate, #{ title: "Opportunity close date" })model SingleDateEvent extends EventBase { /** Type of event */ eventType: EventType.singleDate;
/** Date of the event in in ISO 8601 format: YYYY-MM-DD */ date: isoDate;
/** Time of the event in ISO 8601 format: HH:MM:SS */ time?: isoTime;}
The Python code for this model.
class SingleDateEvent(EventBase): """Description of an event that has a date (and possible time) associated with it."""
event_type: Literal[EventType.SINGLE_DATE] = Field( EventType.SINGLE_DATE, alias="eventType", ) date: ISODate = Field( ..., description="Date of the event in ISO 8601 format: YYYY-MM-DD", ) time: Optional[ISOTime] = Field( default=None, description="Time of the event in ISO 8601 format: HH:MM:SS", )
DateRangeEvent
Section titled “DateRangeEvent”Represents an event that spans a period of time with start and end dates (and optional times).
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Human-readable name of the event |
eventType | EventType.dateRange | Yes | Must be “dateRange” |
startDate | isoDate | Yes | Start date in ISO 8601 format: YYYY-MM-DD |
startTime | isoTime | No | Start time in ISO 8601 format: HH:MM:SS |
endDate | isoDate | Yes | End date in ISO 8601 format: YYYY-MM-DD |
endTime | isoTime | No | End time in ISO 8601 format: HH:MM:SS |
description | string | No | Description of what this event represents |
Formats
Section titled “Formats”A JSON example of this model.
{ "name": "Application Period", "eventType": "dateRange", "startDate": "2024-01-01", "endDate": "2024-01-31", "endTime": "17:00:00", "description": "Primary application period for the grant opportunity"}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: DateRangeEvent.yamltype: objectproperties: eventType: type: string const: dateRange description: Type of event startDate: $ref: isoDate.yaml description: "Start date of the event in ISO 8601 format: YYYY-MM-DD" startTime: $ref: isoTime.yaml description: "Start time of the event in ISO 8601 format: HH:MM:SS" endDate: $ref: isoDate.yaml description: "End date of the event in ISO 8601 format: YYYY-MM-DD" endTime: $ref: isoTime.yaml description: "End time of the event in ISO 8601 format: HH:MM:SS"required: - eventType - startDate - endDateallOf: - $ref: EventBase.yamlunevaluatedProperties: not: {}examples: - name: Application period eventType: dateRange startDate: 2024-01-01 endDate: 2024-01-31 endTime: 17:00:00 description: Primary application period for the grant opportunity - name: Period of Performance eventType: dateRange startDate: 2024-01-01 endDate: 2024-12-31 description: Period of performance for the grantdescription: Description of an event that has a start and end date (and possible time) associated with it
The TypeSpec code for this model.
/** Description of an event that has a start and end date (and possible time) associated with it */@example(Examples.Event.performancePeriod, #{ title: "Period of performance" })@example(Examples.Event.applicationPeriod, #{ title: "Application period" })model DateRangeEvent extends EventBase { /** Type of event */ eventType: EventType.dateRange;
/** Start date of the event in ISO 8601 format: YYYY-MM-DD */ startDate: isoDate;
/** Start time of the event in ISO 8601 format: HH:MM:SS */ startTime?: isoTime;
/** End date of the event in ISO 8601 format: YYYY-MM-DD */ endDate: isoDate;
/** End time of the event in ISO 8601 format: HH:MM:SS */ endTime?: isoTime;}
The Python code for this model.
class DateRangeEvent(EventBase): """Description of an event that has a start and end date (and possible time) associated with it."""
event_type: Literal[EventType.DATE_RANGE] = Field( EventType.DATE_RANGE, alias="eventType", ) start_date: ISODate = Field( ..., alias="startDate", description="Start date of the event in ISO 8601 format: YYYY-MM-DD", ) start_time: Optional[ISOTime] = Field( default=None, alias="startTime", description="Start time of the event in ISO 8601 format: HH:MM:SS", ) end_date: ISODate = Field( ..., alias="endDate", description="End date of the event in ISO 8601 format: YYYY-MM-DD", ) end_time: Optional[ISOTime] = Field( default=None, alias="endTime", description="End time of the event in ISO 8601 format: HH:MM:SS", )
OtherEvent
Section titled “OtherEvent”Represents custom events that don’t fit the single date or date range patterns.
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | Human-readable name of the event |
eventType | EventType.other | Yes | Must be “other” |
details | string | No | Details of the event’s timeline |
description | string | No | Description of what this event represents |
Formats
Section titled “Formats”A JSON example of this model.
{ "name": "Info Sessions", "eventType": "other", "details": "Every other Tuesday at 10:00 AM during the application period", "description": "Info sessions for the opportunity"}
The JSON Schema for this model.
$schema: https://json-schema.org/draft/2020-12/schema$id: OtherEvent.yamltype: objectproperties: eventType: type: string const: other description: Type of event details: type: string description: Details of the event's timeline (e.g. "Every other Tuesday") description: type: string examples: - Applications begin being accepted description: Description of the eventrequired: - eventTypeallOf: - $ref: EventBase.yamlunevaluatedProperties: not: {}examples: - name: Info sessions eventType: other details: Every other Tuesday at 10:00 AM during the application period description: Info sessions for the opportunitydescription: Description of an event that is not a single date or date range
The TypeSpec code for this model.
/** Description of an event that is not a single date or date range */@example(Examples.Event.infoSessions, #{ title: "Info sessions" })model OtherEvent extends EventBase { /** Type of event */ eventType: EventType.other;
/** Details of the event's timeline (e.g. "Every other Tuesday") */ details?: string;
/** Description of the event */ @example("Applications begin being accepted") description?: string;}
The Python code for this model.
class OtherEvent(EventBase): """Description of an event that is not a single date or date range."""
event_type: Literal[EventType.OTHER] = Field( EventType.OTHER, alias="eventType", ) details: Optional[str] = Field( default=None, description="Details of the event's timeline (e.g. 'Every other Tuesday')", )