Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ReleasePR azure-resourcemanager-cognitiveservices] Cognitive Services 2023-10-01-preview updated #29255

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.5 (Unreleased)
## 1.0.0-beta.1 (2022-06-07)

- 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 @@ -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.4</version>
<version>1.0.0-beta.5</version>
</dependency>
```
[//]: # ({x-version-update-end})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr
.append("-")
.append("com.azure.resourcemanager.cognitiveservices")
.append("/")
.append("1.0.0-beta.4");
.append("1.0.0-beta.1");
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
userAgentBuilder
.append(" (")
Expand Down Expand Up @@ -296,55 +296,83 @@ public CognitiveServicesManager authenticate(TokenCredential credential, AzurePr
}
}

/** @return Resource collection API of Accounts. */
/**
* Gets the resource collection API of Accounts. It manages Account.
*
* @return Resource collection API of Accounts.
*/
public Accounts accounts() {
if (this.accounts == null) {
this.accounts = new AccountsImpl(clientObject.getAccounts(), this);
}
return accounts;
}

/** @return Resource collection API of DeletedAccounts. */
/**
* Gets the resource collection API of DeletedAccounts.
*
* @return Resource collection API of DeletedAccounts.
*/
public DeletedAccounts deletedAccounts() {
if (this.deletedAccounts == null) {
this.deletedAccounts = new DeletedAccountsImpl(clientObject.getDeletedAccounts(), this);
}
return deletedAccounts;
}

/** @return Resource collection API of ResourceSkus. */
/**
* Gets the resource collection API of ResourceSkus.
*
* @return Resource collection API of ResourceSkus.
*/
public ResourceSkus resourceSkus() {
if (this.resourceSkus == null) {
this.resourceSkus = new ResourceSkusImpl(clientObject.getResourceSkus(), this);
}
return resourceSkus;
}

/** @return Resource collection API of Operations. */
/**
* Gets the resource collection API of Operations.
*
* @return Resource collection API of Operations.
*/
public Operations operations() {
if (this.operations == null) {
this.operations = new OperationsImpl(clientObject.getOperations(), this);
}
return operations;
}

/** @return Resource collection API of ResourceProviders. */
/**
* Gets the resource collection API of ResourceProviders.
*
* @return Resource collection API of ResourceProviders.
*/
public ResourceProviders resourceProviders() {
if (this.resourceProviders == null) {
this.resourceProviders = new ResourceProvidersImpl(clientObject.getResourceProviders(), this);
}
return resourceProviders;
}

/** @return Resource collection API of CommitmentTiers. */
/**
* Gets the resource collection API of CommitmentTiers.
*
* @return Resource collection API of CommitmentTiers.
*/
public CommitmentTiers commitmentTiers() {
if (this.commitmentTiers == null) {
this.commitmentTiers = new CommitmentTiersImpl(clientObject.getCommitmentTiers(), this);
}
return commitmentTiers;
}

/** @return Resource collection API of PrivateEndpointConnections. */
/**
* Gets the resource collection API of PrivateEndpointConnections. It manages PrivateEndpointConnection.
*
* @return Resource collection API of PrivateEndpointConnections.
*/
public PrivateEndpointConnections privateEndpointConnections() {
if (this.privateEndpointConnections == null) {
this.privateEndpointConnections =
Expand All @@ -353,23 +381,35 @@ public PrivateEndpointConnections privateEndpointConnections() {
return privateEndpointConnections;
}

/** @return Resource collection API of PrivateLinkResources. */
/**
* Gets the resource collection API of PrivateLinkResources.
*
* @return Resource collection API of PrivateLinkResources.
*/
public PrivateLinkResources privateLinkResources() {
if (this.privateLinkResources == null) {
this.privateLinkResources = new PrivateLinkResourcesImpl(clientObject.getPrivateLinkResources(), this);
}
return privateLinkResources;
}

/** @return Resource collection API of Deployments. */
/**
* Gets the resource collection API of Deployments. It manages Deployment.
*
* @return Resource collection API of Deployments.
*/
public Deployments deployments() {
if (this.deployments == null) {
this.deployments = new DeploymentsImpl(clientObject.getDeployments(), this);
}
return deployments;
}

/** @return Resource collection API of CommitmentPlans. */
/**
* Gets the resource collection API of CommitmentPlans. It manages CommitmentPlan.
*
* @return Resource collection API of CommitmentPlans.
*/
public CommitmentPlans commitmentPlans() {
if (this.commitmentPlans == null) {
this.commitmentPlans = new CommitmentPlansImpl(clientObject.getCommitmentPlans(), this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ public String regionName() {
return this.location();
}

public String resourceGroupName() {
return resourceGroupName;
}

public AccountInner innerModel() {
return this.innerObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1151,14 +1151,7 @@ private Mono<Response<AccountInner>> getByResourceGroupWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<AccountInner> getByResourceGroupAsync(String resourceGroupName, String accountName) {
return getByResourceGroupWithResponseAsync(resourceGroupName, accountName)
.flatMap(
(Response<AccountInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down Expand Up @@ -1614,14 +1607,7 @@ private Mono<Response<ApiKeysInner>> listKeysWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<ApiKeysInner> listKeysAsync(String resourceGroupName, String accountName) {
return listKeysWithResponseAsync(resourceGroupName, accountName)
.flatMap(
(Response<ApiKeysInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down Expand Up @@ -1780,14 +1766,7 @@ private Mono<Response<ApiKeysInner>> regenerateKeyWithResponseAsync(
private Mono<ApiKeysInner> regenerateKeyAsync(
String resourceGroupName, String accountName, RegenerateKeyParameters parameters) {
return regenerateKeyWithResponseAsync(resourceGroupName, accountName, parameters)
.flatMap(
(Response<ApiKeysInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down Expand Up @@ -1934,14 +1913,7 @@ private Mono<Response<AccountSkuListResultInner>> listSkusWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<AccountSkuListResultInner> listSkusAsync(String resourceGroupName, String accountName) {
return listSkusWithResponseAsync(resourceGroupName, accountName)
.flatMap(
(Response<AccountSkuListResultInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down Expand Up @@ -2093,14 +2065,7 @@ private Mono<Response<UsageListResultInner>> listUsagesWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<UsageListResultInner> listUsagesAsync(String resourceGroupName, String accountName, String filter) {
return listUsagesWithResponseAsync(resourceGroupName, accountName, filter)
.flatMap(
(Response<UsageListResultInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand All @@ -2117,14 +2082,7 @@ private Mono<UsageListResultInner> listUsagesAsync(String resourceGroupName, Str
private Mono<UsageListResultInner> listUsagesAsync(String resourceGroupName, String accountName) {
final String filter = null;
return listUsagesWithResponseAsync(resourceGroupName, accountName, filter)
.flatMap(
(Response<UsageListResultInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ public CognitiveServicesManagementClientBuilder serializerAdapter(SerializerAdap
* @return an instance of CognitiveServicesManagementClientImpl.
*/
public CognitiveServicesManagementClientImpl buildClient() {
if (pipeline == null) {
this.pipeline = new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
}
if (endpoint == null) {
this.endpoint = "https://management.azure.com";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.azure.core.management.polling.PollResult;
import com.azure.core.management.polling.PollerFactory;
import com.azure.core.util.Context;
import com.azure.core.util.CoreUtils;
import com.azure.core.util.logging.ClientLogger;
import com.azure.core.util.polling.AsyncPollResponse;
import com.azure.core.util.polling.LongRunningOperationStatus;
Expand All @@ -38,7 +39,6 @@
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.Map;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

Expand Down Expand Up @@ -288,10 +288,7 @@ public Context getContext() {
* @return the merged context.
*/
public Context mergeContext(Context context) {
for (Map.Entry<Object, Object> entry : this.getContext().getValues().entrySet()) {
context = context.addData(entry.getKey(), entry.getValue());
}
return context;
return CoreUtils.mergeContexts(this.getContext(), context);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public CommitmentPlanProperties properties() {
return this.innerModel().properties();
}

public String resourceGroupName() {
return resourceGroupName;
}

public CommitmentPlanInner innerModel() {
return this.innerObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -445,14 +445,7 @@ private Mono<Response<CommitmentPlanInner>> getWithResponseAsync(
private Mono<CommitmentPlanInner> getAsync(
String resourceGroupName, String accountName, String commitmentPlanName) {
return getWithResponseAsync(resourceGroupName, accountName, commitmentPlanName)
.flatMap(
(Response<CommitmentPlanInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down Expand Up @@ -631,14 +624,7 @@ private Mono<Response<CommitmentPlanInner>> createOrUpdateWithResponseAsync(
private Mono<CommitmentPlanInner> createOrUpdateAsync(
String resourceGroupName, String accountName, String commitmentPlanName, CommitmentPlanInner commitmentPlan) {
return createOrUpdateWithResponseAsync(resourceGroupName, accountName, commitmentPlanName, commitmentPlan)
.flatMap(
(Response<CommitmentPlanInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,14 +237,7 @@ private Mono<Response<AccountInner>> getWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<AccountInner> getAsync(String location, String resourceGroupName, String accountName) {
return getWithResponseAsync(location, resourceGroupName, accountName)
.flatMap(
(Response<AccountInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ public DeploymentProperties properties() {
return this.innerModel().properties();
}

public String resourceGroupName() {
return resourceGroupName;
}

public DeploymentInner innerModel() {
return this.innerObject;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -442,14 +442,7 @@ private Mono<Response<DeploymentInner>> getWithResponseAsync(
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<DeploymentInner> getAsync(String resourceGroupName, String accountName, String deploymentName) {
return getWithResponseAsync(resourceGroupName, accountName, deploymentName)
.flatMap(
(Response<DeploymentInner> res) -> {
if (res.getValue() != null) {
return Mono.just(res.getValue());
} else {
return Mono.empty();
}
});
.flatMap(res -> Mono.justOrEmpty(res.getValue()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ public String regionName() {
return this.location();
}

public String resourceGroupName() {
return resourceGroupName;
}

public PrivateEndpointConnectionInner innerModel() {
return this.innerObject;
}
Expand Down
Loading