Skip to content

Commit 807231a

Browse files
authored
[Automation] Generate Fluent Lite from botservice#package-preview-2021-05 (Azure#29548)
1 parent c3efbc7 commit 807231a

24 files changed

+158
-181
lines changed

sdk/botservice/azure-resourcemanager-botservice/CHANGELOG.md

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
# Release History
22

3-
## 1.0.0-beta.5 (Unreleased)
3+
## 1.0.0-beta.5 (2022-06-20)
4+
5+
- Azure Resource Manager BotService client library for Java. This package contains Microsoft Azure SDK for BotService Management SDK. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-preview-2021-05. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
46

57
### Features Added
68

7-
### Breaking Changes
9+
#### `models.Bot` was modified
10+
11+
* `resourceGroupName()` was added
812

9-
### Bugs Fixed
13+
#### `models.SlackChannelProperties` was modified
14+
15+
* `withRegisterBeforeOAuthFlow(java.lang.Boolean)` was added
16+
17+
#### `models.ConnectionSetting` was modified
1018

11-
### Other Changes
19+
* `resourceGroupName()` was added
1220

1321
## 1.0.0-beta.4 (2022-04-21)
1422

sdk/botservice/azure-resourcemanager-botservice/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232
<dependency>
3333
<groupId>com.azure.resourcemanager</groupId>
3434
<artifactId>azure-resourcemanager-botservice</artifactId>
35-
<version>1.0.0-beta.4</version>
35+
<version>1.0.0-beta.5</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/BotServiceManager.java

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
235235
.append("-")
236236
.append("com.azure.resourcemanager.botservice")
237237
.append("/")
238-
.append("1.0.0-beta.4");
238+
.append("1.0.0-beta.5");
239239
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
240240
userAgentBuilder
241241
.append(" (")
@@ -292,63 +292,95 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
292292
}
293293
}
294294

295-
/** @return Resource collection API of Bots. */
295+
/**
296+
* Gets the resource collection API of Bots. It manages Bot.
297+
*
298+
* @return Resource collection API of Bots.
299+
*/
296300
public Bots bots() {
297301
if (this.bots == null) {
298302
this.bots = new BotsImpl(clientObject.getBots(), this);
299303
}
300304
return bots;
301305
}
302306

303-
/** @return Resource collection API of Channels. */
307+
/**
308+
* Gets the resource collection API of Channels.
309+
*
310+
* @return Resource collection API of Channels.
311+
*/
304312
public Channels channels() {
305313
if (this.channels == null) {
306314
this.channels = new ChannelsImpl(clientObject.getChannels(), this);
307315
}
308316
return channels;
309317
}
310318

311-
/** @return Resource collection API of DirectLines. */
319+
/**
320+
* Gets the resource collection API of DirectLines.
321+
*
322+
* @return Resource collection API of DirectLines.
323+
*/
312324
public DirectLines directLines() {
313325
if (this.directLines == null) {
314326
this.directLines = new DirectLinesImpl(clientObject.getDirectLines(), this);
315327
}
316328
return directLines;
317329
}
318330

319-
/** @return Resource collection API of Operations. */
331+
/**
332+
* Gets the resource collection API of Operations.
333+
*
334+
* @return Resource collection API of Operations.
335+
*/
320336
public Operations operations() {
321337
if (this.operations == null) {
322338
this.operations = new OperationsImpl(clientObject.getOperations(), this);
323339
}
324340
return operations;
325341
}
326342

327-
/** @return Resource collection API of BotConnections. */
343+
/**
344+
* Gets the resource collection API of BotConnections. It manages ConnectionSetting.
345+
*
346+
* @return Resource collection API of BotConnections.
347+
*/
328348
public BotConnections botConnections() {
329349
if (this.botConnections == null) {
330350
this.botConnections = new BotConnectionsImpl(clientObject.getBotConnections(), this);
331351
}
332352
return botConnections;
333353
}
334354

335-
/** @return Resource collection API of HostSettings. */
355+
/**
356+
* Gets the resource collection API of HostSettings.
357+
*
358+
* @return Resource collection API of HostSettings.
359+
*/
336360
public HostSettings hostSettings() {
337361
if (this.hostSettings == null) {
338362
this.hostSettings = new HostSettingsImpl(clientObject.getHostSettings(), this);
339363
}
340364
return hostSettings;
341365
}
342366

343-
/** @return Resource collection API of OperationResults. */
367+
/**
368+
* Gets the resource collection API of OperationResults.
369+
*
370+
* @return Resource collection API of OperationResults.
371+
*/
344372
public OperationResults operationResults() {
345373
if (this.operationResults == null) {
346374
this.operationResults = new OperationResultsImpl(clientObject.getOperationResults(), this);
347375
}
348376
return operationResults;
349377
}
350378

