Skip to content

Commit 2aee51d

Browse files
authored
[Automation] Generate Fluent Lite from cognitiveservices#package-2022-03 (Azure#28161)
1 parent 1829687 commit 2aee51d

File tree

145 files changed

+1622
-743
lines changed

Some content is hidden

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

145 files changed

+1622
-743
lines changed

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

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

3-
## 1.0.0-beta.4 (Unreleased)
3+
## 1.0.0-beta.4 (2022-04-11)
4+
5+
- Azure Resource Manager CognitiveServices client library for Java. This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2022-03. 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.AccountModel` was added
10+
11+
* `models.ModelDeprecationInfo` was added
12+
13+
* `models.AccountModelListResult` was added
14+
15+
#### `CognitiveServicesManager` was modified
16+
17+
* `authenticate(com.azure.core.http.HttpPipeline,com.azure.core.management.profile.AzureProfile)` was added
18+
19+
#### `models.Accounts` was modified
20+
21+
* `listModels(java.lang.String,java.lang.String)` was added
22+
* `listModels(java.lang.String,java.lang.String,com.azure.core.util.Context)` was added
23+
24+
#### `models.AccountProperties` was modified
25+
26+
* `withDynamicThrottlingEnabled(java.lang.Boolean)` was added
27+
* `deletionDate()` was added
28+
* `dynamicThrottlingEnabled()` was added
29+
* `scheduledPurgeDate()` was added
30+
31+
#### `CognitiveServicesManager$Configurable` was modified
32+
33+
* `withRetryOptions(com.azure.core.http.policy.RetryOptions)` was added
834

9-
### Bugs Fixed
35+
#### `models.DeploymentScaleSettings` was modified
1036

11-
### Other Changes
37+
* `activeCapacity()` was added
1238

1339
## 1.0.0-beta.3 (2021-11-17)
1440

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Azure Resource Manager CognitiveServices client library for Java.
44

5-
This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
5+
This package contains Microsoft Azure SDK for CognitiveServices Management SDK. Cognitive Services Management Client. Package tag package-2022-03. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
66

77
## We'd love to hear your feedback
88

@@ -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-cognitiveservices</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/cognitiveservices/azure-resourcemanager-cognitiveservices/SAMPLE.md

Lines changed: 54 additions & 32 deletions
Large diffs are not rendered by default.

sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<packaging>jar</packaging>
1414

1515
<name>Microsoft Azure SDK for CognitiveServices Management</name>
16-
<description>This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2021-10.</description>
16+
<description>This package contains Microsoft Azure SDK for CognitiveServices Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Cognitive Services Management Client. Package tag package-2022-03.</description>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/cognitiveservices/azure-resourcemanager-cognitiveservices/src/main/java/com/azure/resourcemanager/cognitiveservices/CognitiveServicesManager.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;
@@ -99,6 +101,19 @@ public static CognitiveServicesManager authenticate(TokenCredential credential,
99101
return configure().authenticate(credential, profile);
100102
}
101103

104+
/**
105+
* Creates an instance of CognitiveServices service API entry point.
106+
*
107+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
108+
* @param profile the Azure profile for client.
109+
* @return the CognitiveServices service API instance.
110+
*/
111+
public static CognitiveServicesManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
112+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
113+
Objects.requireNonNull(profile, "'profile' cannot be null.");
114+
return new CognitiveServicesManager(httpPipeline, profile, null);
115+
}
116+
102117
/**
103118
* Gets a Configurable instance that can be used to create CognitiveServicesManager with optional configuration.
104119
*
@@ -110,13 +125,14 @@ public static Configurable configure() {
110125

111126
/** The Configurable allowing configurations to be set. */
112127
public static final class Configurable {
113-
private final ClientLogger logger = new ClientLogger(Configurable.class);
128+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
114129

115130
private HttpClient httpClient;
116131
private HttpLogOptions httpLogOptions;
117132
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
118133
private final List<String> scopes = new ArrayList<>();
119134
private RetryPolicy retryPolicy;
135+
private RetryOptions retryOptions;
120136
private Duration defaultPollInterval;
121137

122138
private Configurable() {
@@ -177,16 +193,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
177193
return this;
178194
}
179195

196+
/**
197+
* Sets the retry options for the HTTP pipeline retry policy.
198+
*
199+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
200+
*
201+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
202+
* @return the configurable object itself.
203+
*/
204+
public Configurable withRetryOptions(RetryOptions retryOptions) {
205+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
206+
return this;
207+
}
208+
180209
/**
181210
* Sets the default poll interval, used when service does not provide "Retry-After" header.
182211
*
183212
* @param defaultPollInterval the default poll interval.
184213
* @return the configurable object itself.
185214
*/
186215
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
187-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
216+
this.defaultPollInterval =
217+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
188218
if (this.defaultPollInterval.isNegative()) {
189-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
219+
throw LOGGER
220+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
190221
}
191222
return this;
192223
}
@@ -208,7 +239,7 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr
208239
.append("-")
209240
.append("com.azure.resourcemanager.cognitiveservices")
210241
.append("/")
211-
.append("1.0.0-beta.3");
242+
.append("1.0.0-beta.4");
212243
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
213244
userAgentBuilder
214245
.append(" (")
@@ -226,10 +257,15 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr
226257
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
227258
}
228259
if (retryPolicy == null) {
229-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
260+
if (retryOptions != null) {
261+
retryPolicy = new RetryPolicy(retryOptions);
262+
} else {
263+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
264+
}
230265
}
231266
List<HttpPipelinePolicy> policies = new ArrayList<>();
232267
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
268+
policies.add(new AddHeadersFromContextPolicy());
233269
policies.add(new RequestIdPolicy());
234270
policies
235271
.addAll(

0 commit comments

Comments
 (0)