@@ -55,31 +55,54 @@ class CloudEvent(EventMixin): #pylint:disable=too-many-instance-attributes
5555 :param source: Required. Identifies the context in which an event happened. The combination of id and source must
5656 be unique for each distinct event. If publishing to a domain topic, source must be the domain name.
5757 :type source: str
58- :param data: Event data specific to the event type.
59- :type data: object
6058 :param type: Required. Type of event related to the originating occurrence.
6159 :type type: str
62- :param time: The time (in UTC) the event was generated, in RFC3339 format.
60+ :param data: Required. Event data specific to the event type.
61+ :type data: object
62+ :keyword time: Optional. The time (in UTC) the event was generated, in RFC3339 format.
6363 :type time: ~datetime.datetime
64- :param dataschema: Identifies the schema that data adheres to.
64+ :keyword dataschema: Optional. Identifies the schema that data adheres to.
6565 :type dataschema: str
66- :param datacontenttype: Content type of data value.
66+ :keyword datacontenttype: Optional. Content type of data value.
6767 :type datacontenttype: str
68- :param subject: This describes the subject of the event in the context of the event producer
68+ :keyword subject: Optional. This describes the subject of the event in the context of the event producer
6969 (identified by source).
7070 :type subject: str
71- :param id: Optional. An identifier for the event. The combination of id and source must be
71+ :keyword specversion: Optional. The version of the CloudEvent spec. Defaults to "1.0"
72+ :type specversion: str
73+ :keyword id: Optional. An identifier for the event. The combination of id and source must be
7274 unique for each distinct event. If not provided, a random UUID will be generated and used.
7375 :type id: Optional[str]
76+ :ivar source: Identifies the context in which an event happened. The combination of id and source must
77+ be unique for each distinct event. If publishing to a domain topic, source must be the domain name.
78+ :vartype source: str
79+ :ivar data: Event data specific to the event type.
80+ :vartype data: object
81+ :ivar type: Type of event related to the originating occurrence.
82+ :vartype type: str
83+ :ivar time: The time (in UTC) the event was generated, in RFC3339 format.
84+ :vartype time: ~datetime.datetime
85+ :ivar dataschema: Identifies the schema that data adheres to.
86+ :vartype dataschema: str
87+ :ivar datacontenttype: Content type of data value.
88+ :vartype datacontenttype: str
89+ :ivar subject: This describes the subject of the event in the context of the event producer
90+ (identified by source).
91+ :vartype subject: str
92+ :ivar specversion: Optional. The version of the CloudEvent spec. Defaults to "1.0"
93+ :vartype specversion: str
94+ :ivar id: An identifier for the event. The combination of id and source must be
95+ unique for each distinct event. If not provided, a random UUID will be generated and used.
96+ :vartype id: Optional[str]
7497 """
75- def __init__ (self , source , type , ** kwargs ): # pylint: disable=redefined-builtin
76- # type: (str, str, Any) -> None
98+ def __init__ (self , source , type , data , ** kwargs ): # pylint: disable=redefined-builtin
99+ # type: (str, str, object, Any) -> None
77100 self .source = source
78101 self .type = type
79102 self .specversion = kwargs .pop ("specversion" , "1.0" )
80103 self .id = kwargs .pop ("id" , str (uuid .uuid4 ()))
81104 self .time = kwargs .pop ("time" , dt .datetime .now (UTC ()).isoformat ())
82- self .data = kwargs . pop ( " data" , None )
105+ self .data = data
83106 self .datacontenttype = kwargs .pop ("datacontenttype" , None )
84107 self .dataschema = kwargs .pop ("dataschema" , None )
85108 self .subject = kwargs .pop ("subject" , None )
@@ -145,18 +168,41 @@ class EventGridEvent(InternalEventGridEvent, EventMixin):
145168 :param data_version: Required. The schema version of the data object.
146169 If not provided, will be stamped with an empty value.
147170 :type data_version: str
148- :param topic: The resource path of the event source. If not provided, Event Grid will stamp onto the event.
171+ :keyword topic: Optional. The resource path of the event source. If not provided, Event Grid will
172+ stamp onto the event.
149173 :type topic: str
150- :ivar metadata_version: The schema version of the event metadata. If provided, must match Event Grid Schema exactly.
151- If not provided, EventGrid will stamp onto event.
152- :vartype metadata_version: str
153- :param data_version: The schema version of the data object. If not provided, will be stamped with an empty value.
174+ :keyword metadata_version: Optional. The schema version of the event metadata. If provided,
175+ must match Event Grid Schema exactly. If not provided, EventGrid will stamp onto event.
176+ :type metadata_version: str
177+ :keyword data_version: Optional. The schema version of the data object. If not provided,
178+ will be stamped with an empty value.
154179 :type data_version: str
155- :param id: Optional. An identifier for the event. In not provided, a random UUID will be generated and used.
180+ :keyword id: Optional. An identifier for the event. In not provided, a random UUID will be generated and used.
156181 :type id: Optional[str]
157- :param event_time: Optional.The time (in UTC) of the event. If not provided,
182+ :keyword event_time: Optional.The time (in UTC) of the event. If not provided,
158183 it will be the time (in UTC) the event was generated.
159184 :type event_time: Optional[~datetime.datetime]
185+ :ivar subject: A resource path relative to the topic path.
186+ :vartype subject: str
187+ :ivar event_type: The type of the event that occurred.
188+ :vartype event_type: str
189+ :ivar data: Event data specific to the event type.
190+ :vartype data: object
191+ :ivar data_version: The schema version of the data object.
192+ If not provided, will be stamped with an empty value.
193+ :vartype data_version: str
194+ :ivar topic: The resource path of the event source. If not provided, Event Grid will stamp onto the event.
195+ :vartype topic: str
196+ :ivar metadata_version: The schema version of the event metadata. If provided, must match Event Grid Schema exactly.
197+ If not provided, EventGrid will stamp onto event.
198+ :vartype metadata_version: str
199+ :ivar data_version: The schema version of the data object. If not provided, will be stamped with an empty value.
200+ :vartype data_version: str
201+ :ivar id: An identifier for the event. In not provided, a random UUID will be generated and used.
202+ :vartype id: Optional[str]
203+ :ivar event_time: The time (in UTC) of the event. If not provided,
204+ it will be the time (in UTC) the event was generated.
205+ :vartype event_time: Optional[~datetime.datetime]
160206 """
161207
162208 _validation = {
0 commit comments