351-
/** @return Resource collection API of PrivateEndpointConnections. */
379+
/**
380+
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
381+
*
382+
* @return Resource collection API of PrivateEndpointConnections.
383+
*/
352384
public PrivateEndpointConnections privateEndpointConnections() {
353385
if (this.privateEndpointConnections == null) {
354386
this.privateEndpointConnections =
@@ -357,7 +389,11 @@ public PrivateEndpointConnections privateEndpointConnections() {
357389
return privateEndpointConnections;
358390
}
359391

360-
/** @return Resource collection API of PrivateLinkResources. */
392+
/**
393+
* Gets the resource collection API of PrivateLinkResources.
394+
*
395+
* @return Resource collection API of PrivateLinkResources.
396+
*/
361397
public PrivateLinkResources privateLinkResources() {
362398
if (this.privateLinkResources == null) {
363399
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/implementation/AzureBotServiceImpl.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
import com.azure.core.management.polling.PollResult;
1616
import com.azure.core.management.polling.PollerFactory;
1717
import com.azure.core.util.Context;
18+
import com.azure.core.util.CoreUtils;
1819
import com.azure.core.util.logging.ClientLogger;
1920
import com.azure.core.util.polling.AsyncPollResponse;
2021
import com.azure.core.util.polling.LongRunningOperationStatus;
@@ -37,7 +38,6 @@
3738
import java.nio.charset.Charset;
3839
import java.nio.charset.StandardCharsets;
3940
import java.time.Duration;
40-
import java.util.Map;
4141
import reactor.core.publisher.Flux;
4242
import reactor.core.publisher.Mono;
4343

@@ -274,10 +274,7 @@ public Context getContext() {
274274
* @return the merged context.
275275
*/
276276
public Context mergeContext(Context context) {
277-
for (Map.Entry<Object, Object> entry : this.getContext().getValues().entrySet()) {
278-
context = context.addData(entry.getKey(), entry.getValue());
279-
}
280-
return context;
277+
return CoreUtils.mergeContexts(this.getContext(), context);
281278
}
282279

283280
/**

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/implementation/BotConnectionsClientImpl.java

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,7 @@ private Mono<Response<ServiceProviderResponseListInner>> listServiceProvidersWit
261261
*/
262262
@ServiceMethod(returns = ReturnType.SINGLE)
263263
private Mono<ServiceProviderResponseListInner> listServiceProvidersAsync() {
264-
return listServiceProvidersWithResponseAsync()
265-
.flatMap(
266-
(Response<ServiceProviderResponseListInner> res) -> {
267-
if (res.getValue() != null) {
268-
return Mono.just(res.getValue());
269-
} else {
270-
return Mono.empty();
271-
}
272-
});
264+
return listServiceProvidersWithResponseAsync().flatMap(res -> Mono.justOrEmpty(res.getValue()));
273265
}
274266

275267
/**
@@ -419,14 +411,7 @@ private Mono<Response<ConnectionSettingInner>> listWithSecretsWithResponseAsync(
419411
private Mono<ConnectionSettingInner> listWithSecretsAsync(
420412
String resourceGroupName, String resourceName, String connectionName) {
421413
return listWithSecretsWithResponseAsync(resourceGroupName, resourceName, connectionName)
422-
.flatMap(
423-
(Response<ConnectionSettingInner> res) -> {
424-
if (res.getValue() != null) {
425-
return Mono.just(res.getValue());
426-
} else {
427-
return Mono.empty();
428-
}
429-
});
414+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
430415
}
431416

432417
/**
@@ -602,14 +587,7 @@ private Mono<Response<ConnectionSettingInner>> createWithResponseAsync(
602587
private Mono<ConnectionSettingInner> createAsync(
603588
String resourceGroupName, String resourceName, String connectionName, ConnectionSettingInner parameters) {
604589
return createWithResponseAsync(resourceGroupName, resourceName, connectionName, parameters)
605-
.flatMap(
606-
(Response<ConnectionSettingInner> res) -> {
607-
if (res.getValue() != null) {
608-
return Mono.just(res.getValue());
609-
} else {
610-
return Mono.empty();
611-
}
612-
});
590+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
613591
}
614592

615593
/**
@@ -791,14 +769,7 @@ private Mono<Response<ConnectionSettingInner>> updateWithResponseAsync(
791769
private Mono<ConnectionSettingInner> updateAsync(
792770
String resourceGroupName, String resourceName, String connectionName, ConnectionSettingInner parameters) {
793771
return updateWithResponseAsync(resourceGroupName, resourceName, connectionName, parameters)
794-
.flatMap(
795-
(Response<ConnectionSettingInner> res) -> {
796-
if (res.getValue() != null) {
797-
return Mono.just(res.getValue());
798-
} else {
799-
return Mono.empty();
800-
}
801-
});
772+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
802773
}
803774

804775
/**
@@ -963,14 +934,7 @@ private Mono<Response<ConnectionSettingInner>> getWithResponseAsync(
963934
private Mono<ConnectionSettingInner> getAsync(
964935
String resourceGroupName, String resourceName, String connectionName) {
965936
return getWithResponseAsync(resourceGroupName, resourceName, connectionName)
966-
.flatMap(
967-
(Response<ConnectionSettingInner> res) -> {
968-
if (res.getValue() != null) {
969-
return Mono.just(res.getValue());
970-
} else {
971-
return Mono.empty();
972-
}
973-
});
937+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
974938
}
975939

976940
/**
@@ -1125,7 +1089,7 @@ private Mono<Response<Void>> deleteWithResponseAsync(
11251089
@ServiceMethod(returns = ReturnType.SINGLE)
11261090
private Mono<Void> deleteAsync(String resourceGroupName, String resourceName, String connectionName) {
11271091
return deleteWithResponseAsync(resourceGroupName, resourceName, connectionName)
1128-
.flatMap((Response<Void> res) -> Mono.empty());
1092+
.flatMap(ignored -> Mono.empty());
11291093
}
11301094

11311095
/**

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/implementation/BotImpl.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ public String regionName() {
7878
return this.location();
7979
}
8080

81+
public String resourceGroupName() {
82+
return resourceGroupName;
83+
}
84+
8185
public BotInner innerModel() {
8286
return this.innerObject;
8387
}

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/implementation/BotsClientImpl.java

Lines changed: 5 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -303,14 +303,7 @@ private Mono<Response<BotInner>> createWithResponseAsync(
303303
@ServiceMethod(returns = ReturnType.SINGLE)
304304
private Mono<BotInner> createAsync(String resourceGroupName, String resourceName, BotInner parameters) {
305305
return createWithResponseAsync(resourceGroupName, resourceName, parameters)
306-
.flatMap(
307-
(Response<BotInner> res) -> {
308-
if (res.getValue() != null) {
309-
return Mono.just(res.getValue());
310-
} else {
311-
return Mono.empty();
312-
}
313-
});
306+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
314307
}
315308

316309
/**
@@ -469,14 +462,7 @@ private Mono<Response<BotInner>> updateWithResponseAsync(
469462
@ServiceMethod(returns = ReturnType.SINGLE)
470463
private Mono<BotInner> updateAsync(String resourceGroupName, String resourceName, BotInner parameters) {
471464
return updateWithResponseAsync(resourceGroupName, resourceName, parameters)
472-
.flatMap(
473-
(Response<BotInner> res) -> {
474-
if (res.getValue() != null) {
475-
return Mono.just(res.getValue());
476-
} else {
477-
return Mono.empty();
478-
}
479-
});
465+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
480466
}
481467

482468
/**
@@ -618,7 +604,7 @@ private Mono<Response<Void>> deleteWithResponseAsync(
618604
*/
619605
@ServiceMethod(returns = ReturnType.SINGLE)
620606
private Mono<Void> deleteAsync(String resourceGroupName, String resourceName) {
621-
return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap((Response<Void> res) -> Mono.empty());
607+
return deleteWithResponseAsync(resourceGroupName, resourceName).flatMap(ignored -> Mono.empty());
622608
}
623609

624610
/**
@@ -758,14 +744,7 @@ private Mono<Response<BotInner>> getByResourceGroupWithResponseAsync(
758744
@ServiceMethod(returns = ReturnType.SINGLE)
759745
private Mono<BotInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
760746
return getByResourceGroupWithResponseAsync(resourceGroupName, resourceName)
761-
.flatMap(
762-
(Response<BotInner> res) -> {
763-
if (res.getValue() != null) {
764-
return Mono.just(res.getValue());
765-
} else {
766-
return Mono.empty();
767-
}
768-
});
747+
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
769748
}
770749

771750
/**
@@ -1186,15 +1165,7 @@ private Mono<Response<CheckNameAvailabilityResponseBodyInner>> getCheckNameAvail
11861165
@ServiceMethod(returns = ReturnType.SINGLE)
11871166
private Mono<CheckNameAvailabilityResponseBodyInner> getCheckNameAvailabilityAsync(
11881167
CheckNameAvailabilityRequestBody parameters) {
1189-
return getCheckNameAvailabilityWithResponseAsync(parameters)
1190-
.flatMap(
1191-
(Response<CheckNameAvailabilityResponseBodyInner> res) -> {
1192-
if (res.getValue() != null) {
1193-
return Mono.just(res.getValue());
1194-
} else {
1195-
return Mono.empty();
1196-
}
1197-
});
1168+
return getCheckNameAvailabilityWithResponseAsync(parameters).flatMap(res -> Mono.justOrEmpty(res.getValue()));
11981169
}
11991170

12001171
/**

0 commit comments

Comments
 (0)