Skip to content

Commit adbf1f6

Browse files
author
SDKAuto
committed
CodeGen from PR 28718 in Azure/azure-rest-api-specs
Merge c4d294073a212f95088efddd9bcf32d3e451132c into dd1b1d0a58a10c4a34f55231c7035c80dd09b746
1 parent f01f7f4 commit adbf1f6

File tree

80 files changed

+543
-1894
lines changed

Some content is hidden

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

80 files changed

+543
-1894
lines changed

sdk/storageactions/azure-resourcemanager-storageactions/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 (2024-05-08)
4+
5+
- Azure Resource Manager StorageActions client library for Java. This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. Package tag package-2023-01-01. 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/storageactions/azure-resourcemanager-storageactions/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-storageactions</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/storageactions/azure-resourcemanager-storageactions/SAMPLE.md

Lines changed: 131 additions & 104 deletions
Large diffs are not rendered by default.

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import com.azure.core.http.HttpPipelinePosition;
1212
import com.azure.core.http.policy.AddDatePolicy;
1313
import com.azure.core.http.policy.AddHeadersFromContextPolicy;
14-
import com.azure.core.http.policy.HttpLogOptions;
1514
import com.azure.core.http.policy.HttpLoggingPolicy;
15+
import com.azure.core.http.policy.HttpLogOptions;
1616
import com.azure.core.http.policy.HttpPipelinePolicy;
1717
import com.azure.core.http.policy.HttpPolicyProviders;
1818
import com.azure.core.http.policy.RequestIdPolicy;
@@ -59,8 +59,10 @@ private StorageActionsManager(HttpPipeline httpPipeline, AzureProfile profile, D
5959
Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null.");
6060
Objects.requireNonNull(profile, "'profile' cannot be null.");
6161
this.clientObject = new StorageActionsMgmtClientBuilder().pipeline(httpPipeline)
62-
.endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId())
63-
.defaultPollInterval(defaultPollInterval).buildClient();
62+
.endpoint(profile.getEnvironment().getResourceManagerEndpoint())
63+
.subscriptionId(profile.getSubscriptionId())
64+
.defaultPollInterval(defaultPollInterval)
65+
.buildClient();
6466
}
6567

