Skip to content

Commit e69daa2

Browse files
angiurgiuAndrei Giurgiu
andauthored
prepare110 chat ga version (Azure#24001)
* Updated to 09-07-2021 for GA release * Updated to use azure-core-testfrom current, until it is GAed * Addressed APIView comments * Updated changelog * Fixed versioning issue * Updated common version to latest released 1.0.4 * Fixed JavaDocs checkstyle issues Co-authored-by: Andrei Giurgiu <agiurg@microsoft.com>
1 parent 9a66816 commit e69daa2

File tree

115 files changed

+5100
-5187
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

115 files changed

+5100
-5187
lines changed

eng/jacoco-test-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
<dependency>
6060
<groupId>com.azure</groupId>
6161
<artifactId>azure-communication-chat</artifactId>
62-
<version>1.1.0-beta.3</version> <!-- {x-version-update;com.azure:azure-communication-chat;current} -->
62+
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-communication-chat;current} -->
6363
</dependency>
6464
<dependency>
6565
<groupId>com.azure</groupId>

eng/versioning/version_client.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ com.azure:azure-analytics-synapse-artifacts;1.0.0-beta.5;1.0.0-beta.6
5151
com.azure:azure-analytics-synapse-spark;1.0.0-beta.4;1.0.0-beta.5
5252
com.azure:azure-analytics-synapse-managedprivateendpoints;1.0.0-beta.5;1.0.0-beta.6
5353
com.azure:azure-analytics-synapse-monitoring;1.0.0-beta.3;1.0.0-beta.4
54-
com.azure:azure-communication-chat;1.0.1;1.1.0-beta.3
54+
com.azure:azure-communication-chat;1.0.1;1.1.0
5555
com.azure:azure-communication-callingserver;1.0.0-beta.4;1.0.0-beta.5
5656
com.azure:azure-communication-common;1.0.4;1.1.0-beta.1
5757
com.azure:azure-communication-sms;1.0.3;1.1.0-beta.1

sdk/communication/azure-communication-chat/CHANGELOG.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,8 @@
11
# Release History
22

3-
## 1.1.0-beta.3 (Unreleased)
4-
5-
### Features Added
6-
7-
### Breaking Changes
8-
9-
### Bugs Fixed
10-
11-
### Other Changes
12-
13-
#### Dependency updates
3+
## 1.1.0 (2021-09-27)
4+
- Added javadoc code samples
5+
- Removed redundant overload `ChatThreadAsyncClient.sendTypingNotification(TypingNotificationOptions options)`
146
- Upgraded `azure-communication-common` to 1.0.4
157

168
## 1.1.0-beta.2 (2021-08-10)

sdk/communication/azure-communication-chat/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ add the direct dependency to your project as follows.
5252
<dependency>
5353
<groupId>com.azure</groupId>
5454
<artifactId>azure-communication-chat</artifactId>
55-
<version>1.1.0-beta.2</version>
55+
<version>1.1.0</version>
5656
</dependency>
5757
```
5858

@@ -102,7 +102,7 @@ The following sections provide several code snippets covering some of the most c
102102

103103
### Create the Chat Client
104104

105-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L38-L48 -->
105+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L39-L49 -->
106106
```Java
107107
String endpoint = "https://<RESOURCE_NAME>.communcationservices.azure.com";
108108

@@ -133,7 +133,7 @@ Use the `createChatThread` method to create a chat thread.
133133
It contains a `getChatThread()` method which returns the `ChatThread` object that can be used to get the thread client from which you can get the `ChatThreadClient` for performing operations on the created thread: add participants, send message, etc.
134134
The `ChatThread` object also contains the `getId()` method which retrieves the unique ID of the thread.
135135

136-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L62-L79 -->
136+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L63-L80 -->
137137
```Java
138138
List<ChatParticipant> participants = new ArrayList<ChatParticipant>();
139139

@@ -159,7 +159,7 @@ String chatThreadId = result.getChatThread().getId();
159159

160160
The `getChatThreadProperties` method retrieves a thread's properties from the service.
161161

162-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L88-L89 -->
162+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L89-L90 -->
163163
```Java
164164
ChatThreadClient chatThreadClient = chatClient.getChatThreadClient("Id");
165165
ChatThreadProperties chatThreadProperties = chatThreadClient.getProperties();
@@ -170,7 +170,7 @@ ChatThreadProperties chatThreadProperties = chatThreadClient.getProperties();
170170
Use `deleteChatThread` method to delete a chat thread
171171
`chatThreadId` is the unique ID of the chat thread.
172172

