Skip to content

Commit 2c1fd17

Browse files
authored
[Chat] Updated Swagger Hash and Sample Code (#35194)
1 parent 2beea70 commit 2c1fd17

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

sdk/communication/azure-communication-chat/samples/chat_thread_client_sample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,11 +180,11 @@ def list_messages(self):
180180
for chat_message in chat_message_page:
181181
print("ChatMessage: message=", chat_message.content.message)
182182
for attachment in chat_message.content.attachments:
183-
if attachment.type == "image":
183+
if attachment.attachment_type == "image":
184184
print("image attachment: ", attachment.name, " with ID: ", attachment.id, "received.")
185185
# render `attachment.preview_url` as the thumbnail
186186
# render `attachment.url` as the full image
187-
elif attachment.type == "file":
187+
elif attachment.attachment_type == "file":
188188
print("file attachment: ", attachment.name, " with ID: ", attachment.id, "received.")
189189
# render a button that will navigate user to the URL provided in `attachment.preview_url`
190190

sdk/communication/azure-communication-chat/samples/chat_thread_client_sample_async.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,11 +187,11 @@ async def list_messages_async(self):
187187
async for chat_message in chat_message_page:
188188
print("ChatMessage: message=", chat_message.content.message)
189189
for attachment in chat_message.content.attachments:
190-
if attachment.type == "image":
190+
if attachment.attachment_type == "image":
191191
print("image attachment: ", attachment.name, " with ID: ", attachment.id, "received.")
192192
# render `attachment.preview_url` as the thumbnail
193193
# render `attachment.url` as the full image
194-
elif attachment.type == "file":
194+
elif attachment.attachment_type == "file":
195195
print("file attachment: ", attachment.name, " with ID: ", attachment.id, "received.")
196196
# render a button that will navigate user to the URL provided in `attachment.preview_url`
197197
# [END list_messages]

sdk/communication/azure-communication-chat/swagger/SWAGGER.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ autorest SWAGGER.md --version-tolerant=false
1717

1818
```yaml
1919
tag: package-chat-2024-03-07
20-
require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/1720e5aaa4f5ab094789f72589122baa07133439/specification/communication/data-plane/Chat/readme.md
20+
require: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/72d4c8cae964a12dc27ad4684b0bddf493225338/specification/communication/data-plane/Chat/readme.md
2121
output-folder: ../azure/communication/chat/_generated
2222
namespace: azure.communication.chat
2323
no-namespace-folders: true
@@ -40,4 +40,4 @@ directive:
4040
where: '$.definitions.CommunicationError'
4141
transform: >
4242
$["x-ms-client-name"] = "ChatError";
43-
```
43+
```

0 commit comments

Comments
 (0)