Skip to content

Commit 425f4c4

Browse files
author
SDKAuto
committed
CodeGen from PR 18607 in Azure/azure-rest-api-specs
Merge 2f32085cc21438975d9d16ce50eaedecff6c4e33 into e7d2d8c48cf6f8f63de7e252c467930449b5fd88
1 parent fd961e3 commit 425f4c4

File tree

246 files changed

+6800
-1694
lines changed

Some content is hidden

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

246 files changed

+6800
-1694
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Release History
22

3-
## 1.0.0-beta.2 (Unreleased)
3+
## 1.0.0-beta.1 (2022-04-07)
4+
5+
- 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).
46

57
### Features Added
68

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/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 DesktopVirtualization client library for Java.
44

5-
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).
5+
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).
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-desktopvirtualization</artifactId>
35-
<version>1.0.0-beta.1</version>
35+
<version>1.0.0-beta.2</version>
3636
</dependency>
3737
```
3838
[//]: # ({x-version-update-end})

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/SAMPLE.md

Lines changed: 287 additions & 78 deletions
Large diffs are not rendered by default.

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/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 DesktopVirtualization Management</name>
16-
<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>
16+
<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>
1717
<url>https://github.com/Azure/azure-sdk-for-java</url>
1818

1919
<licenses>

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/DesktopVirtualizationManager.java

Lines changed: 53 additions & 4 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;
@@ -32,6 +34,7 @@
3234
import com.azure.resourcemanager.desktopvirtualization.implementation.OperationsImpl;
3335
import com.azure.resourcemanager.desktopvirtualization.implementation.PrivateEndpointConnectionsImpl;
3436
import com.azure.resourcemanager.desktopvirtualization.implementation.PrivateLinkResourcesImpl;
37+
import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlanPooledSchedulesImpl;
3538
import com.azure.resourcemanager.desktopvirtualization.implementation.ScalingPlansImpl;
3639
import com.azure.resourcemanager.desktopvirtualization.implementation.SessionHostsImpl;
3740
import com.azure.resourcemanager.desktopvirtualization.implementation.StartMenuItemsImpl;
@@ -46,6 +49,7 @@
4649
import com.azure.resourcemanager.desktopvirtualization.models.Operations;
4750
import com.azure.resourcemanager.desktopvirtualization.models.PrivateEndpointConnections;
4851
import com.azure.resourcemanager.desktopvirtualization.models.PrivateLinkResources;
52+
import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlanPooledSchedules;
4953
import com.azure.resourcemanager.desktopvirtualization.models.ScalingPlans;
5054
import com.azure.resourcemanager.desktopvirtualization.models.SessionHosts;
5155
import com.azure.resourcemanager.desktopvirtualization.models.StartMenuItems;
@@ -66,6 +70,8 @@ public final class DesktopVirtualizationManager {
6670

6771
private ScalingPlans scalingPlans;
6872

73+
private ScalingPlanPooledSchedules scalingPlanPooledSchedules;
74+
6975
private ApplicationGroups applicationGroups;
7076

7177
private StartMenuItems startMenuItems;
@@ -116,6 +122,19 @@ public static DesktopVirtualizationManager authenticate(TokenCredential credenti
116122
return configure().authenticate(credential, profile);
117123
}
118124

125+
/**
126+
* Creates an instance of DesktopVirtualization service API entry point.
127+
*
128+
* @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential.
129+
* @param profile the Azure profile for client.
130+
* @return the DesktopVirtualization service API instance.
131+
*/
132+
public static DesktopVirtualizationManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) {
133+
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
134+
Objects.requireNonNull(profile, "'profile' cannot be null.");
135+
return new DesktopVirtualizationManager(httpPipeline, profile, null);
136+
}
137+
119138
/**
120139
* Gets a Configurable instance that can be used to create DesktopVirtualizationManager with optional configuration.
121140
*
@@ -127,13 +146,14 @@ public static Configurable configure() {
127146

128147
/** The Configurable allowing configurations to be set. */
129148
public static final class Configurable {
130-
private final ClientLogger logger = new ClientLogger(Configurable.class);
149+
private static final ClientLogger LOGGER = new ClientLogger(Configurable.class);
131150

132151
private HttpClient httpClient;
133152
private HttpLogOptions httpLogOptions;
134153
private final List<HttpPipelinePolicy> policies = new ArrayList<>();
135154
private final List<String> scopes = new ArrayList<>();
136155
private RetryPolicy retryPolicy;
156+
private RetryOptions retryOptions;
137157
private Duration defaultPollInterval;
138158

139159
private Configurable() {
@@ -194,16 +214,31 @@ public Configurable withRetryPolicy(RetryPolicy retryPolicy) {
194214
return this;
195215
}
196216

217+
/**
218+
* Sets the retry options for the HTTP pipeline retry policy.
219+
*
220+
* <p>This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}.
221+
*
222+
* @param retryOptions the retry options for the HTTP pipeline retry policy.
223+
* @return the configurable object itself.
224+
*/
225+
public Configurable withRetryOptions(RetryOptions retryOptions) {
226+
this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null.");
227+
return this;
228+
}
229+
197230
/**
198231
* Sets the default poll interval, used when service does not provide "Retry-After" header.
199232
*
200233
* @param defaultPollInterval the default poll interval.
201234
* @return the configurable object itself.
202235
*/
203236
public Configurable withDefaultPollInterval(Duration defaultPollInterval) {
204-
this.defaultPollInterval = Objects.requireNonNull(defaultPollInterval, "'retryPolicy' cannot be null.");
237+
this.defaultPollInterval =
238+
Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null.");
205239
if (this.defaultPollInterval.isNegative()) {
206-
throw logger.logExceptionAsError(new IllegalArgumentException("'httpPipeline' cannot be negative"));
240+
throw LOGGER
241+
.logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative"));
207242
}
208243
return this;
209244
}
@@ -243,10 +278,15 @@ public DesktopVirtualizationManager authenticate(TokenCredential credential, Azu
243278
scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default");
244279
}
245280
if (retryPolicy == null) {
246-
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
281+
if (retryOptions != null) {
282+
retryPolicy = new RetryPolicy(retryOptions);
283+
} else {
284+
retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS);
285+
}
247286
}
248287
List<HttpPipelinePolicy> policies = new ArrayList<>();
249288
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
289+
policies.add(new AddHeadersFromContextPolicy());
250290
policies.add(new RequestIdPolicy());
251291
policies
252292
.addAll(
@@ -301,6 +341,15 @@ public ScalingPlans scalingPlans() {
301341
return scalingPlans;
302342
}
303343

344+
/** @return Resource collection API of ScalingPlanPooledSchedules. */
345+
public ScalingPlanPooledSchedules scalingPlanPooledSchedules() {
346+
if (this.scalingPlanPooledSchedules == null) {
347+
this.scalingPlanPooledSchedules =
348+
new ScalingPlanPooledSchedulesImpl(clientObject.getScalingPlanPooledSchedules(), this);
349+
}
350+
return scalingPlanPooledSchedules;
351+
}
352+
304353
/** @return Resource collection API of ApplicationGroups. */
305354
public ApplicationGroups applicationGroups() {
306355
if (this.applicationGroups == null) {

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationGroupsClient.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public interface ApplicationGroupsClient {
3636
* @throws IllegalArgumentException thrown if parameters fail the validation.
3737
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3838
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
39-
* @return an application group.
39+
* @return an application group along with {@link Response}.
4040
*/
4141
@ServiceMethod(returns = ReturnType.SINGLE)
4242
Response<ApplicationGroupInner> getByResourceGroupWithResponse(
@@ -67,7 +67,7 @@ ApplicationGroupInner createOrUpdate(
6767
* @throws IllegalArgumentException thrown if parameters fail the validation.
6868
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
6969
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
70-
* @return represents a ApplicationGroup definition.
70+
* @return represents a ApplicationGroup definition along with {@link Response}.
7171
*/
7272
@ServiceMethod(returns = ReturnType.SINGLE)
7373
Response<ApplicationGroupInner> createOrUpdateWithResponse(
@@ -94,7 +94,7 @@ Response<ApplicationGroupInner> createOrUpdateWithResponse(
9494
* @throws IllegalArgumentException thrown if parameters fail the validation.
9595
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
9696
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
97-
* @return the response.
97+
* @return the {@link Response}.
9898
*/
9999
@ServiceMethod(returns = ReturnType.SINGLE)
100100
Response<Void> deleteWithResponse(String resourceGroupName, String applicationGroupName, Context context);
@@ -122,7 +122,7 @@ Response<ApplicationGroupInner> createOrUpdateWithResponse(
122122
* @throws IllegalArgumentException thrown if parameters fail the validation.
123123
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
124124
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
125-
* @return represents a ApplicationGroup definition.
125+
* @return represents a ApplicationGroup definition along with {@link Response}.
126126
*/
127127
@ServiceMethod(returns = ReturnType.SINGLE)
128128
Response<ApplicationGroupInner> updateWithResponse(
@@ -135,7 +135,7 @@ Response<ApplicationGroupInner> 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 applicationGroupList.
138+
* @return applicationGroupList as paginated response with {@link PagedIterable}.
139139
*/
140140
@ServiceMethod(returns = ReturnType.COLLECTION)
141141
PagedIterable<ApplicationGroupInner> listByResourceGroup(String resourceGroupName);
@@ -149,7 +149,7 @@ Response<ApplicationGroupInner> updateWithResponse(
149149
* @throws IllegalArgumentException thrown if parameters fail the validation.
150150
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
151151
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
152-
* @return applicationGroupList.
152+
* @return applicationGroupList as paginated response with {@link PagedIterable}.
153153
*/
154154
@ServiceMethod(returns = ReturnType.COLLECTION)
155155
PagedIterable<ApplicationGroupInner> listByResourceGroup(String resourceGroupName, String filter, Context context);
@@ -159,7 +159,7 @@ Response<ApplicationGroupInner> updateWithResponse(
159159
*
160160
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
161161
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
162-
* @return applicationGroupList.
162+
* @return applicationGroupList as paginated response with {@link PagedIterable}.
163163
*/
164164
@ServiceMethod(returns = ReturnType.COLLECTION)
165165
PagedIterable<ApplicationGroupInner> list();
@@ -172,7 +172,7 @@ Response<ApplicationGroupInner> updateWithResponse(
172172
* @throws IllegalArgumentException thrown if parameters fail the validation.
173173
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
174174
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
175-
* @return applicationGroupList.
175+
* @return applicationGroupList as paginated response with {@link PagedIterable}.
176176
*/
177177
@ServiceMethod(returns = ReturnType.COLLECTION)
178178
PagedIterable<ApplicationGroupInner> list(String filter, Context context);

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/ApplicationsClient.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public interface ApplicationsClient {
3838
* @throws IllegalArgumentException thrown if parameters fail the validation.
3939
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
4040
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
41-
* @return an application.
41+
* @return an application along with {@link Response}.
4242
*/
4343
@ServiceMethod(returns = ReturnType.SINGLE)
4444
Response<ApplicationInner> getWithResponse(
@@ -71,7 +71,7 @@ ApplicationInner createOrUpdate(
7171
* @throws IllegalArgumentException thrown if parameters fail the validation.
7272
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
7373
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
74-
* @return schema for Application properties.
74+
* @return schema for Application properties along with {@link Response}.
7575
*/
7676
@ServiceMethod(returns = ReturnType.SINGLE)
7777
Response<ApplicationInner> createOrUpdateWithResponse(
@@ -104,7 +104,7 @@ Response<ApplicationInner> createOrUpdateWithResponse(
104104
* @throws IllegalArgumentException thrown if parameters fail the validation.
105105
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
106106
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
107-
* @return the response.
107+
* @return the {@link Response}.
108108
*/
109109
@ServiceMethod(returns = ReturnType.SINGLE)
110110
Response<Void> deleteWithResponse(
@@ -135,7 +135,7 @@ Response<Void> deleteWithResponse(
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 schema for Application properties.
138+
* @return schema for Application properties along with {@link Response}.
139139
*/
140140
@ServiceMethod(returns = ReturnType.SINGLE)
141141
Response<ApplicationInner> updateWithResponse(
@@ -153,7 +153,7 @@ Response<ApplicationInner> updateWithResponse(
153153
* @throws IllegalArgumentException thrown if parameters fail the validation.
154154
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
155155
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
156-
* @return applicationList.
156+
* @return applicationList as paginated response with {@link PagedIterable}.
157157
*/
158158
@ServiceMethod(returns = ReturnType.COLLECTION)
159159
PagedIterable<ApplicationInner> list(String resourceGroupName, String applicationGroupName);
@@ -167,7 +167,7 @@ Response<ApplicationInner> updateWithResponse(
167167
* @throws IllegalArgumentException thrown if parameters fail the validation.
168168
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
169169
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
170-
* @return applicationList.
170+
* @return applicationList as paginated response with {@link PagedIterable}.
171171
*/
172172
@ServiceMethod(returns = ReturnType.COLLECTION)
173173
PagedIterable<ApplicationInner> list(String resourceGroupName, String applicationGroupName, Context context);

sdk/desktopvirtualization/azure-resourcemanager-desktopvirtualization/src/main/java/com/azure/resourcemanager/desktopvirtualization/fluent/DesktopVirtualizationApiClient.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,13 @@ public interface DesktopVirtualizationApiClient {
6565
*/
6666
ScalingPlansClient getScalingPlans();
6767

68+
/**
69+
* Gets the ScalingPlanPooledSchedulesClient object to access its operations.
70+
*
71+
* @return the ScalingPlanPooledSchedulesClient object.
72+
*/
73+
ScalingPlanPooledSchedulesClient getScalingPlanPooledSchedules();
74+
6875
/**
6976
* Gets the ApplicationGroupsClient object to access its operations.
7077
*

0 commit comments

Comments
 (0)