173-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L98-L99 -->
173+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L99-L100 -->
174174
```Java
175175
String chatThreadId = "Id";
176176
chatClient.deleteChatThread(chatThreadId);
@@ -181,7 +181,7 @@ chatClient.deleteChatThread(chatThreadId);
181181
The `getChatThreadClient` method returns a thread client for a thread that already exists. It can be used for performing operations on the created thread: add participants, send message, etc.
182182
`chatThreadId` is the unique ID of the existing chat thread.
183183

184-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L110-L111 -->
184+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L111-L112 -->
185185
```Java
186186
String chatThreadId = "Id";
187187
ChatThreadClient chatThreadClient = chatClient.getChatThreadClient(chatThreadId);
@@ -192,7 +192,7 @@ ChatThreadClient chatThreadClient = chatClient.getChatThreadClient(chatThreadId)
192192
Use `updateTopic` method to update a thread's topic
193193
`topic` is used to hold the new topic of the thread.
194194

195-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L122-L122 -->
195+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L123-L123 -->
196196
```Java
197197
chatThreadClient.updateTopic("New Topic");
198198
```
@@ -210,7 +210,7 @@ Use the `sendMessage` method to send a chat message to the chat thread that the
210210

211211
A `SendChatMessageResult` response returned from sending a chat message, it contains an id, which is the unique ID of the message.
212212

213-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L134-L138 -->
213+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L134-L139 -->
214214
```Java
215215
SendChatMessageOptions sendChatMessageOptions = new SendChatMessageOptions()
216216
.setContent("Message content")
@@ -224,7 +224,7 @@ SendChatMessageResult sendResult = chatThreadClient.sendMessage(sendChatMessageO
224224
The `getMessage` method retrieves a chat message from the service.
225225
`chatMessageId` is the unique ID of the chat message.
226226

227-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L147-L148 -->
227+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L148-L149 -->
228228
```Java
229229
String chatMessageId = "Id";
230230
ChatMessage chatMessage = chatThreadClient.getMessage(chatMessageId);
@@ -234,7 +234,7 @@ ChatMessage chatMessage = chatThreadClient.getMessage(chatMessageId);
234234

235235
You can retrieve chat messages using the `listMessages` method on the chat thread client at specified intervals (polling).
236236

237-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L157-L164 -->
237+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L158-L165 -->
238238
```Java
239239
PagedIterable<ChatMessage> chatMessagesResponse = chatThreadClient.listMessages();
240240
chatMessagesResponse.iterableByPage().forEach(resp -> {
@@ -276,7 +276,7 @@ Use `updateMessage` to update a chat message identified by chatThreadId and mess
276276

277277
- Use `content` to provide a new chat message content;
278278

279-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L173-L177 -->
279+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L174-L178 -->
280280
```Java
281281
String chatMessageId = "Id";
282282
UpdateChatMessageOptions updateChatMessageOptions = new UpdateChatMessageOptions()
@@ -290,7 +290,7 @@ chatThreadClient.updateMessage(chatMessageId, updateChatMessageOptions);
290290
Use `updateMessage` to update a chat message identified by chatMessageId.
291291
`chatMessageId` is the unique ID of the chat message.
292292

