Skip to content

Commit

Permalink
CodeGen from PR 18607 in Azure/azure-rest-api-specs
Browse files Browse the repository at this point in the history
Merge 8259d5eac92c6facdb99d0708b2a895c016aefa6 into e7d2d8c48cf6f8f63de7e252c467930449b5fd88
  • Loading branch information
SDKAuto committed Apr 7, 2022
1 parent 7e72f82 commit d9725cb
Show file tree
Hide file tree
Showing 246 changed files with 6,800 additions and 1,694 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Release History

## 1.0.0-beta.2 (Unreleased)
## 1.0.0-beta.1 (2022-04-07)

- Azure Resource Manager DesktopVirtualization client library for Java. This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-preview-2022-04. 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 DesktopVirtualization client library for Java.

This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. Package tag package-preview-2021-09. 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 DesktopVirtualization Management SDK. Package tag package-preview-2022-04. 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-desktopvirtualization</artifactId>
<version>1.0.0-beta.1</version>
<version>1.0.0-beta.2</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 DesktopVirtualization Management</name>
<description>This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2021-09.</description>
<description>This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-preview-2022-04.</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 @@ -10,11 +10,13 @@
import com.azure.core.http.HttpPipelineBuilder;
import com.azure.core.http.HttpPipelinePosition;
import com.azure.core.http.policy.AddDatePolicy;
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
import com.azure.core.http.policy.HttpLogOptions;
import com.azure.core.http.policy.HttpLoggingPolicy;
import com.azure.core.http.policy.HttpPipelinePolicy;
import com.azure.core.http.policy.HttpPolicyProviders;
import com.azure.core.http.policy.RequestIdPolicy;
import com.azure.core.http.policy.RetryOptions;
import com.azure.core.http.policy.RetryPolicy;
import com.azure.core.http.policy.UserAgentPolicy;
import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy;
Expand All @@ -32,6 +34,7 @@
import com.azure.resourcemanager.desktopvirtualization.implementation.OperationsImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.PrivateEndpointConnectionsImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.PrivateLinkResourcesImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsImpl;
import com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsImpl;
Expand All @@ -46,6 +49,7 @@
import com.azure.resourcemanager.desktopvirtualization.models.Operations;
import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections;
import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResources;
import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedules;
import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlans;
import com.azure.resourcemanager.desktopvirtualization.models.SessionHosts;
import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems;
Expand All @@ -66,6 +70,8 @@ public final class DesktopVirtualizationManager {

private ScalingPlans scalingPlans;

private ScalingPlanPooledSchedules scalingPlanPooledSchedules;

private ApplicationGroups applicationGroups;

private StartMenuItems startMenuItems;
Expand Down Expand Up @@ -116,6 +122,19 @@ public static DesktopVirtualizationManager authenticate(TokenCredential credenti
return configure().authenticate(credential, profile);
}

/**
* Creates an instance of DesktopVirtualization service API entry point.
*
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
* @param profile the Azure profile for client.
* @return the DesktopVirtualization service API instance.
*/
public static DesktopVirtualizationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
Objects.requireNonNull(profile, "'profile' cannot be null.");
return new DesktopVirtualizationManager(httpPipeline, profile, null);
}

/**
* Gets a Configurable instance that can be used to create DesktopVirtualizationManager with optional configuration.
*
Expand All @@ -127,13 +146,14 @@ 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;
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
private final List<String> scopes = new ArrayList<>();
private RetryPolicy retryPolicy;
private RetryOptions retryOptions;
private Duration defaultPollInterval;

private Configurable() {
Expand Down Expand Up @@ -194,16 +214,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
return this;
}

/**
* Sets the retry options for the HTTP pipeline retry policy.
*
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
*
* @param retryOptions the retry options for the HTTP pipeline retry policy.
* @return the configurable object itself.
*/
public Configurable withRetryOptions(RetryOptions retryOptions) {
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
return this;
}

