Skip to content

Commit

Permalink
[EGv2] doc updates (#30483)
Browse files Browse the repository at this point in the history
* doc updates

* doc update

* doc
  • Loading branch information
l0lawrence committed May 22, 2024
1 parent 626393c commit 0d92b59
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ def publish_cloud_events(
content_type: str = "application/cloudevents-batch+json; charset=utf-8",
**kwargs: Any
) -> None:
"""Publish Batch of Cloud Events to namespace topic.
"""Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Array of Cloud Events being published. Required.
Expand All @@ -62,7 +67,7 @@ def publish_cloud_events(
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

Expand All @@ -75,7 +80,12 @@ def publish_cloud_events(
content_type: str = "application/cloudevents+json; charset=utf-8",
**kwargs: Any
) -> None:
"""Publish Single Cloud Event to namespace topic.
"""Publish Single Cloud Event to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Single Cloud Event being published. Required.
Expand All @@ -86,26 +96,31 @@ def publish_cloud_events(
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

@distributed_trace
def publish_cloud_events(
self, topic_name: str, body: Union[List[CloudEvent], CloudEvent], **kwargs
) -> None:
"""Publish Cloud Events to namespace topic.
"""Publish Batch Cloud Event or Events to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Single Cloud Event or list of Cloud Events being published. Required.
:param body: Cloud Event or array of Cloud Events being published. Required.
:type body: ~azure.core.messaging.CloudEvent or list[~azure.core.messaging.CloudEvent]
:keyword content_type: content type. Default value is "application/cloudevents+json;
charset=utf-8".
:paramtype content_type: str
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ async def publish_cloud_events(
content_type: str = "application/cloudevents-batch+json; charset=utf-8",
**kwargs: Any
) -> None:
"""Publish Batch of Cloud Events to namespace topic.
"""Publish Batch Cloud Event to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Array of Cloud Events being published. Required.
Expand All @@ -34,7 +39,7 @@ async def publish_cloud_events(
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

Expand All @@ -47,7 +52,12 @@ async def publish_cloud_events(
content_type: str = "application/cloudevents+json; charset=utf-8",
**kwargs: Any
) -> None:
"""Publish Single Cloud Event to namespace topic.
"""Publish Single Cloud Event to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Single Cloud Event being published. Required.
Expand All @@ -58,26 +68,31 @@ async def publish_cloud_events(
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""

@distributed_trace_async
async def publish_cloud_events(
self, topic_name: str, body: Union[List[CloudEvent], CloudEvent], **kwargs
) -> None:
"""Publish Cloud Events to namespace topic.
"""Publish Batch Cloud Event or Events to namespace topic. In case of success, the server responds with an
HTTP 200 status code with an empty JSON object in response. Otherwise, the server can return
various error codes. For example, 401: which indicates authorization failure, 403: which
indicates quota exceeded or message is too large, 410: which indicates that specific topic is
not found, 400: for bad request, and 500: for internal server error.
:param topic_name: Topic Name. Required.
:type topic_name: str
:param body: Single Cloud Event or list of Cloud Events being published. Required.
:param body: Cloud Event or Array of Cloud Events being published. Required.
:type body: ~azure.core.messaging.CloudEvent or list[~azure.core.messaging.CloudEvent]
:keyword content_type: content type. Default value is "application/cloudevents+json;
charset=utf-8".
:paramtype content_type: str
:keyword bool stream: Whether to stream the response of this operation. Defaults to False. You
will have to context manage the returned stream.
:return: None
:rtype: None
:rtype: None
:raises ~azure.core.exceptions.HttpResponseError:
"""
if isinstance(body, CloudEvent):
Expand Down

0 comments on commit 0d92b59

Please sign in to comment.