293-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L186-L187 -->
293+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L187-L188 -->
294294
```Java
295295
String chatMessageId = "Id";
296296
chatThreadClient.deleteMessage(chatMessageId);
@@ -302,7 +302,7 @@ chatThreadClient.deleteMessage(chatMessageId);
302302

303303
Use `listParticipants` to retrieve a paged collection containing the participants of the chat thread.
304304

305-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L196-L203 -->
305+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L197-L204 -->
306306
```Java
307307
PagedIterable<ChatParticipant> chatParticipantsResponse = chatThreadClient.listParticipants();
308308
chatParticipantsResponse.iterableByPage().forEach(resp -> {
@@ -323,7 +323,7 @@ Use `addParticipants` method to add participants to the chat thread.
323323
- `display_name`, optional, is the display name for the thread member.
324324
- `share_history_time`, optional, is the time from which the chat history is shared with the member. To share history since the inception of the chat thread, set this property to any date equal to, or less than the thread creation time. To share no history previous to when the member was added, set it to the current date. To share partial history, set it to the required date.
325325

326-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L216-L229 -->
326+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L217-L230 -->
327327
```Java
328328
List<ChatParticipant> participants = new ArrayList<ChatParticipant>();
329329

@@ -346,7 +346,7 @@ chatThreadClient.addParticipants(participants);
346346
Use `removeParticipant` method to remove a participant from the chat thread.
347347
`identifier` is the CommunicationIdentifier you've created.
348348

349-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L240-L240 -->
349+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L241-L241 -->
350350
```Java
351351
chatThreadClient.removeParticipant(user);
352352
```
@@ -358,7 +358,7 @@ chatThreadClient.removeParticipant(user);
358358
Use `sendReadReceipt` method to post a read receipt event to a chat thread, on behalf of a user.
359359
`chatMessageId` is the unique ID of the chat message that was read.
360360

361-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L249-L250 -->
361+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L250-L251 -->
362362
```Java
363363
String chatMessageId = "Id";
364364
chatThreadClient.sendReadReceipt(chatMessageId);
@@ -368,7 +368,7 @@ chatThreadClient.sendReadReceipt(chatMessageId);
368368

369369
`getReadReceipts` method retrieves read receipts for a chat thread.
370370

371-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L259-L266 -->
371+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L260-L267 -->
372372
```Java
373373
PagedIterable<ChatMessageReadReceipt> readReceiptsResponse = chatThreadClient.listReadReceipts();
374374
readReceiptsResponse.iterableByPage().forEach(resp -> {
@@ -389,11 +389,11 @@ Use `sendTypingNotification` method to post a typing notification event to a cha
389389

390390
- Use `senderDisplayName` to set the display name of the notification sender;
391391

392-
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L276-L278 -->
392+
<!-- embedme ./src/samples/java/com/azure/communication/chat/ReadmeSamples.java#L277-L279 -->
393393
```Java
394394
TypingNotificationOptions options = new TypingNotificationOptions();
395395
options.setSenderDisplayName("Sender Display Name");
396-
chatThreadClient.sendTypingNotification(options);
396+
chatThreadClient.sendTypingNotificationWithResponse(options, Context.NONE);
397397
```
398398

399399

sdk/communication/azure-communication-chat/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
<groupId>com.azure</groupId>
1616
<artifactId>azure-communication-chat</artifactId>
17-
<version>1.1.0-beta.3</version> <!-- {x-version-update;com.azure:azure-communication-chat;current} -->
17+
<version>1.1.0</version> <!-- {x-version-update;com.azure:azure-communication-chat;current} -->
1818

1919
<name>Microsoft Azure client library for chat application</name>
2020
<description>

sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatAsyncClient.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@
3232

3333
/**
3434
* Async Client that supports chat operations.
35+
*
36+
* <p><strong>Instantiating an asynchronous Chat Client</strong></p>
37+
*
38+
* {@codesnippet com.azure.communication.chat.chatasyncclient.instantiation}
39+
*
40+
* <p>View {@link ChatClientBuilder this} for additional ways to construct the client.</p>
41+
*
42+
* @see ChatClientBuilder
3543
*/
3644
@ServiceClient(builder = ChatClientBuilder.class, isAsync = true)
3745
public final class ChatAsyncClient {
@@ -60,6 +68,12 @@ public ChatThreadAsyncClient getChatThreadClient(String chatThreadId) {
6068
/**
6169
* Creates a chat thread.
6270
*
71+
* <p><strong>Code Samples</strong></p>
72+
*
73+
* <p>Create a chat thread based on "options".</p>
74+
*
75+
* {@codesnippet com.azure.communication.chat.chatasyncclient.createchatthread#createchatthreadoptions}
76+
*
6377
* @param options Options for creating a chat thread.
6478
* @throws ChatErrorResponseException thrown if the request is rejected by server.
6579
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.

sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatClient.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,14 @@
1919

2020
/**
2121
* Sync Client that supports chat operations.
22+
*
23+
* <p><strong>Instantiating a synchronous Chat Client</strong></p>
24+
*
25+
* {@codesnippet com.azure.communication.chat.chatclient.instantiation}
26+
*
27+
* <p>View {@link ChatClientBuilder this} for additional ways to construct the client.</p>
28+
*
29+
* @see ChatClientBuilder
2230
*/
2331
@ServiceClient(builder = ChatClientBuilder.class, isAsync = false)
2432
public final class ChatClient {
@@ -52,6 +60,12 @@ public ChatThreadClient getChatThreadClient(String chatThreadId) {
5260
/**
5361
* Creates a chat thread.
5462
*
63+
* <p><strong>Code Samples</strong></p>
64+
*
65+
* <p>Create a chat thread based on "options".</p>
66+
*
67+
* {@codesnippet com.azure.communication.chat.chatclient.createchatthread#createchatthreadoptions}
68+
*
5569
* @param options Options for creating a chat thread.
5670
* @throws ChatErrorResponseException thrown if the request is rejected by server.
5771
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.

sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatServiceVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
public enum ChatServiceVersion implements ServiceVersion {
1212
V2021_03_07("2021-03-07"),
13-
V2021_04_05_preview6("2021-04-05-preview6");
13+
V2021_09_27("2021-09-27");
1414

1515
private final String version;
1616

@@ -35,6 +35,6 @@ public String getVersion() {
3535
*/
3636
public static ChatServiceVersion getLatest() {
3737

38-
return V2021_04_05_preview6;
38+
return V2021_09_27;
3939
}
4040
}

sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatThreadAsyncClient.java

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,14 @@
5858

5959
/**
6060
* Async Client that supports chat thread operations.
61+
*
62+
* <p><strong>Instantiating an asynchronous Chat Thread Client</strong></p>
63+
*
64+
* {@codesnippet com.azure.communication.chat.chatthreadasyncclient.instantiation}
65+
*
66+
* <p>View {@link ChatClientBuilder this} for additional ways to construct the client.</p>
67+
*
68+
* @see ChatClientBuilder
6169
*/
6270
@ServiceClient(builder = ChatThreadClientBuilder.class, isAsync = true)
6371
public final class ChatThreadAsyncClient {
@@ -408,6 +416,12 @@ PagedFlux<ChatParticipant> listParticipants(ListParticipantsOptions listParticip
408416
/**
409417
* Sends a message to a thread.
410418
*
419+
* <p><strong>Code Samples</strong></p>
420+
*
421+
* <p>Send a chat message based on "options".</p>
422+
*
423+
* {@codesnippet com.azure.communication.chat.chatthreadasyncclient.sendmessage#sendchatmessageoptions}
424+
*
411425
* @param options Options for sending the message.
412426
* @throws ChatErrorResponseException thrown if the request is rejected by server.
413427
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -762,27 +776,6 @@ public Mono<Response<Void>> sendTypingNotificationWithResponse() {
762776
}
763777
}
764778

765-
/**
766-
* Posts a typing event to a thread, on behalf of a user.
767-
*
768-
* @param options Options for sending the typing notification.
769-
* @throws ChatErrorResponseException thrown if the request is rejected by server.
770-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
771-
* @return the completion.
772-
*/
773-
@ServiceMethod(returns = ReturnType.SINGLE)
774-
public Mono<Void> sendTypingNotification(TypingNotificationOptions options) {
775-
try {
776-
Objects.requireNonNull(options, "'options' cannot be null.");
777-
return withContext(context -> sendTypingNotification(options, context)
778-
.flatMap((Response<Void> res) -> {
779-
return Mono.empty();
780-
}));
781-
} catch (RuntimeException ex) {
782-
return monoError(logger, ex);
783-
}
784-
}
785-
786779
/**
787780
* Posts a typing event to a thread, on behalf of a user.
788781
*

sdk/communication/azure-communication-chat/src/main/java/com/azure/communication/chat/ChatThreadClient.java

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727

2828
/**
2929
* Sync Client that supports chat thread operations.
30+
*
31+
* <p><strong>Instantiating a synchronous Chat Thread Client</strong></p>
32+
*
33+
* {@codesnippet com.azure.communication.chat.chatthreadclient.instantiation}
34+
*
35+
* <p>View {@link ChatClientBuilder this} for additional ways to construct the client.</p>
36+
*
37+
* @see ChatClientBuilder
3038
*/
3139
@ServiceClient(builder = ChatThreadClientBuilder.class, isAsync = false)
3240
public final class ChatThreadClient {
@@ -214,6 +222,12 @@ public Response<SendChatMessageResult> sendMessageWithResponse(SendChatMessageOp
214222
/**
215223
* Sends a message to a thread.
216224
*
225+
* <p><strong>Code Samples</strong></p>
226+
*
227+
* <p>Send a chat message based on "options".</p>
228+
*
229+
* {@codesnippet com.azure.communication.chat.chatthreadclient.sendmessage#sendchatmessageoptions}
230+
*
217231
* @param options Options for sending the message.
218232
* @throws ChatErrorResponseException thrown if the request is rejected by server.
219233
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
@@ -380,18 +394,6 @@ public Response<Void> sendTypingNotificationWithResponse(TypingNotificationOptio
380394
return this.client.sendTypingNotification(options, context).block();
381395
}
382396

383-
/**
384-
* Posts a typing event to a thread, on behalf of a user.
385-
*
386-
* @param options Options for sending the typing notification.
387-
* @throws ChatErrorResponseException thrown if the request is rejected by server.
388-
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
389-
*/
390-
@ServiceMethod(returns = ReturnType.SINGLE)
391-
public void sendTypingNotification(TypingNotificationOptions options) {
392-
this.client.sendTypingNotification(options).block();
393-
}
394-
395397
/**
396398
* Posts a read receipt event to a thread, on behalf of a user.
397399
*

0 commit comments

Comments
 (0)