6668
/**
@@ -211,12 +213,19 @@ public StorageActionsManager authenticate(TokenCredential credential, AzureProfi
211213
Objects.requireNonNull(profile, "'profile' cannot be null.");
212214

213215
StringBuilder userAgentBuilder = new StringBuilder();
214-
userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.storageactions")
215-
.append("/").append("1.0.0-beta.1");
216+
userAgentBuilder.append("azsdk-java")
217+
.append("-")
218+
.append("com.azure.resourcemanager.storageactions")
219+
.append("/")
220+
.append("1.0.0-beta.1");
216221
if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) {
217-
userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version"))
218-
.append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ")
219-
.append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)");
222+
userAgentBuilder.append(" (")
223+
.append(Configuration.getGlobalConfiguration().get("java.version"))
224+
.append("; ")
225+
.append(Configuration.getGlobalConfiguration().get("os.name"))
226+
.append("; ")
227+
.append(Configuration.getGlobalConfiguration().get("os.version"))
228+
.append("; auto-generated)");
220229
} else {
221230
userAgentBuilder.append(" (auto-generated)");
222231
}
@@ -235,18 +244,21 @@ public StorageActionsManager authenticate(TokenCredential credential, AzureProfi
235244
policies.add(new UserAgentPolicy(userAgentBuilder.toString()));
236245
policies.add(new AddHeadersFromContextPolicy());
237246
policies.add(new RequestIdPolicy());
238-
policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
247+
policies.addAll(this.policies.stream()
248+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL)
239249
.collect(Collectors.toList()));
240250
HttpPolicyProviders.addBeforeRetryPolicies(policies);
241251
policies.add(retryPolicy);
242252
policies.add(new AddDatePolicy());
243253
policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0])));
244254
policies.addAll(this.policies.stream()
245-
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList()));
255+
.filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY)
256+
.collect(Collectors.toList()));
246257
HttpPolicyProviders.addAfterRetryPolicies(policies);
247258
policies.add(new HttpLoggingPolicy(httpLogOptions));
248259
HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient)
249-
.policies(policies.toArray(new HttpPipelinePolicy[0])).build();
260+
.policies(policies.toArray(new HttpPipelinePolicy[0]))
261+
.build();
250262
return new StorageActionsManager(httpPipeline, profile, defaultPollInterval);
251263
}
252264
}

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
public interface StorageTaskAssignmentsClient {
1717
/**
18-
* Lists all the storage tasks available under the given resource group.
18+
* Lists Resource IDs of the Storage Task Assignments associated with this Storage Task.
1919
*
2020
* @param resourceGroupName The name of the resource group. The name is case insensitive.
2121
* @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
@@ -29,13 +29,13 @@ public interface StorageTaskAssignmentsClient {
2929
PagedIterable<StorageTaskAssignmentInner> list(String resourceGroupName, String storageTaskName);
3030

3131
/**
32-
* Lists all the storage tasks available under the given resource group.
32+
* Lists Resource IDs of the Storage Task Assignments associated with this Storage Task.
3333
*
3434
* @param resourceGroupName The name of the resource group. The name is case insensitive.
3535
* @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
3636
* be between 3 and 18 characters in length and use numbers and lower-case letters only.
37-
* @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
38-
* list response.
37+
* @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included
38+
* in the list response.
3939
* @param context The context to associate with this operation.
4040
* @throws IllegalArgumentException thrown if parameters fail the validation.
4141
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag
252252
*
253253
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
254254
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
255-
* @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
255+
* @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}.
256256
*/
257257
@ServiceMethod(returns = ReturnType.COLLECTION)
258258
PagedIterable<StorageTaskInner> list();
@@ -264,7 +264,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag
264264
* @throws IllegalArgumentException thrown if parameters fail the validation.
265265
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
266266
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
267-
* @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
267+
* @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}.
268268
*/
269269
@ServiceMethod(returns = ReturnType.COLLECTION)
270270
PagedIterable<StorageTaskInner> list(Context context);
@@ -276,7 +276,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag
276276
* @throws IllegalArgumentException thrown if parameters fail the validation.
277277
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
278278
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
279-
* @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
279+
* @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}.
280280
*/
281281
@ServiceMethod(returns = ReturnType.COLLECTION)
282282
PagedIterable<StorageTaskInner> listByResourceGroup(String resourceGroupName);
@@ -289,7 +289,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag
289289
* @throws IllegalArgumentException thrown if parameters fail the validation.
290290
* @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server.
291291
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
292-
* @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}.
292+
* @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}.
293293
*/
294294
@ServiceMethod(returns = ReturnType.COLLECTION)
295295
PagedIterable<StorageTaskInner> listByResourceGroup(String resourceGroupName, Context context);

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ public interface StorageTasksReportsClient {
3434
* @param resourceGroupName The name of the resource group. The name is case insensitive.
3535
* @param storageTaskName The name of the storage task within the specified resource group. Storage task names must
3636
* be between 3 and 18 characters in length and use numbers and lower-case letters only.
37-
* @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the
38-
* list response.
37+
* @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included
38+
* in the list response.
3939
* @param filter Optional. When specified, it can be used to query using reporting properties.
4040
* @param context The context to associate with this operation.
4141
* @throws IllegalArgumentException thrown if parameters fail the validation.

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,13 @@
1818
@Fluent
1919
public final class OperationInner {
2020
/*
21-
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples:
22-
* "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
21+
* The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action"
2322
*/
2423
@JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY)
2524
private String name;
2625

2726
/*
28-
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for
29-
* ARM/control-plane operations.
27+
* Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations.
3028
*/
3129
@JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY)
3230
private Boolean isDataAction;
@@ -38,8 +36,7 @@ public final class OperationInner {
3836
private OperationDisplay display;
3937

4038
/*
41-
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default
42-
* value is "user,system"
39+
* The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system"
4340
*/
4441
@JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY)
4542
private Origin origin;

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
import com.fasterxml.jackson.annotation.JsonProperty;
99

1010
/**
11-
* Fetch the Storage task assignment ARM ids.
11+
* Storage Task Assignment associated with this Storage Task.
1212
*/
1313
@Immutable
1414
public final class StorageTaskAssignmentInner {
1515
/*
16-
* ARM Id of the storage task assignments, associated with the storage tasks.
16+
* Resource ID of the Storage Task Assignment.
1717
*/
1818
@JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY)
1919
private String id;
@@ -25,7 +25,7 @@ public StorageTaskAssignmentInner() {
2525
}
2626

