Skip to content

Commit 112f088

Browse files
authored
docstring (Azure#22995)
1 parent 458b404 commit 112f088

File tree

2 files changed

+15
-0
lines changed
  • sdk
    • eventhub/azure-eventhub/azure/eventhub
    • schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder

2 files changed

+15
-0
lines changed

sdk/eventhub/azure-eventhub/azure/eventhub/_common.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,13 @@ def __message_data__(self) -> Dict:
192192

193193
@classmethod
194194
def from_message_data(cls, data: bytes, content_type: str) -> "EventData":
195+
"""
196+
Creates an EventData object given content type and a data value to be set as body.
197+
198+
:param bytes data: The data value to be set as the body of the message.
199+
:param str content_type: The content type to be set on the message.
200+
:rtype: ~azure.eventhub.EventData
201+
"""
195202
event_data = cls(data)
196203
event_data.content_type = content_type
197204
return event_data

sdk/schemaregistry/azure-schemaregistry-avroencoder/azure/schemaregistry/encoder/avroencoder/_message_protocol.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ class MessageType(Protocol):
2525

2626
@classmethod
2727
def from_message_data(cls, data: bytes, content_type: str, **kwargs: Any) -> "MessageType":
28+
"""
29+
Creates an object that is a subtype of MessageType given content type and
30+
a data value to be set as body.
31+
32+
:param bytes data: The data value to be set as the body of the message.
33+
:param str content_type: The content type to be set on the message.
34+
:rtype: ~azure.schemaregistry.encoder.avroencoder.MessageType
35+
"""
2836
...
2937

3038
def __message_data__(self) -> MessageMetadataDict:

0 commit comments

Comments
 (0)