Skip to content

Commit 351e136

Browse files
authored
[Automation] Generate Fluent Lite from botservice#package-preview-2021-05 (Azure#28434)
1 parent 52a320a commit 351e136

File tree

102 files changed

+225
-445
lines changed

Some content is hidden

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

102 files changed

+225
-445
lines changed

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

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

3-
## 1.0.0-beta.4 (Unreleased)
3+
## 1.0.0-beta.4 (2022-04-21)
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+
#### `BotServiceManager$Configurable` was modified
10+
11+
* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added
812

9-
### Bugs Fixed
13+
#### `BotServiceManager` was modified
1014

11-
### Other Changes
15+
* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added
1216

1317
## 1.0.0-beta.3 (2022-01-26)
1418

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.3</version>
35+
<version>1.0.0-beta.4</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: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,13 @@
1010
import com.azure.core.http.HttpPipelineBuilder;
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
13+
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
1314
import com.azure.core.http.policy.HttpLogOptions;
1415
import com.azure.core.http.policy.HttpLoggingPolicy;
1516
import com.azure.core.http.policy.HttpPipelinePolicy;
1617
import com.azure.core.http.policy.HttpPolicyProviders;
1718
import com.azure.core.http.policy.RequestIdPolicy;
19+
import com.azure.core.http.policy.RetryOptions;
1820
import com.azure.core.http.policy.RetryPolicy;
1921
import com.azure.core.http.policy.UserAgentPolicy;
2022
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
@@ -95,6 +97,19 @@ public static BotServiceManager authenticate(TokenCredential credential, AzurePr
9597
return configure().authenticate(credential, profile);
9698
}
9799

