Skip to content

Commit 769f641

Browse files
author
SDKAuto
committed
CodeGen from PR 17681 in Azure/azure-rest-api-specs
Merge aeb36ab42b4dd6cf93a368470cda52495faa29d6 into 3f59f46d112c58cb8f6231732e88848f0f97872c
1 parent 2c40503 commit 769f641

File tree

6 files changed

+149
-98
lines changed

6 files changed

+149
-98
lines changed

sdk/extendedlocation/azure-resourcemanager-extendedlocation/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-02-17)
4+
5+
- Azure Resource Manager CustomLocations client library for Java. This package contains Microsoft Azure SDK for CustomLocations Management SDK. The customLocations Rest API spec. Package tag package-2021-08-15. 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/extendedlocation/azure-resourcemanager-extendedlocation/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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-extendedlocation</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/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/CustomLocationsManager.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.azure.core.http.HttpClient;
99
import com.azure.core.http.HttpPipeline;
1010
import com.azure.core.http.HttpPipelineBuilder;
11+
import com.azure.core.http.HttpPipelinePosition;
1112
import com.azure.core.http.policy.AddDatePolicy;
1213
import com.azure.core.http.policy.HttpLogOptions;
1314
import com.azure.core.http.policy.HttpLoggingPolicy;
@@ -29,6 +30,7 @@
2930
import java.util.ArrayList;
3031
import java.util.List;
3132
import java.util.Objects;
33+
import java.util.stream.Collectors;
3234

