azure.eventgrid.aio package

class azure.eventgrid.aio.EventGridPublisherClient(topic_hostname: str, credential: Union[azure.core.credentials.AzureKeyCredential, azure.eventgrid._shared_access_signature_credential.EventGridSharedAccessSignatureCredential], **kwargs: Any)[source]

Asynchronous EventGrid Python Publisher Client.

Parameters
async send(events: Union[azure.eventgrid._models.CloudEvent, azure.eventgrid._models.EventGridEvent, azure.eventgrid._models.CustomEvent, Dict, List[azure.eventgrid._models.CloudEvent], List[azure.eventgrid._models.EventGridEvent], List[azure.eventgrid._models.CustomEvent], List[Dict]], **kwargs: Any)None[source]

Sends event data to topic hostname specified during client initialization.

Parameters

events (SendType) – A list or an instance of CloudEvent/EventGridEvent/CustomEvent to be sent.

Keyword Arguments

content_type (str) – The type of content to be used to send the events. Has default value “application/json; charset=utf-8” for EventGridEvents, with “cloudevents-batch+json” for CloudEvents

Return type

None

Raises

ValueError, when events do not follow specified SendType.