/**
* Sets the default poll interval, used when service does not provide "Retry-After" header.
*
* @param defaultPollInterval the default poll interval.
* @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 Down Expand Up @@ -243,10 +278,15 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
}
if (retryPolicy == null) {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
if (retryOptions != null) {
retryPolicy = new RetryPolicy(retryOptions);
} else {
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
}
}
List<HttpPipelinePolicy> policies = new ArrayList<>();
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
policies.add(new AddHeadersFromContextPolicy());
policies.add(new RequestIdPolicy());
policies
.addAll(
Expand Down Expand Up @@ -301,6 +341,15 @@ public ScalingPlans scalingPlans() {
return scalingPlans;
}

/** @return Resource collection API of ScalingPlanPooledSchedules. */
public ScalingPlanPooledSchedules scalingPlanPooledSchedules() {
if (this.scalingPlanPooledSchedules == null) {
this.scalingPlanPooledSchedules =
new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this);
}
return scalingPlanPooledSchedules;
}

/** @return Resource collection API of ApplicationGroups. */
public ApplicationGroups applicationGroups() {
if (this.applicationGroups == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public interface ApplicationGroupsClient {
* @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 an application group.
* @return an application group along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationGroupInner> getByResourceGroupWithResponse(
Expand Down Expand Up @@ -67,7 +67,7 @@ ApplicationGroupInner createOrUpdate(
* @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 represents a ApplicationGroup definition.
* @return represents a ApplicationGroup definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationGroupInner> createOrUpdateWithResponse(
Expand All @@ -94,7 +94,7 @@ Response<ApplicationGroupInner> createOrUpdateWithResponse(
* @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 response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context);
Expand Down Expand Up @@ -122,7 +122,7 @@ Response<ApplicationGroupInner> createOrUpdateWithResponse(
* @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 represents a ApplicationGroup definition.
* @return represents a ApplicationGroup definition along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationGroupInner> updateWithResponse(
Expand All @@ -135,7 +135,7 @@ Response<ApplicationGroupInner> updateWithResponse(
* @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 applicationGroupList.
* @return applicationGroupList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationGroupInner> listByResourceGroup(String resourceGroupName);
Expand All @@ -149,7 +149,7 @@ Response<ApplicationGroupInner> updateWithResponse(
* @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 applicationGroupList.
* @return applicationGroupList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationGroupInner> listByResourceGroup(String resourceGroupName, String filter, Context context);
Expand All @@ -159,7 +159,7 @@ Response<ApplicationGroupInner> updateWithResponse(
*
* @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 applicationGroupList.
* @return applicationGroupList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationGroupInner> list();
Expand All @@ -172,7 +172,7 @@ Response<ApplicationGroupInner> updateWithResponse(
* @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 applicationGroupList.
* @return applicationGroupList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationGroupInner> list(String filter, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public interface ApplicationsClient {
* @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 an application.
* @return an application along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> getWithResponse(
Expand Down Expand Up @@ -71,7 +71,7 @@ ApplicationInner createOrUpdate(
* @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 schema for Application properties.
* @return schema for Application properties along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> createOrUpdateWithResponse(
Expand Down Expand Up @@ -104,7 +104,7 @@ Response<ApplicationInner> createOrUpdateWithResponse(
* @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 response.
* @return the {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<Void> deleteWithResponse(
Expand Down Expand Up @@ -135,7 +135,7 @@ Response<Void> deleteWithResponse(
* @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 schema for Application properties.
* @return schema for Application properties along with {@link Response}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
Response<ApplicationInner> updateWithResponse(
Expand All @@ -153,7 +153,7 @@ Response<ApplicationInner> updateWithResponse(
* @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 applicationList.
* @return applicationList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationInner> list(String resourceGroupName, String applicationGroupName);
Expand All @@ -167,7 +167,7 @@ Response<ApplicationInner> updateWithResponse(
* @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 applicationList.
* @return applicationList as paginated response with {@link PagedIterable}.
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
PagedIterable<ApplicationInner> list(String resourceGroupName, String applicationGroupName, Context context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,13 @@ public interface DesktopVirtualizationApiClient {
*/
ScalingPlansClient getScalingPlans();

/**
* Gets the ScalingPlanPooledSchedulesClient object to access its operations.
*
* @return the ScalingPlanPooledSchedulesClient object.
*/
ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules();

/**
* Gets the ApplicationGroupsClient object to access its operations.
*
Expand Down
Loading

0 comments on commit d9725cb

Please sign in to comment.