Skip to content

Commit

Permalink
CodeGen from PR 17712 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Cognitive Services 2022-03-01 (Azure#17712)

* Adds base for updating Microsoft.CognitiveServices from version stable/2021-10-01 to version 2022-03-01

* Updates readme

* Updates API version in new specs and examples

* Cognitive Services 2022-03-01

* Remove location/models.

* Address issues

* update sample

* Remove breaking changes.

* add x-ms-identifiers

* add x-ms-identifiers
  • Loading branch information
SDKAuto committed Mar 10, 2022
1 parent 29173d1 commit 63db54b
Show file tree
Hide file tree
Showing 144 changed files with 1,542 additions and 720 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.4 (Unreleased)
## 1.0.0-beta.1 (2022-03-10)

- 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).

### Features Added

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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-2021-10. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt).
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).

## We'd love to hear your feedback

Expand Down Expand Up @@ -32,7 +32,7 @@ Various documentation is available to help you get started
<dependency>
<groupId>com.azure.resourcemanager</groupId>
<artifactId>azure-resourcemanager-cognitiveservices</artifactId>
<version>1.0.0-beta.3</version>
<version>1.0.0-beta.4</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<packaging>jar</packaging>

<name>Microsoft Azure SDK for CognitiveServices Management</name>
<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>
<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>
<url>https://github.com/Azure/azure-sdk-for-java</url>

<licenses>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public static Configurable configure() {

/** The Configurable allowing configurations to be set. */
public static final class Configurable {
private final ClientLogger logger = new ClientLogger(Configurable.class);
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);

private HttpClient httpClient;
private HttpLogOptions httpLogOptions;
Expand Down Expand Up @@ -184,9 +184,11 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
* @return the configurable object itself.
*/
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
this.defaultPollInterval =
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
if (this.defaultPollInterval.isNegative()) {
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
throw LOGGER
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
}
return this;
}
Expand All @@ -208,7 +210,7 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr
.append("-")
.append("com.azure.resourcemanager.cognitiveservices")
.append("/")
.append("1.0.0-beta.3");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import com.azure.core.util.Context;
import com.azure.core.util.polling.SyncPoller;
import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountInner;
import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountModelInner;
import com.azure.resourcemanager.cognitiveservices.fluent.models.AccountSkuListResultInner;
import com.azure.resourcemanager.cognitiveservices.fluent.models.ApiKeysInner;
import com.azure.resourcemanager.cognitiveservices.fluent.models.UsageListResultInner;
Expand All @@ -29,8 +30,8 @@ public interface AccountsClient {
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location
* and SKU.
* @return the {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the
* provisioned account, it's type, location and SKU.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AccountInner>, AccountInner> beginCreate(
Expand All @@ -47,8 +48,8 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginCreate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location
* and SKU.
* @return the {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the
* provisioned account, it's type, location and SKU.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AccountInner>, AccountInner> beginCreate(
Expand Down Expand Up @@ -96,8 +97,8 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginCreate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location
* and SKU.
* @return the {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the
* provisioned account, it's type, location and SKU.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
Expand All @@ -113,8 +114,8 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location
* and SKU.
* @return the {@link SyncPoller} for polling of cognitive Services account is an Azure resource representing the
* provisioned account, it's type, location and SKU.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
Expand Down Expand Up @@ -159,7 +160,7 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String accountName);
Expand All @@ -173,7 +174,7 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the completion.
* @return the {@link SyncPoller} for polling of long-running operation.
*/
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String accountName, Context context);
Expand Down Expand Up @@ -227,7 +228,7 @@ SyncPoller<PollResult<AccountInner>, AccountInner> beginUpdate(
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return cognitive Services account is an Azure resource representing the provisioned account, it's type, location
* and SKU.
* and SKU along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountInner> getByResourceGroupWithResponse(
Expand All @@ -240,7 +241,8 @@ Response<AccountInner> getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountInner> listByResourceGroup(String resourceGroupName);
Expand All @@ -253,7 +255,8 @@ Response<AccountInner> getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountInner> listByResourceGroup(String resourceGroupName, Context context);
Expand All @@ -263,7 +266,8 @@ Response<AccountInner> getByResourceGroupWithResponse(
*
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountInner> list();
Expand All @@ -275,7 +279,8 @@ Response<AccountInner> getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountInner> list(Context context);
Expand All @@ -302,7 +307,7 @@ Response<AccountInner> getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the access keys for the cognitive services account.
* @return the access keys for the cognitive services account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApiKeysInner> listKeysWithResponse(String resourceGroupName, String accountName, Context context);
Expand Down Expand Up @@ -331,7 +336,7 @@ Response<AccountInner> getByResourceGroupWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the access keys for the cognitive services account.
* @return the access keys for the cognitive services account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApiKeysInner> regenerateKeyWithResponse(
Expand Down Expand Up @@ -359,7 +364,7 @@ Response<ApiKeysInner> regenerateKeyWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response.
* @return the list of cognitive services accounts operation response along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<AccountSkuListResultInner> listSkusWithResponse(
Expand Down Expand Up @@ -389,9 +394,38 @@ Response<AccountSkuListResultInner> listSkusWithResponse(
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return usages for the requested Cognitive Services account.
* @return usages for the requested Cognitive Services account along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<UsageListResultInner> listUsagesWithResponse(
String resourceGroupName, String accountName, String filter, Context context);

/**
* List available Models for the requested Cognitive Services account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of Cognitive Services account.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountModelInner> listModels(String resourceGroupName, String accountName);

/**
* List available Models for the requested Cognitive Services account.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param accountName The name of Cognitive Services account.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list of cognitive services accounts operation response as paginated response with {@link
* PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<AccountModelInner> listModels(String resourceGroupName, String accountName, Context context);
}
Loading

0 comments on commit 63db54b

Please sign in to comment.