diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md index 00e7e9fde2ac..82d7db7f0b1e 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md @@ -1,6 +1,8 @@ # Release History -## 1.0.0-beta.2 (Unreleased) +## 1.0.0-beta.1 (2024-05-08) + +- 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). ### Features Added diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/README.md b/sdk/storageactions/azure-resourcemanager-storageactions/README.md index 27700ca8178a..2a27540c4abc 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/README.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/README.md @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-storageactions - 1.0.0-beta.1 + 1.0.0-beta.2 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md index dfca5159334b..9fdae5ce2914 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md @@ -30,9 +30,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * OperationsList.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/OperationsList.json */ /** * Sample code: OperationsList. @@ -53,9 +51,7 @@ public final class OperationsListSamples { */ public final class StorageTaskAssignmentListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTaskAssignmentIds.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTaskAssignmentIds.json */ /** * Sample code: ListStorageTaskAssignmentsByResourceGroup. @@ -74,6 +70,8 @@ public final class StorageTaskAssignmentListSamples { ```java import com.azure.resourcemanager.storageactions.models.ElseCondition; import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; import com.azure.resourcemanager.storageactions.models.OnFailure; import com.azure.resourcemanager.storageactions.models.OnSuccess; import com.azure.resourcemanager.storageactions.models.StorageTaskAction; @@ -89,9 +87,7 @@ import java.util.Map; */ public final class StorageTasksCreateSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PutStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PutStorageTask.json */ /** * Sample code: PutStorageTask. @@ -99,16 +95,25 @@ public final class StorageTasksCreateSamples { * @param manager Entry point to StorageActionsManager. */ public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().define("mytask1").withRegion("westus").withExistingResourceGroup("res4228") - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") - .withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + manager.storageTasks() + .define("mytask1") + .withRegion("westus") + .withExistingResourceGroup("res4228") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new StorageTaskProperties().withEnabled(true) + .withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays + .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))))) .create(); } @@ -134,9 +139,7 @@ public final class StorageTasksCreateSamples { */ public final class StorageTasksDeleteSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/DeleteStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/DeleteStorageTask.json */ /** * Sample code: DeleteStorageTask. @@ -157,9 +160,7 @@ public final class StorageTasksDeleteSamples { */ public final class StorageTasksGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/GetStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/GetStorageTask.json */ /** * Sample code: GetStorageTask. @@ -180,9 +181,7 @@ public final class StorageTasksGetByResourceGroupSamples { */ public final class StorageTasksListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksBySubscription.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksBySubscription.json */ /** * Sample code: ListStorageTasksBySubscription. @@ -204,9 +203,7 @@ public final class StorageTasksListSamples { */ public final class StorageTasksListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksByResourceGroup.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksByResourceGroup.json */ /** * Sample code: ListStorageTasksByResourceGroup. @@ -237,9 +234,7 @@ import java.util.Arrays; */ public final class StorageTasksPreviewActionsSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * PerformStorageTaskActionsPreview.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/PerformStorageTaskActionsPreview.json */ /** * Sample code: PerformStorageTaskActionsPreview. @@ -248,60 +243,83 @@ public final class StorageTasksPreviewActionsSamples { */ public static void performStorageTaskActionsPreview(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().previewActionsWithResponse("eastus", - new StorageTaskPreviewActionInner().withProperties(new StorageTaskPreviewActionProperties() - .withContainer(new StorageTaskPreviewContainerProperties().withName("firstContainer") - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mContainerValue1")))) - .withBlobs(Arrays.asList( - new StorageTaskPreviewBlobProperties().withName("folder1/file1.txt").withProperties(Arrays.asList( - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("0x8DB67175454D36D"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("38619"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("text/xml"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("njr6iDrmU9+FC89WMK22EA=="), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("BlockBlob"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("Hot"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("unlocked"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("available"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("1"))) - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mValue1"))) - .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("tValue1"))), - new StorageTaskPreviewBlobProperties().withName("folder2/file1.txt") - .withProperties(Arrays.asList( - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("0x6FB67175454D36D"))) - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mValue2"))) - .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("tValue2"))))) - .withAction(new StorageTaskPreviewActionCondition() - .withIfProperty( - new StorageTaskPreviewActionIfCondition().withCondition("[[equals(AccessTier, 'Hot')]]")) - .withElseBlockExists(true))), - com.azure.core.util.Context.NONE); + manager.storageTasks() + .previewActionsWithResponse("eastus", + new StorageTaskPreviewActionInner() + .withProperties( + new StorageTaskPreviewActionProperties() + .withContainer( + new StorageTaskPreviewContainerProperties().withName("firstContainer") + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue("mContainerValue1")))) + .withBlobs(Arrays.asList(new StorageTaskPreviewBlobProperties() + .withName("folder1/file1.txt") + .withProperties(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x8DB67175454D36D"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("38619"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("text/xml"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("njr6iDrmU9+FC89WMK22EA=="), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("BlockBlob"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Hot"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("unlocked"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("available"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("1"))) + .withMetadata(Arrays + .asList(new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("mValue1"))) + .withTags(Arrays + .asList(new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("tValue1"))), + new StorageTaskPreviewBlobProperties() + .withName("folder2/file1.txt") + .withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x6FB67175454D36D"))) + .withMetadata(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("mValue2"))) + .withTags(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("tValue2"))))) + .withAction(new StorageTaskPreviewActionCondition() + .withIfProperty(new StorageTaskPreviewActionIfCondition() + .withCondition("[[equals(AccessTier, 'Hot')]]")) + .withElseBlockExists(true))), + com.azure.core.util.Context.NONE); } } ``` @@ -311,6 +329,8 @@ public final class StorageTasksPreviewActionsSamples { ```java import com.azure.resourcemanager.storageactions.models.ElseCondition; import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; import com.azure.resourcemanager.storageactions.models.OnFailure; import com.azure.resourcemanager.storageactions.models.OnSuccess; import com.azure.resourcemanager.storageactions.models.StorageTask; @@ -318,6 +338,7 @@ import com.azure.resourcemanager.storageactions.models.StorageTaskAction; import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -327,9 +348,7 @@ import java.util.Map; */ public final class StorageTasksUpdateSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PatchStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PatchStorageTask.json */ /** * Sample code: PatchStorageTask. @@ -338,17 +357,27 @@ public final class StorageTasksUpdateSamples { */ public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { StorageTask resource = manager.storageTasks() - .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE) + .getValue(); resource.update() - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") - .withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity", + new UserAssignedIdentity()))) + .withProperties( + new StorageTaskProperties().withEnabled(true) + .withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays + .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))))) .apply(); } @@ -374,9 +403,7 @@ public final class StorageTasksUpdateSamples { */ public final class StorageTasksReportListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksRunReportSummary.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksRunReportSummary.json */ /** * Sample code: ListStorageTasksByResourceGroup. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java index a27853009f26..4d3a2f08390c 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/StorageActionsManager.java @@ -11,8 +11,8 @@ 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.HttpLogOptions; import com.azure.core.http.policy.HttpPipelinePolicy; import com.azure.core.http.policy.HttpPolicyProviders; import com.azure.core.http.policy.RequestIdPolicy; @@ -59,8 +59,10 @@ private StorageActionsManager(HttpPipeline httpPipeline, AzureProfile profile, D Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); this.clientObject = new StorageActionsMgmtClientBuilder().pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()).subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval).buildClient(); + .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) + .subscriptionId(profile.getSubscriptionId()) + .defaultPollInterval(defaultPollInterval) + .buildClient(); } /** @@ -211,12 +213,19 @@ public StorageActionsManager authenticate(TokenCredential credential, AzureProfi Objects.requireNonNull(profile, "'profile' cannot be null."); StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder.append("azsdk-java").append("-").append("com.azure.resourcemanager.storageactions") - .append("/").append("1.0.0-beta.1"); + userAgentBuilder.append("azsdk-java") + .append("-") + .append("com.azure.resourcemanager.storageactions") + .append("/") + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder.append(" (").append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ").append(Configuration.getGlobalConfiguration().get("os.name")).append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")).append("; auto-generated)"); + userAgentBuilder.append(" (") + .append(Configuration.getGlobalConfiguration().get("java.version")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.name")) + .append("; ") + .append(Configuration.getGlobalConfiguration().get("os.version")) + .append("; auto-generated)"); } else { userAgentBuilder.append(" (auto-generated)"); } @@ -235,18 +244,21 @@ public StorageActionsManager authenticate(TokenCredential credential, AzureProfi policies.add(new UserAgentPolicy(userAgentBuilder.toString())); policies.add(new AddHeadersFromContextPolicy()); policies.add(new RequestIdPolicy()); - policies.addAll(this.policies.stream().filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) + policies.addAll(this.policies.stream() + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) .collect(Collectors.toList())); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(retryPolicy); policies.add(new AddDatePolicy()); policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); policies.addAll(this.policies.stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY).collect(Collectors.toList())); + .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) + .collect(Collectors.toList())); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); + .policies(policies.toArray(new HttpPipelinePolicy[0])) + .build(); return new StorageActionsManager(httpPipeline, profile, defaultPollInterval); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java index 66617b5fe35e..6325e16e3c1b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java @@ -15,7 +15,7 @@ */ public interface StorageTaskAssignmentsClient { /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must @@ -29,13 +29,13 @@ public interface StorageTaskAssignmentsClient { PagedIterable list(String resourceGroupName, String storageTaskName); /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java index 02c8611c92c5..cf2344edb832 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksClient.java @@ -252,7 +252,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(); @@ -264,7 +264,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); @@ -276,7 +276,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName); @@ -289,7 +289,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java index 659e9de56718..6d587f2ddd5d 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java @@ -34,8 +34,8 @@ public interface StorageTasksReportsClient { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java index 3ec0341cd4d5..2daffb0ac676 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/OperationInner.java @@ -18,15 +18,13 @@ @Fluent public final class OperationInner { /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" */ @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) private String name; /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. + * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. */ @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) private Boolean isDataAction; @@ -38,8 +36,7 @@ public final class OperationInner { private OperationDisplay display; /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" + * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system" */ @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) private Origin origin; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java index 72a68b8e80ac..05af74b1ad59 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskAssignmentInner.java @@ -8,12 +8,12 @@ import com.fasterxml.jackson.annotation.JsonProperty; /** - * Fetch the Storage task assignment ARM ids. + * Storage Task Assignment associated with this Storage Task. */ @Immutable public final class StorageTaskAssignmentInner { /* - * ARM Id of the storage task assignments, associated with the storage tasks. + * Resource ID of the Storage Task Assignment. */ @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) private String id; @@ -25,7 +25,7 @@ public StorageTaskAssignmentInner() { } /** - * Get the id property: ARM Id of the storage task assignments, associated with the storage tasks. + * Get the id property: Resource ID of the Storage Task Assignment. * * @return the id value. */ diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java index d5a6d0f80e43..6c53af36ad78 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskInner.java @@ -7,6 +7,7 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; import com.fasterxml.jackson.annotation.JsonProperty; @@ -20,13 +21,13 @@ public final class StorageTaskInner extends Resource { /* * The managed service identity of the resource. */ - @JsonProperty(value = "identity") + @JsonProperty(value = "identity", required = true) private ManagedServiceIdentity identity; /* * Properties of the storage task. */ - @JsonProperty(value = "properties") + @JsonProperty(value = "properties", required = true) private StorageTaskProperties properties; /* @@ -114,11 +115,19 @@ public StorageTaskInner withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (identity() != null) { + if (identity() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property identity in model StorageTaskInner")); + } else { identity().validate(); } - if (properties() != null) { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model StorageTaskInner")); + } else { properties().validate(); } } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTaskInner.class); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java index 074be25822de..2ba1dd10bf7f 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionInner.java @@ -53,8 +53,9 @@ public StorageTaskPreviewActionInner withProperties(StorageTaskPreviewActionProp */ public void validate() { if (properties() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property properties in model StorageTaskPreviewActionInner")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model StorageTaskPreviewActionInner")); } else { properties().validate(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java index c492e74f9672..2cae11d3a186 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsClientImpl.java @@ -56,8 +56,8 @@ public final class OperationsClientImpl implements OperationsClient { } /** - * The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service to + * perform REST calls. */ @Host("{$host}") @ServiceInterface(name = "StorageActionsMgmtCl") diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java index a2a1d6eff9bd..5ce8a09099f3 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/ResourceManagerUtils.java @@ -41,7 +41,6 @@ static String getValueFromIdByName(String id, String name) { } } return null; - } static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { @@ -75,7 +74,6 @@ static String getValueFromIdByParameterName(String id, String pathTemplate, Stri } } return null; - } static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java index e25e23d93595..451e9efb2239 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java @@ -123,11 +123,13 @@ public StorageActionsMgmtClientBuilder serializerAdapter(SerializerAdapter seria public StorageActionsMgmtClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = (pipeline != null) ? pipeline + HttpPipeline localPipeline = (pipeline != null) + ? pipeline : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); Duration localDefaultPollInterval = (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter + SerializerAdapter localSerializerAdapter = (serializerAdapter != null) + ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); StorageActionsMgmtClientImpl client = new StorageActionsMgmtClientImpl(localPipeline, localSerializerAdapter, localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java index c912f2df07e6..8bba60b3e0e2 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java @@ -5,6 +5,7 @@ package com.azure.resourcemanager.storageactions.implementation; import com.azure.core.annotation.ServiceClient; +import com.azure.core.http.HttpHeaderName; import com.azure.core.http.HttpHeaders; import com.azure.core.http.HttpPipeline; import com.azure.core.http.HttpResponse; @@ -12,8 +13,8 @@ import com.azure.core.management.AzureEnvironment; import com.azure.core.management.exception.ManagementError; import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; import com.azure.core.management.polling.PollerFactory; +import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; @@ -265,8 +266,8 @@ public Mono getLroFinalResultOrError(AsyncPollResponse, if (errorBody != null) { // try to deserialize error body to ManagementError try { - managementError = this.getSerializerAdapter().deserialize(errorBody, ManagementError.class, - SerializerEncoding.JSON); + managementError = this.getSerializerAdapter() + .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); if (managementError.getCode() == null || managementError.getMessage() == null) { managementError = null; } @@ -307,7 +308,7 @@ public int getStatusCode() { } public String getHeaderValue(String s) { - return httpHeaders.getValue(s); + return httpHeaders.getValue(HttpHeaderName.fromString(s)); } public HttpHeaders getHeaders() { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java index e2278b82f4a6..7602dd1b9057 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java @@ -82,13 +82,13 @@ Mono> listNext( } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -124,13 +124,13 @@ private Mono> listSinglePageAsync(Stri } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -167,13 +167,13 @@ private Mono> listSinglePageAsync(Stri } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -187,7 +187,7 @@ private PagedFlux listAsync(String resourceGroupName } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must @@ -205,13 +205,13 @@ private PagedFlux listAsync(String resourceGroupName } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -226,7 +226,7 @@ private PagedFlux listAsync(String resourceGroupName } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must @@ -243,13 +243,13 @@ public PagedIterable list(String resourceGroupName, } /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java index de6f6a9f1079..a749eedb6859 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskImpl.java @@ -89,14 +89,16 @@ public StorageTaskImpl withExistingResourceGroup(String resourceGroupName) { } public StorageTask create() { - this.innerObject = serviceManager.serviceClient().getStorageTasks().create(resourceGroupName, storageTaskName, - this.innerModel(), Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .create(resourceGroupName, storageTaskName, this.innerModel(), Context.NONE); return this; } public StorageTask create(Context context) { - this.innerObject = serviceManager.serviceClient().getStorageTasks().create(resourceGroupName, storageTaskName, - this.innerModel(), context); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .create(resourceGroupName, storageTaskName, this.innerModel(), context); return this; } @@ -112,14 +114,16 @@ public StorageTaskImpl update() { } public StorageTask apply() { - this.innerObject = serviceManager.serviceClient().getStorageTasks().update(resourceGroupName, storageTaskName, - updateParameters, Context.NONE); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .update(resourceGroupName, storageTaskName, updateParameters, Context.NONE); return this; } public StorageTask apply(Context context) { - this.innerObject = serviceManager.serviceClient().getStorageTasks().update(resourceGroupName, storageTaskName, - updateParameters, context); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .update(resourceGroupName, storageTaskName, updateParameters, context); return this; } @@ -132,14 +136,18 @@ public StorageTask apply(Context context) { } public StorageTask refresh() { - this.innerObject = serviceManager.serviceClient().getStorageTasks() - .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue(); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE) + .getValue(); return this; } public StorageTask refresh(Context context) { - this.innerObject = serviceManager.serviceClient().getStorageTasks() - .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context).getValue(); + this.innerObject = serviceManager.serviceClient() + .getStorageTasks() + .getByResourceGroupWithResponse(resourceGroupName, storageTaskName, context) + .getValue(); return this; } @@ -153,32 +161,32 @@ public StorageTaskImpl withRegion(String location) { return this; } - public StorageTaskImpl withTags(Map tags) { + public StorageTaskImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { - this.innerModel().withTags(tags); + this.innerModel().withIdentity(identity); return this; } else { - this.updateParameters.withTags(tags); + this.updateParameters.withIdentity(identity); return this; } } - public StorageTaskImpl withIdentity(ManagedServiceIdentity identity) { + public StorageTaskImpl withProperties(StorageTaskProperties properties) { if (isInCreateMode()) { - this.innerModel().withIdentity(identity); + this.innerModel().withProperties(properties); return this; } else { - this.updateParameters.withIdentity(identity); + this.updateParameters.withProperties(properties); return this; } } - public StorageTaskImpl withProperties(StorageTaskProperties properties) { + public StorageTaskImpl withTags(Map tags) { if (isInCreateMode()) { - this.innerModel().withProperties(properties); + this.innerModel().withTags(tags); return this; } else { - this.updateParameters.withProperties(properties); + this.updateParameters.withTags(tags); return this; } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java index 7262654f5929..3499ebc68d9e 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksClientImpl.java @@ -36,8 +36,8 @@ import com.azure.resourcemanager.storageactions.fluent.StorageTasksClient; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; +import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -1012,7 +1012,7 @@ public StorageTaskInner update(String resourceGroupName, String storageTaskName, * * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1041,7 +1041,7 @@ private Mono> listSinglePageAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1068,7 +1068,7 @@ private Mono> listSinglePageAsync(Context contex * * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync() { @@ -1083,7 +1083,7 @@ private PagedFlux listAsync() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { @@ -1096,7 +1096,7 @@ private PagedFlux listAsync(Context context) { * * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { @@ -1110,7 +1110,7 @@ public PagedIterable list() { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { @@ -1124,7 +1124,7 @@ public PagedIterable list(Context context) { * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1158,7 +1158,7 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1192,7 +1192,7 @@ private Mono> listByResourceGroupSinglePageAsync * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName) { @@ -1208,7 +1208,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { @@ -1223,7 +1223,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGrou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -1238,7 +1238,7 @@ public PagedIterable listByResourceGroup(String resourceGroupN * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { @@ -1374,7 +1374,7 @@ public StorageTaskPreviewActionInner previewActions(String location, StorageTask * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1405,7 +1405,7 @@ private Mono> listBySubscriptionNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1434,7 +1434,7 @@ private Mono> listBySubscriptionNextSinglePageAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -1465,7 +1465,7 @@ private Mono> listByResourceGroupNextSinglePageA * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws 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 from the List Storage Tasks operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java index a4e5f968c98c..162b4d2646e1 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java @@ -87,8 +87,8 @@ Mono> listNext( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -130,8 +130,8 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -174,8 +174,8 @@ private Mono> listSinglePageAsync( * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -214,8 +214,8 @@ private PagedFlux listAsync(String resourceGroup * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -255,8 +255,8 @@ public PagedIterable list(String resourceGroupNa * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java index 4b0c596d8e0e..ca91a469f17a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ElseCondition.java @@ -53,8 +53,8 @@ public ElseCondition withOperations(List operations) { */ public void validate() { if (operations() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property operations in model ElseCondition")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operations in model ElseCondition")); } else { operations().forEach(e -> e.validate()); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java index a363a3639871..e43a9388f10a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/IfCondition.java @@ -15,7 +15,7 @@ @Fluent public final class IfCondition { /* - * The condition predicate which is composed of object properties, eg: blob and container properties. + * Condition predicate to evaluate each object. See https://aka.ms/storagetaskconditions for valid properties and operators. */ @JsonProperty(value = "condition", required = true) private String condition; @@ -33,8 +33,8 @@ public IfCondition() { } /** - * Get the condition property: The condition predicate which is composed of object properties, eg: blob and - * container properties. + * Get the condition property: Condition predicate to evaluate each object. See https://aka.ms/storagetaskconditions + * for valid properties and operators. * * @return the condition value. */ @@ -43,8 +43,8 @@ public String condition() { } /** - * Set the condition property: The condition predicate which is composed of object properties, eg: blob and - * container properties. + * Set the condition property: Condition predicate to evaluate each object. See https://aka.ms/storagetaskconditions + * for valid properties and operators. * * @param condition the condition value to set. * @return the IfCondition object itself. @@ -81,12 +81,12 @@ public IfCondition withOperations(List operations) { */ public void validate() { if (condition() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property condition in model IfCondition")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property condition in model IfCondition")); } if (operations() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property operations in model IfCondition")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property operations in model IfCondition")); } else { operations().forEach(e -> e.validate()); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java index 15812da9a726..98c5fa778899 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentity.java @@ -17,15 +17,13 @@ @Fluent public final class ManagedServiceIdentity { /* - * The service principal ID of the system assigned identity. This property will only be provided for a system - * assigned identity. + * The service principal ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) private UUID principalId; /* - * The tenant ID of the system assigned identity. This property will only be provided for a system assigned - * identity. + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned identity. */ @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) private UUID tenantId; @@ -37,11 +35,7 @@ public final class ManagedServiceIdentity { private ManagedServiceIdentityType type; /* - * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys - * will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName}. - * The dictionary values can be empty objects ({}) in requests. + * The set of user assigned identities associated with the resource. The userAssignedIdentities dictionary keys will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}. The dictionary values can be empty objects ({}) in requests. */ @JsonProperty(value = "userAssignedIdentities") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -64,8 +58,8 @@ public UUID principalId() { } /** - * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided - * for a system assigned identity. + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. * * @return the tenantId value. */ @@ -128,8 +122,8 @@ public ManagedServiceIdentity withUserAssignedIdentities(Map { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java index d47e35ef4b9c..8f281f5b1530 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationDisplay.java @@ -13,22 +13,19 @@ @Immutable public final class OperationDisplay { /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". + * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". */ @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) private String provider; /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". + * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". */ @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) private String resource; /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". + * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". */ @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) private String operation; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java index 09ade72575cc..9ef8e302bd76 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java @@ -10,8 +10,8 @@ import java.util.List; /** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set - * of results. + * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of + * results. */ @Immutable public final class OperationListResult { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java index bb98ddc311bf..839975b2fe84 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTask.java @@ -101,8 +101,9 @@ public interface StorageTask { /** * The entirety of the StorageTask definition. */ - interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, DefinitionStages.WithCreate { + interface Definition + extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, + DefinitionStages.WithIdentity, DefinitionStages.WithProperties, DefinitionStages.WithCreate { } /** @@ -146,15 +147,40 @@ interface WithResourceGroup { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ - WithCreate withExistingResourceGroup(String resourceGroupName); + WithIdentity withExistingResourceGroup(String resourceGroupName); + } + + /** + * The stage of the StorageTask definition allowing to specify identity. + */ + interface WithIdentity { + /** + * Specifies the identity property: The managed service identity of the resource.. + * + * @param identity The managed service identity of the resource. + * @return the next definition stage. + */ + WithProperties withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the StorageTask definition allowing to specify properties. + */ + interface WithProperties { + /** + * Specifies the properties property: Properties of the storage task.. + * + * @param properties Properties of the storage task. + * @return the next definition stage. + */ + WithCreate withProperties(StorageTaskProperties properties); } /** * The stage of the StorageTask definition which contains all the minimum required properties for the resource * to be created, but also allows for any other optional properties to be specified. */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithProperties { + interface WithCreate extends DefinitionStages.WithTags { /** * Executes the create request. * @@ -183,32 +209,6 @@ interface WithTags { */ WithCreate withTags(Map tags); } - - /** - * The stage of the StorageTask definition allowing to specify identity. - */ - interface WithIdentity { - /** - * Specifies the identity property: The managed service identity of the resource.. - * - * @param identity The managed service identity of the resource. - * @return the next definition stage. - */ - WithCreate withIdentity(ManagedServiceIdentity identity); - } - - /** - * The stage of the StorageTask definition allowing to specify properties. - */ - interface WithProperties { - /** - * Specifies the properties property: Properties of the storage task.. - * - * @param properties Properties of the storage task. - * @return the next definition stage. - */ - WithCreate withProperties(StorageTaskProperties properties); - } } /** diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java index 9e38d0608b2f..d2ba4ca7b3b6 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAction.java @@ -78,8 +78,8 @@ public StorageTaskAction withElseProperty(ElseCondition elseProperty) { */ public void validate() { if (ifProperty() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property ifProperty in model StorageTaskAction")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property ifProperty in model StorageTaskAction")); } else { ifProperty().validate(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java index e3d0222bbe03..7ea06740666f 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignment.java @@ -11,7 +11,7 @@ */ public interface StorageTaskAssignment { /** - * Gets the id property: ARM Id of the storage task assignments, associated with the storage tasks. + * Gets the id property: Resource ID of the Storage Task Assignment. * * @return the id value. */ diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java index 8f3f3c0f37af..3e0df45ed3a5 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.java @@ -12,7 +12,7 @@ */ public interface StorageTaskAssignments { /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must @@ -25,13 +25,13 @@ public interface StorageTaskAssignments { PagedIterable list(String resourceGroupName, String storageTaskName); /** - * Lists all the storage tasks available under the given resource group. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java index 9b57951dfc87..272e0798ff30 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java @@ -15,14 +15,13 @@ @Immutable public final class StorageTaskAssignmentsListResult { /* - * Gets the list of storage task assignment Ids. + * List of Storage Task Assignment Resource IDs associated with this Storage Task. */ @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) private List value; /* - * Request URL that can be used to query next page of storage task assignment Ids. Returned when total number of - * requested storage task assignment Ids exceed maximum page size. + * Request URL that can be used to query next page of Resource IDs. Returned when total number of requested Resource IDs exceed maximum page size. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; @@ -34,7 +33,7 @@ public StorageTaskAssignmentsListResult() { } /** - * Get the value property: Gets the list of storage task assignment Ids. + * Get the value property: List of Storage Task Assignment Resource IDs associated with this Storage Task. * * @return the value value. */ @@ -43,8 +42,8 @@ public List value() { } /** - * Get the nextLink property: Request URL that can be used to query next page of storage task assignment Ids. - * Returned when total number of requested storage task assignment Ids exceed maximum page size. + * Get the nextLink property: Request URL that can be used to query next page of Resource IDs. Returned when total + * number of requested Resource IDs exceed maximum page size. * * @return the nextLink value. */ diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java index ade8765e6246..10e47e771c0c 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperation.java @@ -133,8 +133,8 @@ public StorageTaskOperation withOnFailure(OnFailure onFailure) { */ public void validate() { if (name() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property name in model StorageTaskOperation")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property name in model StorageTaskOperation")); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java index c24a0c0e8a93..e28bb1f3b969 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionCondition.java @@ -78,8 +78,9 @@ public StorageTaskPreviewActionCondition withElseBlockExists(boolean elseBlockEx */ public void validate() { if (ifProperty() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property ifProperty in model StorageTaskPreviewActionCondition")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property ifProperty in model StorageTaskPreviewActionCondition")); } else { ifProperty().validate(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java index 65d29098cb04..3e141ccbfaea 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java @@ -15,19 +15,19 @@ @Fluent public final class StorageTaskPreviewActionProperties { /* - * Preview action container properties to be tested for a match with the provided condition. + * Properties of a sample container to test for a match with the preview action. */ @JsonProperty(value = "container", required = true) private StorageTaskPreviewContainerProperties container; /* - * Preview action container properties to be tested for a match with the provided condition. + * Properties of some sample blobs in the container to test for matches with the preview action. */ @JsonProperty(value = "blobs", required = true) private List blobs; /* - * Preview action container properties to be tested for a match with the provided condition. + * Preview action to test */ @JsonProperty(value = "action", required = true) private StorageTaskPreviewActionCondition action; @@ -39,8 +39,7 @@ public StorageTaskPreviewActionProperties() { } /** - * Get the container property: Preview action container properties to be tested for a match with the provided - * condition. + * Get the container property: Properties of a sample container to test for a match with the preview action. * * @return the container value. */ @@ -49,8 +48,7 @@ public StorageTaskPreviewContainerProperties container() { } /** - * Set the container property: Preview action container properties to be tested for a match with the provided - * condition. + * Set the container property: Properties of a sample container to test for a match with the preview action. * * @param container the container value to set. * @return the StorageTaskPreviewActionProperties object itself. @@ -61,8 +59,8 @@ public StorageTaskPreviewActionProperties withContainer(StorageTaskPreviewContai } /** - * Get the blobs property: Preview action container properties to be tested for a match with the provided - * condition. + * Get the blobs property: Properties of some sample blobs in the container to test for matches with the preview + * action. * * @return the blobs value. */ @@ -71,8 +69,8 @@ public List blobs() { } /** - * Set the blobs property: Preview action container properties to be tested for a match with the provided - * condition. + * Set the blobs property: Properties of some sample blobs in the container to test for matches with the preview + * action. * * @param blobs the blobs value to set. * @return the StorageTaskPreviewActionProperties object itself. @@ -83,8 +81,7 @@ public StorageTaskPreviewActionProperties withBlobs(List e.validate()); } if (action() == null) { - throw LOGGER.logExceptionAsError(new IllegalArgumentException( - "Missing required property action in model StorageTaskPreviewActionProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property action in model StorageTaskPreviewActionProperties")); } else { action().validate(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java index e669ae71b386..6bae3d2edf5d 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewBlobProperties.java @@ -14,7 +14,7 @@ @Fluent public final class StorageTaskPreviewBlobProperties { /* - * property for the container name. + * Name of test blob */ @JsonProperty(value = "name") private String name; @@ -50,7 +50,7 @@ public StorageTaskPreviewBlobProperties() { } /** - * Get the name property: property for the container name. + * Get the name property: Name of test blob. * * @return the name value. */ @@ -59,7 +59,7 @@ public String name() { } /** - * Set the name property: property for the container name. + * Set the name property: Name of test blob. * * @param name the name value to set. * @return the StorageTaskPreviewBlobProperties object itself. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java index e413c4ce65f5..febbebe891dd 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewContainerProperties.java @@ -14,7 +14,7 @@ @Fluent public final class StorageTaskPreviewContainerProperties { /* - * property for the container name. + * Name of test container */ @JsonProperty(value = "name") private String name; @@ -32,7 +32,7 @@ public StorageTaskPreviewContainerProperties() { } /** - * Get the name property: property for the container name. + * Get the name property: Name of test container. * * @return the name value. */ @@ -41,7 +41,7 @@ public String name() { } /** - * Set the name property: property for the container name. + * Set the name property: Name of test container. * * @param name the name value to set. * @return the StorageTaskPreviewContainerProperties object itself. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java index 915a4097a95a..069834e09472 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java @@ -150,12 +150,13 @@ public OffsetDateTime creationTimeInUtc() { */ public void validate() { if (description() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property description in model StorageTaskProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property description in model StorageTaskProperties")); } if (action() == null) { - throw LOGGER.logExceptionAsError( - new IllegalArgumentException("Missing required property action in model StorageTaskProperties")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property action in model StorageTaskProperties")); } else { action().validate(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java index 683a6ea0d503..708ce133becf 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportProperties.java @@ -13,69 +13,49 @@ @Immutable public final class StorageTaskReportProperties { /* - * Represents the Storage Task Assignment Id associated with the storage task that provided an execution context. + * Resource ID of the Storage Task Assignment associated with this reported run. */ @JsonProperty(value = "taskAssignmentId", access = JsonProperty.Access.WRITE_ONLY) private String taskAssignmentId; /* - * Represents the Storage Account Id where the storage task definition was applied and executed. + * Resource ID of the Storage Account where this reported run executed. */ @JsonProperty(value = "storageAccountId", access = JsonProperty.Access.WRITE_ONLY) private String storageAccountId; /* - * Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other - * comparison operators can be used as described for DateTime properties in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * Start time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) private String startTime; /* - * End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other - * comparison operators can be used as described for DateTime properties in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * End time of the run instance. Filter options such as startTime gt '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "finishTime", access = JsonProperty.Access.WRITE_ONLY) private String finishTime; /* - * Total number of objects that meet the condition as defined in the storage task assignment execution context. - * Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for - * Numerical properties in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * Total number of objects that meet the condition as defined in the storage task assignment execution context. Filter options such as objectsTargetedCount gt 50 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "objectsTargetedCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsTargetedCount; /* - * Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as - * objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties - * in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * Total number of objects that meet the storage tasks condition and were operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "objectsOperatedOnCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsOperatedOnCount; /* - * Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount - * eq 0 and other comparison operators can be used as described for Numerical properties in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * Total number of objects where task operation failed when was attempted. Filter options such as objectFailedCount eq 0 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "objectFailedCount", access = JsonProperty.Access.WRITE_ONLY) private String objectFailedCount; /* - * Total number of objects where task operation succeeded when was attempted.Filter options such as - * objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in - * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison- - * operators + * Total number of objects where task operation succeeded when was attempted.Filter options such as objectsSucceededCount gt 150 and other comparison operators can be used as described for Numerical properties in https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators */ @JsonProperty(value = "objectsSucceededCount", access = JsonProperty.Access.WRITE_ONLY) private String objectsSucceededCount; @@ -93,14 +73,13 @@ public final class StorageTaskReportProperties { private RunStatusEnum runStatusEnum; /* - * Full path to the verbose report stored in the reporting container as specified in the assignment execution - * context for the storage account. + * Full path to the verbose report stored in the reporting container as specified in the assignment execution context for the storage account. */ @JsonProperty(value = "summaryReportPath", access = JsonProperty.Access.WRITE_ONLY) private String summaryReportPath; /* - * Storage Task Arm Id. + * Resource ID of the Storage Task applied during this run. */ @JsonProperty(value = "taskId", access = JsonProperty.Access.WRITE_ONLY) private String taskId; @@ -124,8 +103,7 @@ public StorageTaskReportProperties() { } /** - * Get the taskAssignmentId property: Represents the Storage Task Assignment Id associated with the storage task - * that provided an execution context. + * Get the taskAssignmentId property: Resource ID of the Storage Task Assignment associated with this reported run. * * @return the taskAssignmentId value. */ @@ -134,8 +112,7 @@ public String taskAssignmentId() { } /** - * Get the storageAccountId property: Represents the Storage Account Id where the storage task definition was - * applied and executed. + * Get the storageAccountId property: Resource ID of the Storage Account where this reported run executed. * * @return the storageAccountId value. */ @@ -145,8 +122,7 @@ public String storageAccountId() { /** * Get the startTime property: Start time of the run instance. Filter options such as startTime gt - * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties - * in + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. * * @return the startTime value. @@ -157,8 +133,7 @@ public String startTime() { /** * Get the finishTime property: End time of the run instance. Filter options such as startTime gt - * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties - * in + * '2023-06-26T20:51:24.4494016Z' and other comparison operators can be used as described for DateTime properties in * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. * * @return the finishTime value. @@ -181,8 +156,8 @@ public String objectsTargetedCount() { /** * Get the objectsOperatedOnCount property: Total number of objects that meet the storage tasks condition and were - * operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used - * as described for Numerical properties in + * operated upon. Filter options such as objectsOperatedOnCount ge 100 and other comparison operators can be used as + * described for Numerical properties in * https://learn.microsoft.com/en-us/rest/api/storageservices/querying-tables-and-entities#supported-comparison-operators. * * @return the objectsOperatedOnCount value. @@ -216,8 +191,8 @@ public String objectsSucceededCount() { } /** - * Get the runStatusError property: Well known Azure Storage error code that represents the error encountered - * during execution of the run instance. + * Get the runStatusError property: Well known Azure Storage error code that represents the error encountered during + * execution of the run instance. * * @return the runStatusError value. */ @@ -245,7 +220,7 @@ public String summaryReportPath() { } /** - * Get the taskId property: Storage Task Arm Id. + * Get the taskId property: Resource ID of the Storage Task applied during this run. * * @return the taskId value. */ diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java index 594f2dc634f4..de4511489f2c 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java @@ -21,8 +21,7 @@ public final class StorageTaskReportSummary { private List value; /* - * Request URL that can be used to query next page of storage task run results summary. Returned when the number of - * run instances and summary reports exceed maximum page size. + * Request URL that can be used to query next page of storage task run results summary. Returned when the number of run instances and summary reports exceed maximum page size. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java index a0af1f1feea0..29a0248a4f6a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskUpdateParameters.java @@ -21,9 +21,7 @@ public final class StorageTaskUpdateParameters { private ManagedServiceIdentity identity; /* - * Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and - * grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag - * must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. + * Gets or sets a list of key value pairs that describe the resource. These tags can be used in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than 256 characters. */ @JsonProperty(value = "tags") @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) @@ -64,8 +62,8 @@ public StorageTaskUpdateParameters withIdentity(ManagedServiceIdentity identity) /** * Get the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length - * than 256 characters. + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than + * 256 characters. * * @return the tags value. */ @@ -76,8 +74,8 @@ public Map tags() { /** * Set the tags property: Gets or sets a list of key value pairs that describe the resource. These tags can be used * in viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a - * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length - * than 256 characters. + * resource. Each tag must have a key no greater in length than 128 characters and a value no greater in length than + * 256 characters. * * @param tags the tags value to set. * @return the StorageTaskUpdateParameters object itself. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java index 143111d97f8a..ca8903dfee6a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasks.java @@ -71,7 +71,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ PagedIterable list(); @@ -82,7 +82,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ PagedIterable list(Context context); @@ -93,7 +93,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName); @@ -105,7 +105,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @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 from the List Storage Tasks operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ PagedIterable listByResourceGroup(String resourceGroupName, Context context); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java index dbc42b211788..2645b6ac81a8 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java @@ -10,7 +10,7 @@ import java.util.List; /** - * The response from the List Storage Tasks operation. + * The response from the List Storage Task operation. */ @Immutable public final class StorageTasksListResult { @@ -21,8 +21,7 @@ public final class StorageTasksListResult { private List value; /* - * Request URL that can be used to query next page of storage tasks. Returned when total number of requested - * storage tasks exceed maximum page size. + * Request URL that can be used to query next page of storage tasks. Returned when total number of requested storage tasks exceed maximum page size. */ @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) private String nextLink; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java index 7437490733fd..d82429352495 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java @@ -30,8 +30,8 @@ public interface StorageTasksReports { * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param storageTaskName The name of the storage task within the specified resource group. Storage task names must * be between 3 and 18 characters in length and use numbers and lower-case letters only. - * @param maxpagesize Optional, specifies the maximum number of storage task assignment Ids to be included in the - * list response. + * @param maxpagesize Optional, specifies the maximum number of Storage Task Assignment Resource IDs to be included + * in the list response. * @param filter Optional. When specified, it can be used to query using reporting properties. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java index 65c238b848bb..6c6d39a15775 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/module-info.java @@ -10,4 +10,4 @@ exports com.azure.resourcemanager.storageactions.models; opens com.azure.resourcemanager.storageactions.fluent.models to com.azure.core, com.fasterxml.jackson.databind; opens com.azure.resourcemanager.storageactions.models to com.azure.core, com.fasterxml.jackson.databind; -} +} \ No newline at end of file diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json index e995516930bb..23dd66ccfca0 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/reflect-config.json @@ -164,12 +164,12 @@ "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.storageactions.models.OnSuccess", + "name" : "com.azure.resourcemanager.storageactions.models.OnFailure", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true }, { - "name" : "com.azure.resourcemanager.storageactions.models.OnFailure", + "name" : "com.azure.resourcemanager.storageactions.models.OnSuccess", "allDeclaredConstructors" : true, "allDeclaredFields" : true, "allDeclaredMethods" : true diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java index 820de9b40e6c..40dcff7eb6a5 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.java @@ -9,9 +9,7 @@ */ public final class OperationsListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * OperationsList.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/OperationsList.json */ /** * Sample code: OperationsList. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java index 6b377965535d..5f678329583a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTaskAssignmentListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTaskAssignmentIds.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTaskAssignmentIds.json */ /** * Sample code: ListStorageTaskAssignmentsByResourceGroup. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java index 0a071bb87adc..686204d88b8d 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.java @@ -6,6 +6,8 @@ import com.azure.resourcemanager.storageactions.models.ElseCondition; import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; import com.azure.resourcemanager.storageactions.models.OnFailure; import com.azure.resourcemanager.storageactions.models.OnSuccess; import com.azure.resourcemanager.storageactions.models.StorageTaskAction; @@ -21,9 +23,7 @@ */ public final class StorageTasksCreateSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PutStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PutStorageTask.json */ /** * Sample code: PutStorageTask. @@ -31,16 +31,25 @@ public final class StorageTasksCreateSamples { * @param manager Entry point to StorageActionsManager. */ public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().define("mytask1").withRegion("westus").withExistingResourceGroup("res4228") - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") - .withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + manager.storageTasks() + .define("mytask1") + .withRegion("westus") + .withExistingResourceGroup("res4228") + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withProperties( + new StorageTaskProperties().withEnabled(true) + .withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays + .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))))) .create(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java index b6e14148befa..261f0fd5db12 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTasksDeleteSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/DeleteStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/DeleteStorageTask.json */ /** * Sample code: DeleteStorageTask. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java index cf1ef73a4d69..7ec20436fab0 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTasksGetByResourceGroupSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/GetStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/GetStorageTask.json */ /** * Sample code: GetStorageTask. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java index 98748277e806..877248467615 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTasksListByResourceGroupSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksByResourceGroup.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksByResourceGroup.json */ /** * Sample code: ListStorageTasksByResourceGroup. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java index e64256bddcc0..86c01a47924b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTasksListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksBySubscription.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksBySubscription.json */ /** * Sample code: ListStorageTasksBySubscription. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java index 809b6a47a527..eb572defeaed 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java @@ -18,9 +18,7 @@ */ public final class StorageTasksPreviewActionsSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * PerformStorageTaskActionsPreview.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/PerformStorageTaskActionsPreview.json */ /** * Sample code: PerformStorageTaskActionsPreview. @@ -29,59 +27,82 @@ public final class StorageTasksPreviewActionsSamples { */ public static void performStorageTaskActionsPreview(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().previewActionsWithResponse("eastus", - new StorageTaskPreviewActionInner().withProperties(new StorageTaskPreviewActionProperties() - .withContainer(new StorageTaskPreviewContainerProperties().withName("firstContainer") - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mContainerValue1")))) - .withBlobs(Arrays.asList( - new StorageTaskPreviewBlobProperties().withName("folder1/file1.txt").withProperties(Arrays.asList( - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("0x8DB67175454D36D"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("38619"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("text/xml"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("njr6iDrmU9+FC89WMK22EA=="), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue(""), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("BlockBlob"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("Hot"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("unlocked"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("available"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("true"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder").withValue("1"))) - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mValue1"))) - .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("tValue1"))), - new StorageTaskPreviewBlobProperties().withName("folder2/file1.txt") - .withProperties(Arrays.asList( - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), - new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") - .withValue("0x6FB67175454D36D"))) - .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("mValue2"))) - .withTags(Arrays.asList(new StorageTaskPreviewKeyValueProperties() - .withKey("fakeTokenPlaceholder").withValue("tValue2"))))) - .withAction(new StorageTaskPreviewActionCondition() - .withIfProperty( - new StorageTaskPreviewActionIfCondition().withCondition("[[equals(AccessTier, 'Hot')]]")) - .withElseBlockExists(true))), - com.azure.core.util.Context.NONE); + manager.storageTasks() + .previewActionsWithResponse("eastus", + new StorageTaskPreviewActionInner() + .withProperties( + new StorageTaskPreviewActionProperties() + .withContainer( + new StorageTaskPreviewContainerProperties().withName("firstContainer") + .withMetadata(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue("mContainerValue1")))) + .withBlobs(Arrays.asList(new StorageTaskPreviewBlobProperties() + .withName("folder1/file1.txt") + .withProperties(Arrays.asList(new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 07 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x8DB67175454D36D"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("38619"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("text/xml"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("njr6iDrmU9+FC89WMK22EA=="), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties() + .withKey("fakeTokenPlaceholder") + .withValue(""), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("BlockBlob"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Hot"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("unlocked"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("available"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("true"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("1"))) + .withMetadata(Arrays + .asList(new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("mValue1"))) + .withTags(Arrays + .asList(new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("tValue1"))), + new StorageTaskPreviewBlobProperties() + .withName("folder2/file1.txt") + .withProperties(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("Wed, 06 Jun 2023 05:23:29 GMT"), + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("0x6FB67175454D36D"))) + .withMetadata(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("mValue2"))) + .withTags(Arrays.asList( + new StorageTaskPreviewKeyValueProperties().withKey("fakeTokenPlaceholder") + .withValue("tValue2"))))) + .withAction(new StorageTaskPreviewActionCondition() + .withIfProperty(new StorageTaskPreviewActionIfCondition() + .withCondition("[[equals(AccessTier, 'Hot')]]")) + .withElseBlockExists(true))), + com.azure.core.util.Context.NONE); } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java index 404c20cead31..5e0681c2f161 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.java @@ -9,9 +9,7 @@ */ public final class StorageTasksReportListSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksRunReportSummary.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksList/ListStorageTasksRunReportSummary.json */ /** * Sample code: ListStorageTasksByResourceGroup. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java index 93b56725c270..633ecfb47cb5 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java @@ -6,6 +6,8 @@ import com.azure.resourcemanager.storageactions.models.ElseCondition; import com.azure.resourcemanager.storageactions.models.IfCondition; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; import com.azure.resourcemanager.storageactions.models.OnFailure; import com.azure.resourcemanager.storageactions.models.OnSuccess; import com.azure.resourcemanager.storageactions.models.StorageTask; @@ -13,6 +15,7 @@ import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; import java.util.Arrays; import java.util.HashMap; import java.util.Map; @@ -22,9 +25,7 @@ */ public final class StorageTasksUpdateSamples { /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PatchStorageTask.json + * x-ms-original-file: specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/storageTasksCrud/PatchStorageTask.json */ /** * Sample code: PatchStorageTask. @@ -33,17 +34,27 @@ public final class StorageTasksUpdateSamples { */ public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { StorageTask resource = manager.storageTasks() - .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE).getValue(); + .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE) + .getValue(); resource.update() - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("My Storage task") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") - .withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("tier", "Hot")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) + .withUserAssignedIdentities(mapOf( + "/subscriptions/1f31ba14-ce16-4281-b9b4-3e78da6e1616/resourceGroups/res4228/providers/Microsoft.ManagedIdentity/userAssignedIdentities/myUserAssignedIdentity", + new UserAssignedIdentity()))) + .withProperties( + new StorageTaskProperties().withEnabled(true) + .withDescription("My Storage task") + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays + .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(mapOf("tier", "Hot")) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))) + .withElseProperty(new ElseCondition().withOperations( + Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK)))))) .apply(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java deleted file mode 100644 index d8a65e226975..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ElseConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ElseCondition model = BinaryData.fromString( - "{\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"glu\":\"xscpaierhhbc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.operations().get(0).name()); - Assertions.assertEquals("xscpaierhhbc", model.operations().get(0).parameters().get("glu")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ElseCondition model = new ElseCondition().withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("glu", "xscpaierhhbc")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.operations().get(0).name()); - Assertions.assertEquals("xscpaierhhbc", model.operations().get(0).parameters().get("glu")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java deleted file mode 100644 index 9827d7e88b83..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class IfConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - IfCondition model = BinaryData.fromString( - "{\"condition\":\"nteiwaopv\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"uf\":\"mmxdcu\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"xtbzsgfyccsne\":\"nsez\",\"flnrosfqpteehzz\":\"mdwzjeiachboo\",\"swjdkirso\":\"ypyqrimzinp\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"UndeleteBlob\",\"parameters\":{\"kwh\":\"nohjt\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"jxvsnbyxqabn\":\"pjxsqwpgrjbznor\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(IfCondition.class); - Assertions.assertEquals("nteiwaopv", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("mmxdcu", model.operations().get(0).parameters().get("uf")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - IfCondition model = new IfCondition().withCondition("nteiwaopv") - .withOperations(Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("uf", "mmxdcu")).withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters( - mapOf("xtbzsgfyccsne", "nsez", "flnrosfqpteehzz", "mdwzjeiachboo", "swjdkirso", "ypyqrimzinp")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("kwh", "nohjt")).withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withParameters(mapOf("jxvsnbyxqabn", "pjxsqwpgrjbznor")).withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(IfCondition.class); - Assertions.assertEquals("nteiwaopv", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("mmxdcu", model.operations().get(0).parameters().get("uf")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java deleted file mode 100644 index f584df2768b4..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ManagedServiceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ManagedServiceIdentity model = BinaryData.fromString( - "{\"principalId\":\"ccfeb22d-fe6b-4848-9290-3d620293c4a9\",\"tenantId\":\"3bb418de-f47c-43fc-a235-e8ba50c00c7a\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"e\":{\"principalId\":\"8d08c997-afed-4f41-a0ca-af4a53fdb334\",\"clientId\":\"ea71dddc-e8b9-47c7-b9fd-abd2a70bb74d\"},\"qjbasvms\":{\"principalId\":\"838e7e39-79a5-4322-ae47-36738f75aef6\",\"clientId\":\"e01812ea-9cf6-4555-8766-3bd1ab41808e\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("e", new UserAssignedIdentity(), "qjbasvms", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.type()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java deleted file mode 100644 index 866ba919bb88..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationDisplayTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"yrtih\",\"resource\":\"tijbpzvgnwzsymgl\",\"operation\":\"fcyzkohdbihanufh\",\"description\":\"bj\"}") - .toObject(OperationDisplay.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationDisplay model = new OperationDisplay(); - model = BinaryData.fromObject(model).toObject(OperationDisplay.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java deleted file mode 100644 index 576f41e74879..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationInnerTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; -import com.azure.resourcemanager.storageactions.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"usarhmofc\",\"isDataAction\":false,\"display\":{\"provider\":\"urkdtmlx\",\"resource\":\"kuksjtxukcdm\",\"operation\":\"rcryuanzwuxzdxta\",\"description\":\"lhmwhfpmrqobm\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java deleted file mode 100644 index 8afd40f84e30..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"quvgjxpybczme\",\"isDataAction\":true,\"display\":{\"provider\":\"pbsphrupidgs\",\"resource\":\"bejhphoycmsxa\",\"operation\":\"hdxbmtqio\",\"description\":\"zehtbmu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"izhwlrxy\",\"isDataAction\":false,\"display\":{\"provider\":\"ijgkdm\",\"resource\":\"azlobcufpdznrbt\",\"operation\":\"qjnqglhqgnufoooj\",\"description\":\"ifsqesaagdfmg\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"},{\"name\":\"rifkwm\",\"isDataAction\":true,\"display\":{\"provider\":\"izntocipao\",\"resource\":\"jpsq\",\"operation\":\"mpoyfd\",\"description\":\"ogknygjofjdd\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"upewnwreitjzy\"}") - .toObject(OperationListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationListResult model = new OperationListResult(); - model = BinaryData.fromObject(model).toObject(OperationListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java deleted file mode 100644 index c2c7327046d7..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.Operation; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"name\":\"hashsfwxosow\",\"isDataAction\":true,\"display\":{\"provider\":\"i\",\"resource\":\"ooxdjebwpuc\",\"operation\":\"fvovbvmeuecivy\",\"description\":\"ce\"},\"origin\":\"system\",\"actionType\":\"Internal\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.operations().list(com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java deleted file mode 100644 index 76636f6a8970..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAction model = BinaryData.fromString( - "{\"if\":{\"condition\":\"dmgloug\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"wgcu\":\"mutduqktaps\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"bmdg\":\"qw\",\"dgmb\":\"bjf\",\"tq\":\"bexppb\",\"algbquxigjyjg\":\"rolfpfp\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobExpiry\",\"parameters\":{\"vlejuvfqa\":\"txilnerkujy\",\"xgjvtbv\":\"rlyxwjkcprbnw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"guhmuouqfpr\":\"uj\",\"nguitnwuizgazxu\":\"zw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"UndeleteBlob\",\"parameters\":{\"rfidfvzwdz\":\"i\",\"sdkf\":\"htymw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}}") - .toObject(StorageTaskAction.class); - Assertions.assertEquals("dmgloug", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("mutduqktaps", model.ifProperty().operations().get(0).parameters().get("wgcu")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("qw", model.elseProperty().operations().get(0).parameters().get("bmdg")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAction model - = new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("dmgloug") - .withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("wgcu", "mutduqktaps")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty( - new ElseCondition() - .withOperations( - Arrays - .asList( - new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("bmdg", "qw", "dgmb", "bjf", "tq", "bexppb", - "algbquxigjyjg", "rolfpfp")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) - .withParameters(mapOf("vlejuvfqa", "txilnerkujy", "xgjvtbv", "rlyxwjkcprbnw")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("guhmuouqfpr", "uj", "nguitnwuizgazxu", "zw")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("rfidfvzwdz", "i", "sdkf", "htymw")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))); - model = BinaryData.fromObject(model).toObject(StorageTaskAction.class); - Assertions.assertEquals("dmgloug", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("mutduqktaps", model.ifProperty().operations().get(0).parameters().get("wgcu")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("qw", model.elseProperty().operations().get(0).parameters().get("bmdg")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java deleted file mode 100644 index 88283064e6eb..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentInnerTests.java +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; - -public final class StorageTaskAssignmentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAssignmentInner model - = BinaryData.fromString("{\"id\":\"zi\"}").toObject(StorageTaskAssignmentInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAssignmentInner model = new StorageTaskAssignmentInner(); - model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java deleted file mode 100644 index 0702b457614d..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTaskAssignmentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"value\":[{\"id\":\"pjflcxogao\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.storageTaskAssignments().list("d", "lvwiwubmwmbesl", "nkww", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java deleted file mode 100644 index f88f2582efc6..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.java +++ /dev/null @@ -1,24 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult; - -public final class StorageTaskAssignmentsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAssignmentsListResult model = BinaryData - .fromString( - "{\"value\":[{\"id\":\"qzntypm\"},{\"id\":\"p\"},{\"id\":\"c\"}],\"nextLink\":\"qjsdpydnfyhxdeo\"}") - .toObject(StorageTaskAssignmentsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskAssignmentsListResult model = new StorageTaskAssignmentsListResult(); - model = BinaryData.fromObject(model).toObject(StorageTaskAssignmentsListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java deleted file mode 100644 index 64cbcf12f167..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java +++ /dev/null @@ -1,122 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskInner model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"8aaefed7-cba7-49f8-8856-2de977305379\",\"tenantId\":\"6953987e-3032-4673-aed1-5c06f5e452d1\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hab\":{\"principalId\":\"635bd5b4-27bb-40e3-ac72-46c4e2a8eab5\",\"clientId\":\"f148e713-f24b-4da3-bfc0-274a7d69ba59\"}}},\"properties\":{\"taskVersion\":4747702920878176636,\"enabled\":true,\"description\":\"wczbys\",\"action\":{\"if\":{\"condition\":\"npqxuh\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"tfwvukxgaudc\":\"iwbybrkxvdumjg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"kryhtnapczwlokj\":\"j\",\"jnchgej\":\"emkkvnipjox\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"o\":\"zyde\",\"wixjsprozvcp\":\"wyahuxinpmqnja\",\"atscmd\":\"tegjvwmf\",\"zkrwfn\":\"pjhulsuuvmkj\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"jdpvwryo\":\"w\",\"hbcryffdfdosyge\":\"psoacctazakljl\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"vdphlxaolthqtr\":\"msbzjhcrz\",\"gvfcj\":\"qjbpfzfsin\",\"xjtfelluwfzit\":\"wzo\",\"qfpjk\":\"np\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-11-04T07:17:51Z\"},\"location\":\"fxxypininmayhuy\",\"tags\":{\"inuvamiheogn\":\"podepoo\",\"usivye\":\"rxzxtheo\"},\"id\":\"cciqihnhungbwjz\",\"name\":\"nfygxgispemvtz\",\"type\":\"kufubljo\"}") - .toObject(StorageTaskInner.class); - Assertions.assertEquals("fxxypininmayhuy", model.location()); - Assertions.assertEquals("podepoo", model.tags().get("inuvamiheogn")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(true, model.properties().enabled()); - Assertions.assertEquals("wczbys", model.properties().description()); - Assertions.assertEquals("npqxuh", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("iwbybrkxvdumjg", - model.properties().action().ifProperty().operations().get(0).parameters().get("tfwvukxgaudc")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("j", - model.properties().action().elseProperty().operations().get(0).parameters().get("kryhtnapczwlokj")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskInner model - = new StorageTaskInner().withLocation("fxxypininmayhuy") - .withTags( - mapOf("inuvamiheogn", "podepoo", "usivye", "rxzxtheo")) - .withIdentity( - new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.USER_ASSIGNED).withUserAssignedIdentities( - mapOf("hab", new UserAssignedIdentity()))) - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("wczbys") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("npqxuh").withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("tfwvukxgaudc", "iwbybrkxvdumjg")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("kryhtnapczwlokj", "j", "jnchgej", "emkkvnipjox")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("o", "zyde", "wixjsprozvcp", "wyahuxinpmqnja", "atscmd", - "tegjvwmf", "zkrwfn", "pjhulsuuvmkj")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withParameters(mapOf("jdpvwryo", "w", "hbcryffdfdosyge", "psoacctazakljl")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("vdphlxaolthqtr", "msbzjhcrz", "gvfcj", "qjbpfzfsin", - "xjtfelluwfzit", "wzo", "qfpjk", "np")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskInner.class); - Assertions.assertEquals("fxxypininmayhuy", model.location()); - Assertions.assertEquals("podepoo", model.tags().get("inuvamiheogn")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals(true, model.properties().enabled()); - Assertions.assertEquals("wczbys", model.properties().description()); - Assertions.assertEquals("npqxuh", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("iwbybrkxvdumjg", - model.properties().action().ifProperty().operations().get(0).parameters().get("tfwvukxgaudc")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("j", - model.properties().action().elseProperty().operations().get(0).parameters().get("kryhtnapczwlokj")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java deleted file mode 100644 index 6575399d44ac..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskOperationTests.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskOperationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskOperation model = BinaryData.fromString( - "{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"jjgpb\":\"urzafb\",\"jmkljavbqidtqajz\":\"oq\",\"hbzhfepg\":\"ulpkudjkrl\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}") - .toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, model.name()); - Assertions.assertEquals("urzafb", model.parameters().get("jjgpb")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskOperation model - = new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters(mapOf("jjgpb", "urzafb", "jmkljavbqidtqajz", "oq", "hbzhfepg", "ulpkudjkrl")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK); - model = BinaryData.fromObject(model).toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, model.name()); - Assertions.assertEquals("urzafb", model.parameters().get("jjgpb")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java deleted file mode 100644 index a9c02d7d40ab..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPreviewActionConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskPreviewActionCondition model - = BinaryData.fromString("{\"if\":{\"condition\":\"k\"},\"elseBlockExists\":true}") - .toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("k", model.ifProperty().condition()); - Assertions.assertEquals(true, model.elseBlockExists()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionCondition model = new StorageTaskPreviewActionCondition() - .withIfProperty(new StorageTaskPreviewActionIfCondition().withCondition("k")).withElseBlockExists(true); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("k", model.ifProperty().condition()); - Assertions.assertEquals(true, model.elseBlockExists()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java deleted file mode 100644 index dbdc55c62899..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPreviewActionIfConditionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskPreviewActionIfCondition model = BinaryData.fromString("{\"condition\":\"liourqhak\"}") - .toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("liourqhak", model.condition()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionIfCondition model - = new StorageTaskPreviewActionIfCondition().withCondition("liourqhak"); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("liourqhak", model.condition()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java deleted file mode 100644 index 4be310dfae80..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskProperties model = BinaryData.fromString( - "{\"taskVersion\":8951881074960566818,\"enabled\":true,\"description\":\"sntnbybkzgcw\",\"action\":{\"if\":{\"condition\":\"wclxxwrl\",\"operations\":[{\"name\":\"UndeleteBlob\",\"parameters\":{\"dkwt\":\"kcqvkocrc\",\"ssainqpjwnzll\":\"hxbnjbiksqrg\",\"bvmgxsabkyqduuji\":\"fmppe\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"sbdkvwr\":\"vndhkrwpdapp\",\"tjelt\":\"jfeusnh\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"tqxhocdgeab\":\"zzd\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"aozwyiftyhxhu\":\"ndv\",\"fkgiawxk\":\"okftyxolniwpwcuk\",\"dhsgcba\":\"ryplwckbasyypn\",\"dlikwyqkgfgibma\":\"phejkotynqgoulz\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"ouf\":\"bzqqedqytbciq\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-10-01T10:06:40Z\"}") - .toObject(StorageTaskProperties.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("sntnbybkzgcw", model.description()); - Assertions.assertEquals("wclxxwrl", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("kcqvkocrc", model.action().ifProperty().operations().get(0).parameters().get("dkwt")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("bzqqedqytbciq", - model.action().elseProperty().operations().get(0).parameters().get("ouf")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskProperties model = new StorageTaskProperties().withEnabled(true).withDescription("sntnbybkzgcw") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("wclxxwrl") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.UNDELETE_BLOB) - .withParameters(mapOf("dkwt", "kcqvkocrc", "ssainqpjwnzll", "hxbnjbiksqrg", - "bvmgxsabkyqduuji", "fmppe")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("sbdkvwr", "vndhkrwpdapp", "tjelt", "jfeusnh")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("tqxhocdgeab", "zzd")).withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("aozwyiftyhxhu", "ndv", "fkgiawxk", "okftyxolniwpwcuk", "dhsgcba", - "ryplwckbasyypn", "dlikwyqkgfgibma", "phejkotynqgoulz")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList(new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_TIER).withParameters(mapOf("ouf", "bzqqedqytbciq")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK))))); - model = BinaryData.fromObject(model).toObject(StorageTaskProperties.class); - Assertions.assertEquals(true, model.enabled()); - Assertions.assertEquals("sntnbybkzgcw", model.description()); - Assertions.assertEquals("wclxxwrl", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("kcqvkocrc", model.action().ifProperty().operations().get(0).parameters().get("dkwt")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("bzqqedqytbciq", - model.action().elseProperty().operations().get(0).parameters().get("ouf")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java deleted file mode 100644 index 84e420fa609e..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportInstanceInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; - -public final class StorageTaskReportInstanceInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportInstanceInner model = BinaryData.fromString( - "{\"properties\":{\"taskAssignmentId\":\"baiuebbaumny\",\"storageAccountId\":\"ped\",\"startTime\":\"jn\",\"finishTime\":\"ckhsmtxpsieb\",\"objectsTargetedCount\":\"hvpesapskrdqm\",\"objectsOperatedOnCount\":\"jdhtldwkyzxu\",\"objectFailedCount\":\"kn\",\"objectsSucceededCount\":\"scwsv\",\"runStatusError\":\"otogtwrupqs\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"i\",\"taskId\":\"kvceoveilovnotyf\",\"taskVersion\":\"cnjbkcnxdhbt\",\"runResult\":\"Succeeded\"},\"id\":\"ywpnvjt\",\"name\":\"qnermclfplphoxu\",\"type\":\"crpab\"}") - .toObject(StorageTaskReportInstanceInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportInstanceInner model - = new StorageTaskReportInstanceInner().withProperties(new StorageTaskReportProperties()); - model = BinaryData.fromObject(model).toObject(StorageTaskReportInstanceInner.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java deleted file mode 100644 index ce106294ec42..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportPropertiesTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportProperties; - -public final class StorageTaskReportPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportProperties model = BinaryData.fromString( - "{\"taskAssignmentId\":\"epsbjtazqu\",\"storageAccountId\":\"ywpmueefjzwfqkq\",\"startTime\":\"ids\",\"finishTime\":\"onobglaocqx\",\"objectsTargetedCount\":\"cmgyud\",\"objectsOperatedOnCount\":\"tlmoyrx\",\"objectFailedCount\":\"fudwpznt\",\"objectsSucceededCount\":\"dzhlrq\",\"runStatusError\":\"hckfrlhrx\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"vpycanuzbp\",\"taskId\":\"afkuwb\",\"taskVersion\":\"nwbmeh\",\"runResult\":\"Failed\"}") - .toObject(StorageTaskReportProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportProperties model = new StorageTaskReportProperties(); - model = BinaryData.fromObject(model).toObject(StorageTaskReportProperties.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java deleted file mode 100644 index 3eff706d35b6..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskReportSummaryTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary; - -public final class StorageTaskReportSummaryTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskReportSummary model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"jttgzf\",\"storageAccountId\":\"shcbkhajdeyeamdp\",\"startTime\":\"g\",\"finishTime\":\"pbuxwgipwhon\",\"objectsTargetedCount\":\"kgshwa\",\"objectsOperatedOnCount\":\"ixzbinjeputtmryw\",\"objectFailedCount\":\"zoqftiyqzrnkcqvy\",\"objectsSucceededCount\":\"whzlsicohoq\",\"runStatusError\":\"wvl\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"w\",\"taskId\":\"eun\",\"taskVersion\":\"qhgyxzkonocukok\",\"runResult\":\"Succeeded\"},\"id\":\"uconuqszfkbey\",\"name\":\"ewrmjmwvvjektc\",\"type\":\"senhwlrs\"},{\"properties\":{\"taskAssignmentId\":\"zpwv\",\"storageAccountId\":\"dqgbiqylihkaetc\",\"startTime\":\"vfcivfsnkymuc\",\"finishTime\":\"hjfbebrjcxe\",\"objectsTargetedCount\":\"uwutttxfvjrbi\",\"objectsOperatedOnCount\":\"hxepcyvahfnlj\",\"objectFailedCount\":\"qxj\",\"objectsSucceededCount\":\"ujqgidok\",\"runStatusError\":\"ljyoxgvcltb\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"ghkjeszzhbi\",\"taskId\":\"txfvgx\",\"taskVersion\":\"smx\",\"runResult\":\"Succeeded\"},\"id\":\"pvecxgodeb\",\"name\":\"qkkrb\",\"type\":\"pukgriwflzlfb\"},{\"properties\":{\"taskAssignmentId\":\"uzycispnqza\",\"storageAccountId\":\"gkbrpyyd\",\"startTime\":\"bnuqqkpik\",\"finishTime\":\"rgvtqag\",\"objectsTargetedCount\":\"uynhijg\",\"objectsOperatedOnCount\":\"ebf\",\"objectFailedCount\":\"arbu\",\"objectsSucceededCount\":\"cvpnazzmhjrunmpx\",\"runStatusError\":\"dbhrbnlankxm\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"bhenbtkcxywnyt\",\"taskId\":\"synlqidybyxczfc\",\"taskVersion\":\"aaxdbabphlwrq\",\"runResult\":\"Failed\"},\"id\":\"sthsu\",\"name\":\"ocmnyyazttbtwwrq\",\"type\":\"uedck\"},{\"properties\":{\"taskAssignmentId\":\"biexzfeyu\",\"storageAccountId\":\"xibxujwbhqwalm\",\"startTime\":\"yoxa\",\"finishTime\":\"dkzjancuxrh\",\"objectsTargetedCount\":\"bavxbniwdjswzt\",\"objectsOperatedOnCount\":\"bpg\",\"objectFailedCount\":\"ytxhp\",\"objectsSucceededCount\":\"bzpfzab\",\"runStatusError\":\"cuh\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"tyq\",\"taskId\":\"lbbovplw\",\"taskVersion\":\"hvgyuguosvmk\",\"runResult\":\"Succeeded\"},\"id\":\"qukkfp\",\"name\":\"gmgsxnkjzkde\",\"type\":\"lpvlopw\"}],\"nextLink\":\"ighxpk\"}") - .toObject(StorageTaskReportSummary.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskReportSummary model = new StorageTaskReportSummary(); - model = BinaryData.fromObject(model).toObject(StorageTaskReportSummary.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java deleted file mode 100644 index 0ed3eafab12f..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java +++ /dev/null @@ -1,118 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.OnFailure; -import com.azure.resourcemanager.storageactions.models.OnSuccess; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class StorageTaskUpdateParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskUpdateParameters model = BinaryData.fromString( - "{\"identity\":{\"principalId\":\"b5ded4d9-57be-41ec-aadf-db143ec1a7ef\",\"tenantId\":\"e9145f12-aae2-4f09-b8f8-f195cd9fa6d5\",\"type\":\"None\",\"userAssignedIdentities\":{\"bdxkqpxokaj\":{\"principalId\":\"7d85bbc5-b38c-4df1-b290-5d1ef64f1efa\",\"clientId\":\"b632fa28-b41e-46f1-8c88-06345407d36a\"},\"pimexgstxgcpodg\":{\"principalId\":\"cef39613-a817-4045-aa3e-7ecf912d2991\",\"clientId\":\"4c63bd86-5835-4dc0-a10d-ae1b07e54e72\"},\"jrmvdjwzrlo\":{\"principalId\":\"45e35f83-f1e7-4f2d-8d72-0dd7c7907abb\",\"clientId\":\"def8f072-5f5f-41c8-b9f5-d094dc3709e3\"},\"lwhijcoejctbzaq\":{\"principalId\":\"13a5f9ac-cfc4-4f75-9f9a-3649a064734a\",\"clientId\":\"02ab6026-039b-4bee-a000-f2e7d39ddde3\"}}},\"tags\":{\"bkbfkgukdkex\":\"y\",\"ocjjxhvpmouexh\":\"ppofmxaxcfjpgdd\"},\"properties\":{\"taskVersion\":986313719569038785,\"enabled\":true,\"description\":\"eojnxqbzvddn\",\"action\":{\"if\":{\"condition\":\"wndeicbtwnp\",\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"jthjqkwpyei\":\"uhrhcffcyddgl\",\"q\":\"xmqci\",\"xuigdtopbobj\":\"hkh\",\"uhrzayvvt\":\"ghmewuam\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"efgugnxk\":\"tkftutqxlngx\",\"hjybigehoqfbo\":\"xdqmidtthzrvqdra\",\"zlcuiywgqywgndrv\":\"skanyk\",\"ocpecfvmmco\":\"nhzgpphrcgyn\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"jqabcypmivkwlzuv\":\"m\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"DeleteBlob\",\"parameters\":{\"nlebxetqgtzxd\":\"acfi\",\"feallnwsu\":\"nqbqqwxr\",\"c\":\"isnjampmngnz\",\"ochcbonqvpkvl\":\"aqw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"Failed\",\"creationTimeInUtc\":\"2021-02-05T10:28:18Z\"}}") - .toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("y", model.tags().get("bkbfkgukdkex")); - Assertions.assertEquals(true, model.properties().enabled()); - Assertions.assertEquals("eojnxqbzvddn", model.properties().description()); - Assertions.assertEquals("wndeicbtwnp", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("uhrhcffcyddgl", - model.properties().action().ifProperty().operations().get(0).parameters().get("jthjqkwpyei")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("m", - model.properties().action().elseProperty().operations().get(0).parameters().get("jqabcypmivkwlzuv")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskUpdateParameters model - = new StorageTaskUpdateParameters() - .withIdentity( - new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf( - "bdxkqpxokaj", new UserAssignedIdentity(), "pimexgstxgcpodg", new UserAssignedIdentity(), - "jrmvdjwzrlo", new UserAssignedIdentity(), "lwhijcoejctbzaq", new UserAssignedIdentity()))) - .withTags(mapOf("bkbfkgukdkex", "y", "ocjjxhvpmouexh", "ppofmxaxcfjpgdd")) - .withProperties(new StorageTaskProperties().withEnabled(true).withDescription("eojnxqbzvddn") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("wndeicbtwnp").withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("jthjqkwpyei", "uhrhcffcyddgl", "q", "xmqci", "xuigdtopbobj", - "hkh", "uhrzayvvt", "ghmewuam")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("efgugnxk", "tkftutqxlngx", "hjybigehoqfbo", "xdqmidtthzrvqdra", - "zlcuiywgqywgndrv", "skanyk", "ocpecfvmmco", "nhzgpphrcgyn")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("jqabcypmivkwlzuv", "m")).withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.DELETE_BLOB) - .withParameters(mapOf("nlebxetqgtzxd", "acfi", "feallnwsu", "nqbqqwxr", "c", - "isnjampmngnz", "ochcbonqvpkvl", "aqw")) - .withOnSuccess(OnSuccess.CONTINUE).withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("y", model.tags().get("bkbfkgukdkex")); - Assertions.assertEquals(true, model.properties().enabled()); - Assertions.assertEquals("eojnxqbzvddn", model.properties().description()); - Assertions.assertEquals("wndeicbtwnp", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("uhrhcffcyddgl", - model.properties().action().ifProperty().operations().get(0).parameters().get("jthjqkwpyei")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("m", - model.properties().action().elseProperty().operations().get(0).parameters().get("jqabcypmivkwlzuv")); - Assertions.assertEquals(OnSuccess.CONTINUE, - model.properties().action().elseProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, - model.properties().action().elseProperty().operations().get(0).onFailure()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java deleted file mode 100644 index 7b96399fd8de..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java +++ /dev/null @@ -1,106 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ElseCondition; -import com.azure.resourcemanager.storageactions.models.IfCondition; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperation; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTasksCreateMockTests { - @Test - public void testCreate() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"identity\":{\"principalId\":\"5729977c-5078-455a-969b-f093d6995703\",\"tenantId\":\"bff15c75-7b41-407c-a702-fb5c86c08b2a\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"gynduha\":{\"principalId\":\"dc88025a-5cc3-4921-b3ba-5c61bd5cef56\",\"clientId\":\"da96ce7b-c15e-491e-b267-100c69a9034e\"}}},\"properties\":{\"taskVersion\":5319393141348418027,\"enabled\":false,\"description\":\"humaqolbgyc\",\"action\":{\"if\":{\"condition\":\"uie\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobImmutabilityPolicy\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobTier\"},{\"name\":\"DeleteBlob\"}]}},\"provisioningState\":\"Succeeded\",\"creationTimeInUtc\":\"2021-10-20T11:28:50Z\"},\"location\":\"lfmmdnbbglzpswi\",\"tags\":{\"bzmnvdfznud\":\"cwyhzdxssa\",\"xzb\":\"od\",\"dzu\":\"cblylpstdbhhxsr\",\"fiwjmygtdssls\":\"erscdntne\"},\"id\":\"tmweriofzpyq\",\"name\":\"emwabnet\",\"type\":\"hhszh\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - StorageTask response - = manager.storageTasks().define("xoblytkbl").withRegion("l").withExistingResourceGroup("qmcbxvwvxyslqbhs") - .withTags(mapOf("jmkcjhwqytj", "fqqnvwpmqtaruo", "jewgdrjerv", "ybn")) - .withIdentity(new ManagedServiceIdentity() - .withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("rvrnsvshqjohxc", new UserAssignedIdentity(), "fovasr", - new UserAssignedIdentity(), "wbhsqfsub", new UserAssignedIdentity()))) - .withProperties( - new StorageTaskProperties() - .withEnabled(false).withDescription( - "xb") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("ybsrfbjfdtwss") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER)))))) - .create(); - - Assertions.assertEquals("lfmmdnbbglzpswi", response.location()); - Assertions.assertEquals("cwyhzdxssa", response.tags().get("bzmnvdfznud")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(false, response.properties().enabled()); - Assertions.assertEquals("humaqolbgyc", response.properties().description()); - Assertions.assertEquals("uie", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - response.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.DELETE_BLOB, - response.properties().action().elseProperty().operations().get(0).name()); - } - - // Use "Map.of" if available - @SuppressWarnings("unchecked") - private static Map mapOf(Object... inputs) { - Map map = new HashMap<>(); - for (int i = 0; i < inputs.length; i += 2) { - String key = (String) inputs[i]; - T value = (T) inputs[i + 1]; - map.put(key, value); - } - return map; - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 4e5ccb6ebe55..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTasksGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"identity\":{\"principalId\":\"4e736b56-a552-491a-b4b2-90219b61aa89\",\"tenantId\":\"8941c59c-b6bf-40b4-b1f0-23249f9803e2\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"awgqwgxhni\":{\"principalId\":\"ea19509f-4c7a-4ad1-ba90-a4cef221ec45\",\"clientId\":\"8e41fe50-aca5-4b07-aad3-0012284f2eb8\"},\"fbkp\":{\"principalId\":\"68d6ffc9-eb64-4530-96ac-50d2ca42dc68\",\"clientId\":\"64e203ab-68bd-4763-8b78-00ee846a3373\"},\"klwndnhjdauwhv\":{\"principalId\":\"4080ba15-c9b4-40c6-8623-606c187443ae\",\"clientId\":\"242bed53-fea2-4311-a7bd-b6393518bf54\"}}},\"properties\":{\"taskVersion\":3762934959589982311,\"enabled\":true,\"description\":\"dhxujznbmpo\",\"action\":{\"if\":{\"condition\":\"uwprzql\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"}]}},\"provisioningState\":\"Creating\",\"creationTimeInUtc\":\"2021-08-19T13:39:55Z\"},\"location\":\"bcswsrt\",\"tags\":{\"blcg\":\"plrbpbewtghf\",\"nmxiebwwaloayqc\":\"xzvlvqhjkbegib\",\"uzgwyzmhtx\":\"wrtz\",\"wxqpsrknftguvri\":\"ngmtsavjcb\"},\"id\":\"hprwmdyv\",\"name\":\"qtayri\",\"type\":\"wroyqbexrmcq\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - StorageTask response = manager.storageTasks() - .getByResourceGroupWithResponse("rw", "ueiotwmcdyt", com.azure.core.util.Context.NONE).getValue(); - - Assertions.assertEquals("bcswsrt", response.location()); - Assertions.assertEquals("plrbpbewtghf", response.tags().get("blcg")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals(true, response.properties().enabled()); - Assertions.assertEquals("dhxujznbmpo", response.properties().description()); - Assertions.assertEquals("uwprzql", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - response.properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java deleted file mode 100644 index 4464cbe62b8d..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTasksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"4c60e250-c5b6-4d87-910d-b542d39d05b8\",\"tenantId\":\"6189c58c-c642-4ee3-8f02-e8ab3055ded9\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"knalaulppg\":{\"principalId\":\"91cbe122-a42a-4d9d-bfe6-d40330c4c5e7\",\"clientId\":\"246e7c86-ca17-4c08-8adc-1057c0dd2fee\"},\"pnapnyiropuh\":{\"principalId\":\"ae0824c1-407e-42e1-8825-e533155f1c7e\",\"clientId\":\"14ab147f-43e7-41f1-a34d-928b7b722fb8\"},\"vpgylgqgitxmed\":{\"principalId\":\"18263e01-eae7-46d1-8511-4bfeabf20117\",\"clientId\":\"aa3c943f-54f2-4d47-83ee-577aeab48040\"},\"slynqwwnc\":{\"principalId\":\"94ea7927-27f9-4292-b34b-931f9660825a\",\"clientId\":\"4eff2367-e1ad-491c-94e7-657db2d10db0\"}}},\"properties\":{\"taskVersion\":2313446192917643442,\"enabled\":true,\"description\":\"ktrmgucnapkt\",\"action\":{\"if\":{\"condition\":\"oellwp\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-03-25T11:42:18Z\"},\"location\":\"fqrhhuaopppc\",\"tags\":{\"t\":\"xolzdahzx\",\"grcfb\":\"bgbkdmoizpost\",\"bpvjymjhx\":\"nrmfqjhhk\"},\"id\":\"j\",\"name\":\"n\",\"type\":\"u\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.storageTasks().listByResourceGroup("exznelixhnr", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("fqrhhuaopppc", response.iterator().next().location()); - Assertions.assertEquals("xolzdahzx", response.iterator().next().tags().get("t")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertEquals(true, response.iterator().next().properties().enabled()); - Assertions.assertEquals("ktrmgucnapkt", response.iterator().next().properties().description()); - Assertions.assertEquals("oellwp", response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.DELETE_BLOB, - response.iterator().next().properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java deleted file mode 100644 index 36c69a744e9b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentityType; -import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskOperationName; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTasksListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"76672872-3d44-4893-86f6-ef537a834634\",\"tenantId\":\"f18d5da8-93b9-4af0-ac74-1eb1ce7bb4eb\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"nmefqsgzvahapj\":{\"principalId\":\"0fe8c224-0e78-465e-ba94-faac2d45d0b9\",\"clientId\":\"27bb0a8f-60c9-4e12-b3ac-c5326922e89e\"}}},\"properties\":{\"taskVersion\":7368048825846520103,\"enabled\":false,\"description\":\"qzcjrvxdj\",\"action\":{\"if\":{\"condition\":\"lmwlxkvugfhzo\",\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Creating\",\"creationTimeInUtc\":\"2021-09-06T05:22:37Z\"},\"location\":\"rnxipei\",\"tags\":{\"ltskzbbtd\":\"zuaejxd\",\"bsjyofdx\":\"umveekgpwozuhkf\",\"oekqvk\":\"uusdttouwa\",\"vbxwyjsflhh\":\"lns\"},\"id\":\"aalnjixi\",\"name\":\"xyawj\",\"type\":\"yaqcslyjpkiidz\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.storageTasks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("rnxipei", response.iterator().next().location()); - Assertions.assertEquals("zuaejxd", response.iterator().next().tags().get("ltskzbbtd")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals(false, response.iterator().next().properties().enabled()); - Assertions.assertEquals("qzcjrvxdj", response.iterator().next().properties().description()); - Assertions.assertEquals("lmwlxkvugfhzo", - response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - response.iterator().next().properties().action().elseProperty().operations().get(0).name()); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java deleted file mode 100644 index 3de043404e08..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListResultTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; - -public final class StorageTasksListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTasksListResult model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"principalId\":\"9a82585b-8c70-457f-be4d-d4a7ff3ebd78\",\"tenantId\":\"f13b9c35-d0be-4219-b0cd-41115cf52d83\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"y\":{\"principalId\":\"8ac2b76d-446c-408f-b2db-d42ff21ce0d6\",\"clientId\":\"a521fd52-3797-459c-9dfb-299f537a9d8a\"},\"jbdlwtgrhpdjpju\":{\"principalId\":\"1aa6ef3f-64ca-47a0-a6f8-4039721c8031\",\"clientId\":\"48ab0012-d1b5-4124-8085-2b83572ddab6\"}}},\"properties\":{\"taskVersion\":4349636942449523138,\"enabled\":false,\"description\":\"jpqyegu\",\"action\":{\"if\":{\"condition\":\"lhbxxhejjzzvdud\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobTier\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobExpiry\"},{\"name\":\"DeleteBlob\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobTags\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-01-27T06:45:01Z\"},\"location\":\"lbjnpgacftadehx\",\"tags\":{\"uesnzwdejbavo\":\"yfsoppu\",\"vudwx\":\"xzdmohctb\",\"gujjugwdkcglh\":\"ndnvo\",\"ofqweykhmenevfye\":\"lazjdyggdtjixhbk\"},\"id\":\"fwhybcibvy\",\"name\":\"dcsi\",\"type\":\"ynnaam\"},{\"identity\":{\"principalId\":\"c9581b8d-e48f-45c2-8ef6-2d0bafae7051\",\"tenantId\":\"6964b505-46ad-4173-84d0-937de7125ca5\",\"type\":\"None\",\"userAssignedIdentities\":{\"scjeypv\":{\"principalId\":\"aa1bba3c-ff2c-4e3c-a503-4acc92b34f8c\",\"clientId\":\"ad3aeb49-2dbc-4bb4-8dfe-062918f5e9fd\"}}},\"properties\":{\"taskVersion\":3144809064731797978,\"enabled\":true,\"description\":\"q\",\"action\":{\"if\":{\"condition\":\"c\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobTags\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-08-20T18:32:02Z\"},\"location\":\"xyqj\",\"tags\":{\"jh\":\"attpngjcrcczsq\",\"ysou\":\"mdajv\",\"canoaeupf\":\"q\",\"tuo\":\"yhltrpmopjmcm\"},\"id\":\"thfuiuaodsfcpkvx\",\"name\":\"dpuozmyz\",\"type\":\"dagfuaxbezyiuok\"},{\"identity\":{\"principalId\":\"7abefcb7-54cb-4c58-80d2-f99814d5bd39\",\"tenantId\":\"7c262389-b77b-436a-9097-9fd2e69bbead\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ywqsmbsurexim\":{\"principalId\":\"3160fc5c-f952-4c46-9627-c8b67807e8a4\",\"clientId\":\"4d415a62-69e3-4dfc-af79-6df2c81b37ee\"}}},\"properties\":{\"taskVersion\":4342038682597268889,\"enabled\":true,\"description\":\"sfksy\",\"action\":{\"if\":{\"condition\":\"ddystkiiuxhqy\",\"operations\":[{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobTags\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTags\"},{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobImmutabilityPolicy\"}]}},\"provisioningState\":\"Canceled\",\"creationTimeInUtc\":\"2021-06-20T18:48:12Z\"},\"location\":\"qrvkdv\",\"tags\":{\"d\":\"lrmv\"},\"id\":\"watkpnpulexxb\",\"name\":\"zwtruwiqzbqjvsov\",\"type\":\"yokacspkw\"},{\"identity\":{\"principalId\":\"100c714d-fbcc-4335-b4d9-914a60339a07\",\"tenantId\":\"e2806682-cf64-4165-87c3-2286899c033b\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"mflbv\":{\"principalId\":\"5b9004d1-5fd8-43cd-8cfb-65c0de1f1893\",\"clientId\":\"53b3ac07-1273-4430-b7d5-a466cd66b1de\"},\"hrk\":{\"principalId\":\"ecfa24f1-189c-4599-bb30-e6e041ef7476\",\"clientId\":\"3c612036-5627-4c9f-b75e-6720f8cd88ca\"},\"wwzjuqkhrsajiwku\":{\"principalId\":\"f494e34c-1fa7-431b-8bd3-5af7990b0bb2\",\"clientId\":\"a5b787e5-07a8-450c-b623-b33f13ecda41\"},\"skghsauuimj\":{\"principalId\":\"e6b7e025-c8d3-4210-97e7-ace78aaadd53\",\"clientId\":\"a4fb3aaf-bf97-4005-ba12-960390de3e86\"}}},\"properties\":{\"taskVersion\":2519768107676496444,\"enabled\":true,\"description\":\"uugidyjrrfby\",\"action\":{\"if\":{\"condition\":\"osvexcsonpclhoc\",\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobTier\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-09-05T06:09:57Z\"},\"location\":\"fmvfaxkffeiit\",\"tags\":{\"zy\":\"m\",\"burvjxxjnspy\":\"shxmzsbbzoggigrx\"},\"id\":\"ptkoenkoukn\",\"name\":\"udwtiukbl\",\"type\":\"ngkpocipazy\"}],\"nextLink\":\"egukgjnpiucg\"}") - .toObject(StorageTasksListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTasksListResult model = new StorageTasksListResult(); - model = BinaryData.fromObject(model).toObject(StorageTasksListResult.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java deleted file mode 100644 index 2ff9d267bd2b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class StorageTasksReportsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr - = "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"dxbx\",\"storageAccountId\":\"kbogqxndlkzgx\",\"startTime\":\"ripl\",\"finishTime\":\"odxun\",\"objectsTargetedCount\":\"ebxmubyynt\",\"objectsOperatedOnCount\":\"rbqtkoie\",\"objectFailedCount\":\"eotg\",\"objectsSucceededCount\":\"l\",\"runStatusError\":\"muwlauwzizxbm\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"efuzmuvpbttd\",\"taskId\":\"orppxebmnzbtb\",\"taskVersion\":\"pglkf\",\"runResult\":\"Failed\"},\"id\":\"neuelfphsdyhtoz\",\"name\":\"ikdowwquuvx\",\"type\":\"xclvit\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito.when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito.when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito.when(httpClient.send(httpRequest.capture(), Mockito.any())).thenReturn(Mono.defer(() -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - StorageActionsManager manager = StorageActionsManager.configure().withHttpClient(httpClient).authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.storageTasksReports().list("onz", "nsikvmkqzeqqkdl", - "fzxmhhvhgureodkw", "bdagxt", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 9397d6819935..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.storageactions.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.storageactions.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"eded3b74-4167-4eb3-adb2-cda22ccc66c8\",\"clientId\":\"a1a78edd-a6d5-4b18-9801-3da6e35db64f\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}