100+
/**
101+
* Creates an instance of BotService service API entry point.
102+
*
103+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
104+
* @param profile the Azure profile for client.
105+
* @return the BotService service API instance.
106+
*/
107+
public static BotServiceManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
108+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
109+
Objects.requireNonNull(profile, "'profile' cannot be null.");
110+
return new BotServiceManager(httpPipeline, profile, null);
111+
}
112+
98113
/**
99114
* Gets a Configurable instance that can be used to create BotServiceManager with optional configuration.
100115
*
@@ -106,13 +121,14 @@ public static Configurable configure() {
106121

107122
/** The Configurable allowing configurations to be set. */
108123
public static final class Configurable {
109-
private final ClientLogger logger = new ClientLogger(Configurable.class);
124+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
110125

111126
private HttpClient httpClient;
112127
private HttpLogOptions httpLogOptions;
113128
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
114129
private final List<String> scopes = new ArrayList<>();
115130
private RetryPolicy retryPolicy;
131+
private RetryOptions retryOptions;
116132
private Duration defaultPollInterval;
117133

118134
private Configurable() {
@@ -173,16 +189,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
173189
return this;
174190
}
175191

192+
/**
193+
* Sets the retry options for the HTTP pipeline retry policy.
194+
*
195+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
196+
*
197+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
198+
* @return the configurable object itself.
199+
*/
200+
public Configurable withRetryOptions(RetryOptions retryOptions) {
201+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
202+
return this;
203+
}
204+
176205
/**
177206
* Sets the default poll interval, used when service does not provide "Retry-After" header.
178207
*
179208
* @param defaultPollInterval the default poll interval.
180209
* @return the configurable object itself.
181210
*/
182211
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
183-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
212+
this.defaultPollInterval =
213+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
184214
if (this.defaultPollInterval.isNegative()) {
185-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
215+
throw LOGGER
216+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
186217
}
187218
return this;
188219
}
@@ -204,7 +235,7 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
204235
.append("-")
205236
.append("com.azure.resourcemanager.botservice")
206237
.append("/")
207-
.append("1.0.0-beta.3");
238+
.append("1.0.0-beta.4");
208239
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
209240
userAgentBuilder
210241
.append(" (")
@@ -222,10 +253,15 @@ public BotServiceManager authenticate(TokenCredential credential, AzureProfile p
222253
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
223254
}
224255
if (retryPolicy == null) {
225-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
256+
if (retryOptions != null) {
257+
retryPolicy = new RetryPolicy(retryOptions);
258+
} else {
259+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
260+
}
226261
}
227262
List<HttpPipelinePolicy> policies = new ArrayList<>();
228263
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
264+
policies.add(new AddHeadersFromContextPolicy());
229265
policies.add(new RequestIdPolicy());
230266
policies
231267
.addAll(

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/BotConnectionsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ Response<Void> deleteWithResponse(
207207
* @throws IllegalArgumentException thrown if parameters fail the validation.
208208
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
209209
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
210-
* @return the list of bot service connection settings response.
210+
* @return the list of bot service connection settings response as paginated response with {@link PagedIterable}.
211211
*/
212212
@ServiceMethod(returns = ReturnType.COLLECTION)
213213
PagedIterable<ConnectionSettingInner> listByBotService(String resourceGroupName, String resourceName);
@@ -221,7 +221,7 @@ Response<Void> deleteWithResponse(
221221
* @throws IllegalArgumentException thrown if parameters fail the validation.
222222
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
223223
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
224-
* @return the list of bot service connection settings response.
224+
* @return the list of bot service connection settings response as paginated response with {@link PagedIterable}.
225225
*/
226226
@ServiceMethod(returns = ReturnType.COLLECTION)
227227
PagedIterable<ConnectionSettingInner> listByBotService(

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/BotsClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ Response<BotInner> updateWithResponse(
135135
* @throws IllegalArgumentException thrown if parameters fail the validation.
136136
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
137137
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
138-
* @return the list of bot service operation response.
138+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
139139
*/
140140
@ServiceMethod(returns = ReturnType.COLLECTION)
141141
PagedIterable<BotInner> listByResourceGroup(String resourceGroupName);
@@ -148,7 +148,7 @@ Response<BotInner> updateWithResponse(
148148
* @throws IllegalArgumentException thrown if parameters fail the validation.
149149
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
150150
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
151-
* @return the list of bot service operation response.
151+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
152152
*/
153153
@ServiceMethod(returns = ReturnType.COLLECTION)
154154
PagedIterable<BotInner> listByResourceGroup(String resourceGroupName, Context context);
@@ -158,7 +158,7 @@ Response<BotInner> updateWithResponse(
158158
*
159159
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
160160
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
161-
* @return the list of bot service operation response.
161+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
162162
*/
163163
@ServiceMethod(returns = ReturnType.COLLECTION)
164164
PagedIterable<BotInner> list();
@@ -170,7 +170,7 @@ Response<BotInner> updateWithResponse(
170170
* @throws IllegalArgumentException thrown if parameters fail the validation.
171171
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
172172
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
173-
* @return the list of bot service operation response.
173+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
174174
*/
175175
@ServiceMethod(returns = ReturnType.COLLECTION)
176176
PagedIterable<BotInner> list(Context context);

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/ChannelsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Response<ListChannelWithKeysResponseInner> listWithKeysWithResponse(
187187
* @throws IllegalArgumentException thrown if parameters fail the validation.
188188
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
189189
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
190-
* @return the list of bot service channel operation response.
190+
* @return the list of bot service channel operation response as paginated response with {@link PagedIterable}.
191191
*/
192192
@ServiceMethod(returns = ReturnType.COLLECTION)
193193
PagedIterable<BotChannelInner> listByResourceGroup(String resourceGroupName, String resourceName);
@@ -201,7 +201,7 @@ Response<ListChannelWithKeysResponseInner> listWithKeysWithResponse(
201201
* @throws IllegalArgumentException thrown if parameters fail the validation.
202202
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
203203
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
204-
* @return the list of bot service channel operation response.
204+
* @return the list of bot service channel operation response as paginated response with {@link PagedIterable}.
205205
*/
206206
@ServiceMethod(returns = ReturnType.COLLECTION)
207207
PagedIterable<BotChannelInner> listByResourceGroup(String resourceGroupName, String resourceName, Context context);

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/OperationResultsClient.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
import com.azure.core.annotation.ReturnType;
88
import com.azure.core.annotation.ServiceMethod;
9-
import com.azure.core.http.rest.Response;
109
import com.azure.core.management.polling.PollResult;
1110
import com.azure.core.util.Context;
1211
import com.azure.core.util.polling.SyncPoller;
1312
import com.azure.resourcemanager.botservice.fluent.models.OperationResultsDescriptionInner;
14-
import reactor.core.publisher.Mono;
1513

1614
/** An instance of this class provides access to all the operations defined in OperationResultsClient. */
1715
public interface OperationResultsClient {
@@ -22,8 +20,7 @@ public interface OperationResultsClient {
2220
* @throws IllegalArgumentException thrown if parameters fail the validation.
2321
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2422
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
25-
* @return the operation result for a long running operation along with {@link Response} on successful completion of
26-
* {@link Mono}.
23+
* @return the {@link SyncPoller} for polling of the operation result for a long running operation.
2724
*/
2825
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
2926
SyncPoller<PollResult<OperationResultsDescriptionInner>, OperationResultsDescriptionInner> beginGet(
@@ -37,8 +34,7 @@ SyncPoller<PollResult<OperationResultsDescriptionInner>, OperationResultsDescrip
3734
* @throws IllegalArgumentException thrown if parameters fail the validation.
3835
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3936
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
40-
* @return the operation result for a long running operation along with {@link Response} on successful completion of
41-
* {@link Mono}.
37+
* @return the {@link SyncPoller} for polling of the operation result for a long running operation.
4238
*/
4339
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
4440
SyncPoller<PollResult<OperationResultsDescriptionInner>, OperationResultsDescriptionInner> beginGet(

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/OperationsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public interface OperationsClient {
1717
*
1818
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
1919
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
20-
* @return the list of bot service operation response.
20+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
2121
*/
2222
@ServiceMethod(returns = ReturnType.COLLECTION)
2323
PagedIterable<OperationEntityInner> list();
@@ -29,7 +29,7 @@ public interface OperationsClient {
2929
* @throws IllegalArgumentException thrown if parameters fail the validation.
3030
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3131
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
32-
* @return the list of bot service operation response.
32+
* @return the list of bot service operation response as paginated response with {@link PagedIterable}.
3333
*/
3434
@ServiceMethod(returns = ReturnType.COLLECTION)
3535
PagedIterable<OperationEntityInner> list(Context context);

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/PrivateEndpointConnectionsClient.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ public interface PrivateEndpointConnectionsClient {
2121
* @throws IllegalArgumentException thrown if parameters fail the validation.
2222
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2323
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
24-
* @return list of private endpoint connection associated with the specified storage account.
24+
* @return list of private endpoint connection associated with the specified storage account as paginated response
25+
* with {@link PagedIterable}.
2526
*/
2627
@ServiceMethod(returns = ReturnType.COLLECTION)
2728
PagedIterable<PrivateEndpointConnectionInner> list(String resourceGroupName, String resourceName);
@@ -35,7 +36,8 @@ public interface PrivateEndpointConnectionsClient {
3536
* @throws IllegalArgumentException thrown if parameters fail the validation.
3637
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3738
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
38-
* @return list of private endpoint connection associated with the specified storage account.
39+
* @return list of private endpoint connection associated with the specified storage account as paginated response
40+
* with {@link PagedIterable}.
3941
*/
4042
@ServiceMethod(returns = ReturnType.COLLECTION)
4143
PagedIterable<PrivateEndpointConnectionInner> list(String resourceGroupName, String resourceName, Context context);

sdk/botservice/azure-resourcemanager-botservice/src/main/java/com/azure/resourcemanager/botservice/fluent/models/BotChannelInner.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,16 @@
66

77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.management.Resource;
9-
import com.azure.core.util.logging.ClientLogger;
109
import com.azure.resourcemanager.botservice.models.Channel;
1110
import com.azure.resourcemanager.botservice.models.Kind;
1211
import com.azure.resourcemanager.botservice.models.Sku;
13-
import com.fasterxml.jackson.annotation.JsonIgnore;
1412
import com.fasterxml.jackson.annotation.JsonProperty;
1513
import java.util.List;
1614
import java.util.Map;
1715

1816
/** Bot channel resource definition. */
1917
@Fluent
2018
public class BotChannelInner extends Resource {
21-
@JsonIgnore private final ClientLogger logger = new ClientLogger(BotChannelInner.class);
22-
2319
/*
2420
* The set of properties specific to bot channel resource
2521
*/

0 commit comments

Comments
 (0)