@@ -136,14 +136,17 @@ class EventGridEvent(InternalEventGridEvent, EventMixin):
136136
137137 All required parameters must be populated in order to send to Azure.
138138
139- :param topic: The resource path of the event source. If not provided, Event Grid will stamp onto the event.
140- :type topic: str
141139 :param subject: Required. A resource path relative to the topic path.
142140 :type subject: str
143- :param data: Event data specific to the event type.
144- :type data: object
145141 :param event_type: Required. The type of the event that occurred.
146142 :type event_type: str
143+ :param data: Required. Event data specific to the event type.
144+ :type data: object
145+ :param data_version: Required. The schema version of the data object.
146+ If not provided, will be stamped with an empty value.
147+ :type data_version: str
148+ :param topic: The resource path of the event source. If not provided, Event Grid will stamp onto the event.
149+ :type topic: str
147150 :ivar metadata_version: The schema version of the event metadata. If provided, must match Event Grid Schema exactly.
148151 If not provided, EventGrid will stamp onto event.
149152 :vartype metadata_version: str
@@ -177,13 +180,14 @@ class EventGridEvent(InternalEventGridEvent, EventMixin):
177180 'data_version' : {'key' : 'dataVersion' , 'type' : 'str' },
178181 }
179182
180- def __init__ (self , subject , event_type , ** kwargs ):
181- # type: (str, str, Any) -> None
183+ def __init__ (self , subject , event_type , data , data_version , ** kwargs ):
184+ # type: (str, str, object, str, Any) -> None
182185 kwargs .setdefault ('id' , uuid .uuid4 ())
183186 kwargs .setdefault ('subject' , subject )
184187 kwargs .setdefault ("event_type" , event_type )
185188 kwargs .setdefault ('event_time' , dt .datetime .now (UTC ()).isoformat ())
186- kwargs .setdefault ('data' , None )
189+ kwargs .setdefault ('data' , data )
190+ kwargs .setdefault ('data_version' , data_version )
187191
188192 super (EventGridEvent , self ).__init__ (** kwargs )
189193
0 commit comments