-
Notifications
You must be signed in to change notification settings - Fork 5k
Jimin/2025 ga #50191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jiminwen-msft
wants to merge
9
commits into
main
Choose a base branch
from
jimin/2025GA
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Jimin/2025 ga #50191
Changes from 4 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
25a1094
autorest generated code
jiminwen-msft f3d4295
Apply outer models change
jiminwen-msft a347f96
client changes
jiminwen-msft 37e602a
e2e tests pass
jiminwen-msft 3871fa8
record tests
jiminwen-msft 5ec067e
Update sdk/communication/Azure.Communication.Chat/src/ChatClient.cs
jiminwen-msft 88006c0
Merge branch 'main' of https://github.com/Azure/azure-sdk-for-net int…
jiminwen-msft 79f98e9
regen code
jiminwen-msft ad5b65e
Merge branch 'jimin/2025GA' of https://github.com/Azure/azure-sdk-for…
jiminwen-msft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,7 +65,14 @@ Once you initialized a `ChatClient` class, you can do the following chat operati | |
|
||
### Create a thread | ||
```C# Snippet:Azure_Communication_Chat_Tests_Samples_CreateThread_KeyConcepts | ||
CreateChatThreadResult createChatThreadResult = await chatClient.CreateChatThreadAsync(topic: "Hello world!", participants: new ChatParticipant[] { }); | ||
CreateChatThreadOptions createChatThreadOptions = new CreateChatThreadOptions("Hello world!"); | ||
|
||
createChatThreadOptions.Metadata.Add("MetadataKey1", "MetadataValue1"); | ||
createChatThreadOptions.Metadata.Add("MetadataKey2", "MetadataValue2"); | ||
|
||
createChatThreadOptions.RetentionPolicy = new ThreadCreationDateRetentionPolicy(40); | ||
|
||
CreateChatThreadResult createChatThreadResult = await chatClient.CreateChatThreadAsync(createChatThreadOptions); | ||
ChatThreadProperties chatThread = createChatThreadResult.ChatThread; | ||
``` | ||
### Get a thread | ||
|
@@ -85,9 +92,12 @@ Once you initialized a `ChatThreadClient` class, you can do the following chat o | |
|
||
### Update a thread | ||
```C# Snippet:Azure_Communication_Chat_Tests_Samples_UpdateThread_KeyConcepts | ||
chatThreadClient.UpdateTopic(topic: "Launch meeting"); | ||
UpdateChatThreadPropertiesOptions updateChatThreadPropertiesOptions = new UpdateChatThreadPropertiesOptions(); | ||
updateChatThreadPropertiesOptions.Topic = "Launch meeting"; | ||
updateChatThreadPropertiesOptions.Metadata.Add("UpdateMetadataKey", "UpdateMetadataValue"); | ||
updateChatThreadPropertiesOptions.RetentionPolicy = new NoneRetentionPolicy(); | ||
await chatThreadClient.UpdatePropertiesAsync(updateChatThreadPropertiesOptions); | ||
``` | ||
|
||
### Send a message | ||
```C# Snippet:Azure_Communication_Chat_Tests_Samples_SendMessage_KeyConcepts | ||
SendChatMessageResult sendChatMessageResult = chatThreadClient.SendMessage("Let's meet at 11am"); | ||
|
@@ -179,7 +189,20 @@ var chatParticipant = new ChatParticipant(identifier: kimberly) | |
{ | ||
DisplayName = "Kim" | ||
}; | ||
CreateChatThreadResult createChatThreadResult = await chatClient.CreateChatThreadAsync(topic: "Hello world!", participants: new[] { chatParticipant }); | ||
|
||
chatParticipant.Metadata.Add("MetadataKey1", "MetadataValue1"); | ||
chatParticipant.Metadata.Add("MetadataKey2", "MetadataValue2"); | ||
|
||
CreateChatThreadOptions createChatThreadOptions = new CreateChatThreadOptions("Hello world!"); | ||
|
||
createChatThreadOptions.Participants.Add(chatParticipant); | ||
|
||
createChatThreadOptions.Metadata.Add("MetadataKey1", "MetadataValue1"); | ||
createChatThreadOptions.Metadata.Add("MetadataKey2", "MetadataValue2"); | ||
|
||
createChatThreadOptions.RetentionPolicy = new ThreadCreationDateRetentionPolicy(60); | ||
|
||
CreateChatThreadResult createChatThreadResult = await chatClient.CreateChatThreadAsync(createChatThreadOptions); | ||
string threadId = createChatThreadResult.ChatThread.Id; | ||
ChatThreadClient chatThreadClient = chatClient.GetChatThreadClient(threadId); | ||
``` | ||
|
@@ -215,11 +238,13 @@ await chatClient.DeleteChatThreadAsync(threadId); | |
|
||
### Update a thread | ||
|
||
Use `UpdateTopic` to update the chat thread topic. | ||
- `topic` is used to describe the updated topic for the thread. | ||
|
||
Use `UpdatePropertiesAsync` to update the chat thread topic or metadata. | ||
```C# Snippet:Azure_Communication_Chat_Tests_Samples_UpdateThread | ||
await chatThreadClient.UpdateTopicAsync(topic: "new topic !"); | ||
UpdateChatThreadPropertiesOptions updateChatThreadPropertiesOptions = new UpdateChatThreadPropertiesOptions(); | ||
updateChatThreadPropertiesOptions.Topic = "new topic !"; | ||
updateChatThreadPropertiesOptions.Metadata.Add("UpdateMetadataKey", "UpdateMetadataValue"); | ||
updateChatThreadPropertiesOptions.RetentionPolicy = new ThreadCreationDateRetentionPolicy(60); | ||
await chatThreadClient.UpdatePropertiesAsync(updateChatThreadPropertiesOptions); | ||
``` | ||
|
||
## Message Operations | ||
|
@@ -376,12 +401,12 @@ This project has adopted the [Microsoft Open Source Code of Conduct][coc]. For m | |
[coc_contact]: mailto:[email protected] | ||
[nuget]: https://www.nuget.org/ | ||
[netstandars2mappings]:https://github.com/dotnet/standard/blob/master/docs/versions.md | ||
[useraccesstokens]:https://learn.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp | ||
[communication_resource_docs]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp | ||
[communication_resource_create_portal]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp | ||
[communication_resource_create_power_shell]: https://learn.microsoft.com/powershell/module/az.communication/new-azcommunicationservice | ||
[communication_resource_create_net]: https://learn.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net | ||
[nextsteps]:https://learn.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp | ||
[useraccesstokens]:https://docs.microsoft.com/azure/communication-services/quickstarts/access-tokens?pivots=programming-language-csharp | ||
[communication_resource_docs]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp | ||
[communication_resource_create_portal]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-azp | ||
[communication_resource_create_power_shell]: https://docs.microsoft.com/powershell/module/az.communication/new-azcommunicationservice | ||
[communication_resource_create_net]: https://docs.microsoft.com/azure/communication-services/quickstarts/create-communication-resource?tabs=windows&pivots=platform-net | ||
[nextsteps]:https://docs.microsoft.com/azure/communication-services/quickstarts/chat/get-started?pivots=programming-language-csharp | ||
[source]: https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/communication/Azure.Communication.Chat/src | ||
[product_docs]: https://learn.microsoft.com/azure/communication-services/overview | ||
[product_docs]: https://docs.microsoft.com/azure/communication-services/overview | ||
[package]: https://www.nuget.org/packages/Azure.Communication.Chat |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.