2727
/**
28-
* Get the id property: ARM Id of the storage task assignments, associated with the storage tasks.
28+
* Get the id property: Resource ID of the Storage Task Assignment.
2929
*
3030
* @return the id value.
3131
*/

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import com.azure.core.annotation.Fluent;
88
import com.azure.core.management.Resource;
99
import com.azure.core.management.SystemData;
10+
import com.azure.core.util.logging.ClientLogger;
1011
import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity;
1112
import com.azure.resourcemanager.storageactions.models.StorageTaskProperties;
1213
import com.fasterxml.jackson.annotation.JsonProperty;
@@ -20,13 +21,13 @@ public final class StorageTaskInner extends Resource {
2021
/*
2122
* The managed service identity of the resource.
2223
*/
23-
@JsonProperty(value = "identity")
24+
@JsonProperty(value = "identity", required = true)
2425
private ManagedServiceIdentity identity;
2526

2627
/*
2728
* Properties of the storage task.
2829
*/
29-
@JsonProperty(value = "properties")
30+
@JsonProperty(value = "properties", required = true)
3031
private StorageTaskProperties properties;
3132

3233
/*
@@ -114,11 +115,19 @@ public StorageTaskInner withTags(Map<String, String> tags) {
114115
* @throws IllegalArgumentException thrown if the instance is not valid.
115116
*/
116117
public void validate() {
117-
if (identity() != null) {
118+
if (identity() == null) {
119+
throw LOGGER.atError()
120+
.log(new IllegalArgumentException("Missing required property identity in model StorageTaskInner"));
121+
} else {
118122
identity().validate();
119123
}
120-
if (properties() != null) {
124+
if (properties() == null) {
125+
throw LOGGER.atError()
126+
.log(new IllegalArgumentException("Missing required property properties in model StorageTaskInner"));
127+
} else {
121128
properties().validate();
122129
}
123130
}
131+
132+
private static final ClientLogger LOGGER = new ClientLogger(StorageTaskInner.class);
124133
}

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,9 @@ public StorageTaskPreviewActionInner withProperties(StorageTaskPreviewActionProp
5353
*/
5454
public void validate() {
5555
if (properties() == null) {
56-
throw LOGGER.logExceptionAsError(new IllegalArgumentException(
57-
"Missing required property properties in model StorageTaskPreviewActionInner"));
56+
throw LOGGER.atError()
57+
.log(new IllegalArgumentException(
58+
"Missing required property properties in model StorageTaskPreviewActionInner"));
5859
} else {
5960
properties().validate();
6061
}

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ public final class OperationsClientImpl implements OperationsClient {
5656
}
5757

5858
/**
59-
* The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service
60-
* to perform REST calls.
59+
* The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service to
60+
* perform REST calls.
6161
*/
6262
@Host("{$host}")
6363
@ServiceInterface(name = "StorageActionsMgmtCl")

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) {
4141
}
4242
}
4343
return null;
44-
4544
}
4645

4746
static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) {
@@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri
7574
}
7675
}
7776
return null;
78-
7977
}
8078

8179
static <T, S> PagedIterable<S> mapPage(PagedIterable<T> pageIterable, Function<T, S> mapper) {

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,13 @@ public StorageActionsMgmtClientBuilder serializerAdapter(SerializerAdapter seria
123123
public StorageActionsMgmtClientImpl buildClient() {
124124
String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com";
125125
AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE;
126-
HttpPipeline localPipeline = (pipeline != null) ? pipeline
126+
HttpPipeline localPipeline = (pipeline != null)
127+
? pipeline
127128
: new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build();
128129
Duration localDefaultPollInterval
129130
= (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30);
130-
SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter
131+
SerializerAdapter localSerializerAdapter = (serializerAdapter != null)
132+
? serializerAdapter
131133
: SerializerFactory.createDefaultManagementSerializerAdapter();
132134
StorageActionsMgmtClientImpl client = new StorageActionsMgmtClientImpl(localPipeline, localSerializerAdapter,
133135
localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint);

sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
package com.azure.resourcemanager.storageactions.implementation;
66

77
import com.azure.core.annotation.ServiceClient;
8+
import com.azure.core.http.HttpHeaderName;
89
import com.azure.core.http.HttpHeaders;
910
import com.azure.core.http.HttpPipeline;
1011
import com.azure.core.http.HttpResponse;
1112
import com.azure.core.http.rest.Response;
1213
import com.azure.core.management.AzureEnvironment;
1314
import com.azure.core.management.exception.ManagementError;
1415
import com.azure.core.management.exception.ManagementException;
15-
import com.azure.core.management.polling.PollResult;
1616
import com.azure.core.management.polling.PollerFactory;
17+
import com.azure.core.management.polling.PollResult;
1718
import com.azure.core.util.Context;
1819
import com.azure.core.util.CoreUtils;
1920
import com.azure.core.util.logging.ClientLogger;
@@ -265,8 +266,8 @@ public <T, U> Mono<U> getLroFinalResultOrError(AsyncPollResponse<PollResult<T>,
265266
if (errorBody != null) {
266267
// try to deserialize error body to ManagementError
267268
try {
268-
managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class,
269-
SerializerEncoding.JSON);
269+
managementError = this.getSerializerAdapter()
270+
.deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON);
270271
if (managementError.getCode() == null || managementError.getMessage() == null) {
271272
managementError = null;
272273
}
@@ -307,7 +308,7 @@ public int getStatusCode() {
307308
}
308309

309310
public String getHeaderValue(String s) {
310-
return httpHeaders.getValue(s);
311+
return httpHeaders.getValue(HttpHeaderName.fromString(s));
311312
}
312313

313314
public HttpHeaders getHeaders() {

0 commit comments

Comments
 (0)