3335
/** Entry point to CustomLocationsManager. The customLocations Rest API spec. */
3436
public final class CustomLocationsManager {
@@ -193,11 +195,24 @@ public CustomLocationsManager authenticate(TokenCredential credential, AzureProf
193195
List<HttpPipelinePolicy> policies = new ArrayList<>();
194196
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
195197
policies.add(new RequestIdPolicy());
198+
policies
199+
.addAll(
200+
this
201+
.policies
202+
.stream()
203+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
204+
.collect(Collectors.toList()));
196205
HttpPolicyProviders.addBeforeRetryPolicies(policies);
197206
policies.add(retryPolicy);
198207
policies.add(new AddDatePolicy());
199208
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
200-
policies.addAll(this.policies);
209+
policies
210+
.addAll(
211+
this
212+
.policies
213+
.stream()
214+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
215+
.collect(Collectors.toList()));
201216
HttpPolicyProviders.addAfterRetryPolicies(policies);
202217
policies.add(new HttpLoggingPolicy(httpLogOptions));
203218
HttpPipeline httpPipeline =

sdk/extendedlocation/azure-resourcemanager-extendedlocation/src/main/java/com/azure/resourcemanager/extendedlocation/fluent/CustomLocationsClient.java

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public interface CustomLocationsClient {
2323
*
2424
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
2525
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
26-
* @return lists of Custom Locations operations.
26+
* @return lists of Custom Locations operations as paginated response with {@link PagedIterable}.
2727
*/
2828
@ServiceMethod(returns = ReturnType.COLLECTION)
2929
PagedIterable<CustomLocationOperationInner> listOperations();
@@ -35,7 +35,7 @@ public interface CustomLocationsClient {
3535
* @throws IllegalArgumentException thrown if parameters fail the validation.
3636
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
3737
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
38-
* @return lists of Custom Locations operations.
38+
* @return lists of Custom Locations operations as paginated response with {@link PagedIterable}.
3939
*/
4040
@ServiceMethod(returns = ReturnType.COLLECTION)
4141
PagedIterable<CustomLocationOperationInner> listOperations(Context context);
@@ -46,7 +46,8 @@ public interface CustomLocationsClient {
4646
*
4747
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
4848
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
49-
* @return a list of Custom Locations in the specified subscription.
49+
* @return a list of Custom Locations in the specified subscription as paginated response with {@link
50+
* PagedIterable}.
5051
*/
5152
@ServiceMethod(returns = ReturnType.COLLECTION)
5253
PagedIterable<CustomLocationInner> list();
@@ -59,7 +60,8 @@ public interface CustomLocationsClient {
5960
* @throws IllegalArgumentException thrown if parameters fail the validation.
6061
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
6162
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
62-
* @return a list of Custom Locations in the specified subscription.
63+
* @return a list of Custom Locations in the specified subscription as paginated response with {@link
64+
* PagedIterable}.
6365
*/
6466
@ServiceMethod(returns = ReturnType.COLLECTION)
6567
PagedIterable<CustomLocationInner> list(Context context);
@@ -72,7 +74,8 @@ public interface CustomLocationsClient {
7274
* @throws IllegalArgumentException thrown if parameters fail the validation.
7375
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
7476
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
75-
* @return a list of Custom Locations in the specified subscription and resource group.
77+
* @return a list of Custom Locations in the specified subscription and resource group as paginated response with
78+
* {@link PagedIterable}.
7679
*/
7780
@ServiceMethod(returns = ReturnType.COLLECTION)
7881
PagedIterable<CustomLocationInner> listByResourceGroup(String resourceGroupName);
@@ -86,7 +89,8 @@ public interface CustomLocationsClient {
8689
* @throws IllegalArgumentException thrown if parameters fail the validation.
8790
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
8891
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
89-
* @return a list of Custom Locations in the specified subscription and resource group.
92+
* @return a list of Custom Locations in the specified subscription and resource group as paginated response with
93+
* {@link PagedIterable}.
9094
*/
9195
@ServiceMethod(returns = ReturnType.COLLECTION)
9296
PagedIterable<CustomLocationInner> listByResourceGroup(String resourceGroupName, Context context);
@@ -113,7 +117,7 @@ public interface CustomLocationsClient {
113117
* @throws IllegalArgumentException thrown if parameters fail the validation.
114118
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
115119
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
116-
* @return the details of the customLocation with a specified resource group and name.
120+
* @return the details of the customLocation with a specified resource group and name along with {@link Response}.
117121
*/
118122
@ServiceMethod(returns = ReturnType.SINGLE)
119123
Response<CustomLocationInner> getByResourceGroupWithResponse(
@@ -128,9 +132,9 @@ Response<CustomLocationInner> getByResourceGroupWithResponse(
128132
* @throws IllegalArgumentException thrown if parameters fail the validation.
129133
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
130134
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
131-
* @return custom Locations definition.
135+
* @return the {@link SyncPoller} for polling of custom Locations definition.
132136
*/
133-
@ServiceMethod(returns = ReturnType.SINGLE)
137+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
134138
SyncPoller<PollResult<CustomLocationInner>, CustomLocationInner> beginCreateOrUpdate(
135139
String resourceGroupName, String resourceName, CustomLocationInner parameters);
136140

@@ -144,9 +148,9 @@ SyncPoller<PollResult<CustomLocationInner>, CustomLocationInner> beginCreateOrUp
144148
* @throws IllegalArgumentException thrown if parameters fail the validation.
145149
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
146150
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
147-
* @return custom Locations definition.
151+
* @return the {@link SyncPoller} for polling of custom Locations definition.
148152
*/
149-
@ServiceMethod(returns = ReturnType.SINGLE)
153+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
150154
SyncPoller<PollResult<CustomLocationInner>, CustomLocationInner> beginCreateOrUpdate(
151155
String resourceGroupName, String resourceName, CustomLocationInner parameters, Context context);
152156

@@ -188,9 +192,9 @@ CustomLocationInner createOrUpdate(
188192
* @throws IllegalArgumentException thrown if parameters fail the validation.
189193
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
190194
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
191-
* @return the completion.
195+
* @return the {@link SyncPoller} for polling of long-running operation.
192196
*/
193-
@ServiceMethod(returns = ReturnType.SINGLE)
197+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
194198
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String resourceName);
195199

196200
/**
@@ -202,9 +206,9 @@ CustomLocationInner createOrUpdate(
202206
* @throws IllegalArgumentException thrown if parameters fail the validation.
203207
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
204208
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
205-
* @return the completion.
209+
* @return the {@link SyncPoller} for polling of long-running operation.
206210
*/
207-
@ServiceMethod(returns = ReturnType.SINGLE)
211+
@ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION)
208212
SyncPoller<PollResult<Void>, Void> beginDelete(String resourceGroupName, String resourceName, Context context);
209213

210214
/**
@@ -256,7 +260,7 @@ CustomLocationInner createOrUpdate(
256260
* @throws IllegalArgumentException thrown if parameters fail the validation.
257261
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
258262
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
259-
* @return custom Locations definition.
263+
* @return custom Locations definition along with {@link Response}.
260264
*/
261265
@ServiceMethod(returns = ReturnType.SINGLE)
262266
Response<CustomLocationInner> updateWithResponse(
@@ -270,7 +274,7 @@ Response<CustomLocationInner> updateWithResponse(
270274
* @throws IllegalArgumentException thrown if parameters fail the validation.
271275
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
272276
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
273-
* @return the list of the Enabled Resource Types.
277+
* @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}.
274278
*/
275279
@ServiceMethod(returns = ReturnType.COLLECTION)
276280
PagedIterable<EnabledResourceTypeInner> listEnabledResourceTypes(String resourceGroupName, String resourceName);
@@ -284,7 +288,7 @@ Response<CustomLocationInner> updateWithResponse(
284288
* @throws IllegalArgumentException thrown if parameters fail the validation.
285289
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
286290
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
287-
* @return the list of the Enabled Resource Types.
291+
* @return the list of the Enabled Resource Types as paginated response with {@link PagedIterable}.
288292
*/
289293
@ServiceMethod(returns = ReturnType.COLLECTION)
290294
PagedIterable<EnabledResourceTypeInner> listEnabledResourceTypes(

0 commit comments

Comments
 (0)