diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md index 84e109562872..afc9aee7a8df 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/CHANGELOG.md @@ -1,14 +1,139 @@ # Release History -## 1.0.0-beta.4 (Unreleased) +## 1.0.0-beta.4 (2025-05-09) -### Features Added +- Azure Resource Manager StorageActions client library for Java. This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ### Breaking Changes -### Bugs Fixed +#### `models.StorageTaskReportSummary` was removed + +#### `models.StorageTasksReports` was removed + +#### `models.StorageTaskPreviewActionProperties` was removed + +#### `models.StorageTasksListResult` was removed + +#### `models.StorageTaskAssignmentsListResult` was removed + +#### `models.StorageTaskProperties` was removed + +#### `models.OperationListResult` was removed + +#### `models.StorageTaskAssignments` was removed + +#### `models.StorageTask$DefinitionStages` was modified + +* Required stage 5, 6 was added +* `withProperties(models.StorageTaskProperties)` was removed in stage 4 + +#### `models.StorageTask` was modified + +* `properties()` was removed + +#### `models.StorageTaskPreviewAction` was modified + +* `properties()` was removed + +#### `models.StorageTask$Definition` was modified + +* `withProperties(models.StorageTaskProperties)` was removed + +#### `models.StorageTasks` was modified + +* `list(com.azure.core.util.Context)` was removed +* `previewActionsWithResponse(java.lang.String,fluent.models.StorageTaskPreviewActionInner,com.azure.core.util.Context)` was removed +* `list()` was removed +* `previewActions(java.lang.String,fluent.models.StorageTaskPreviewActionInner)` was removed + +#### `models.StorageTask$Update` was modified + +* `withProperties(models.StorageTaskProperties)` was removed + +#### `models.StorageTaskUpdateParameters` was modified + +* `withProperties(models.StorageTaskProperties)` was removed +* `properties()` was removed + +#### `models.UserAssignedIdentity` was modified + +* `java.util.UUID principalId()` -> `java.lang.String principalId()` +* `java.util.UUID clientId()` -> `java.lang.String clientId()` + +#### `StorageActionsManager` was modified + +* `fluent.StorageActionsMgmtClient serviceClient()` -> `fluent.StorageActionsClient serviceClient()` +* `storageTaskAssignments()` was removed +* `storageTasksReports()` was removed + +#### `models.ManagedServiceIdentity` was modified + +* `java.util.UUID tenantId()` -> `java.lang.String tenantId()` +* `java.util.UUID principalId()` -> `java.lang.String principalId()` + +### Features Added + +* `implementation.models.OperationListResult` was added + +* `implementation.models.StorageTaskReportSummary` was added + +* `implementation.models.StorageTasksListResult` was added + +* `models.StorageTasksOperationGroups` was added + +* `implementation.models.StorageTaskAssignmentsListResult` was added + +#### `models.StorageTask` was modified + +* `provisioningState()` was added +* `action()` was added +* `description()` was added +* `creationTimeInUtc()` was added +* `enabled()` was added +* `taskVersion()` was added + +#### `models.StorageTaskPreviewAction` was modified + +* `container()` was added +* `action()` was added +* `blobs()` was added + +#### `models.StorageTask$Definition` was modified + +* `withDescription(java.lang.String)` was added +* `withEnabled(boolean)` was added +* `withAction(models.StorageTaskAction)` was added + +#### `models.StorageTasks` was modified + +* `listBySubscription(com.azure.core.util.Context)` was added +* `list(java.lang.String,java.lang.String,java.lang.Integer,java.lang.String,com.azure.core.util.Context)` was added +* `list(java.lang.String,java.lang.String)` was added +* `storageTaskAssignmentList(java.lang.String,java.lang.String,java.lang.Integer,com.azure.core.util.Context)` was added +* `storageTaskAssignmentList(java.lang.String,java.lang.String)` was added +* `listBySubscription()` was added + +#### `models.StorageTask$Update` was modified + +* `withDescription(java.lang.String)` was added +* `withAction(models.StorageTaskAction)` was added +* `withEnabled(java.lang.Boolean)` was added + +#### `models.StorageTaskUpdateParameters` was modified + +* `provisioningState()` was added +* `creationTimeInUtc()` was added +* `enabled()` was added +* `withEnabled(java.lang.Boolean)` was added +* `action()` was added +* `taskVersion()` was added +* `description()` was added +* `withAction(models.StorageTaskAction)` was added +* `withDescription(java.lang.String)` was added + +#### `StorageActionsManager` was modified -### Other Changes +* `storageTasksOperationGroups()` was added ## 1.0.0-beta.3 (2025-04-18) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/README.md b/sdk/storageactions/azure-resourcemanager-storageactions/README.md index e086619eb030..0b60aecd1f1d 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/README.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/README.md @@ -2,7 +2,7 @@ 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). +This package contains Microsoft Azure SDK for StorageActions Management SDK. The Azure Storage Actions Management API. For documentation on how to use this package, please see [Azure Management Libraries for Java](https://aka.ms/azsdk/java/mgmt). ## We'd love to hear your feedback @@ -32,7 +32,7 @@ Various documentation is available to help you get started com.azure.resourcemanager azure-resourcemanager-storageactions - 1.0.0-beta.3 + 1.0.0-beta.4 ``` [//]: # ({x-version-update-end}) @@ -70,6 +70,26 @@ See [API design][design] for general introduction on design and key concepts on ## Examples +```java +Map operationMap = new LinkedHashMap<>(); +operationMap.put("tier", "Hot"); +storageTask = storageActionsManager.storageTasks() + .define(taskName) + .withRegion(REGION) + .withExistingResourceGroup(resourceGroupName) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) + .withProperties(new StorageTaskProperties() + .withAction(new StorageTaskAction() + .withIfProperty(new IfCondition().withCondition("[[[equals(AccessTier, 'Cool')]]") + .withOperations(Arrays + .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) + .withParameters(operationMap) + .withOnSuccess(OnSuccess.CONTINUE) + .withOnFailure(OnFailure.BREAK))))) + .withDescription("Storage task") + .withEnabled(true)) + .create(); +``` [Code snippets and samples](https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md) diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md index 9b8685b7c7d9..77e24ff3efbd 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md +++ b/sdk/storageactions/azure-resourcemanager-storageactions/SAMPLE.md @@ -1,439 +1,2 @@ # Code snippets and samples - -## Operations - -- [List](#operations_list) - -## StorageTaskAssignment - -- [List](#storagetaskassignment_list) - -## StorageTasks - -- [Create](#storagetasks_create) -- [Delete](#storagetasks_delete) -- [GetByResourceGroup](#storagetasks_getbyresourcegroup) -- [List](#storagetasks_list) -- [ListByResourceGroup](#storagetasks_listbyresourcegroup) -- [PreviewActions](#storagetasks_previewactions) -- [Update](#storagetasks_update) - -## StorageTasksReport - -- [List](#storagetasksreport_list) -### Operations_List - -```java -/** - * Samples for StorageTasksReport List. - */ -public final class StorageTasksReportListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksRunReportSummary.json - */ - /** - * Sample code: ListStorageTasksByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasksReports().list("rgroup1", "mytask1", null, null, com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTaskAssignment_List - -```java -/** - * Samples for StorageTasks Delete. - */ -public final class StorageTasksDeleteSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/DeleteStorageTask.json - */ - /** - * Sample code: DeleteStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void deleteStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().delete("res4228", "mytask1", com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTasks_Create - -```java -/** - * Samples for StorageTasks GetByResourceGroup. - */ -public final class StorageTasksGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/GetStorageTask.json - */ - /** - * Sample code: GetStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void getStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTasks_Delete - -```java -/** - * Samples for StorageTaskAssignment List. - */ -public final class StorageTaskAssignmentListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTaskAssignmentIds.json - */ - /** - * Sample code: ListStorageTaskAssignmentsByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void listStorageTaskAssignmentsByResourceGroup( - com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTaskAssignments().list("rgroup1", "mytask1", null, com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTasks_GetByResourceGroup - -```java -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * OperationsList.json - */ - /** - * Sample code: OperationsList. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void operationsList(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTasks_List - -```java -/** - * Samples for StorageTasks ListByResourceGroup. - */ -public final class StorageTasksListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksByResourceGroup.json - */ - /** - * Sample code: ListStorageTasksByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); - } -} -``` - -### StorageTasks_ListByResourceGroup - -```java -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewKeyValueProperties; -import java.util.Arrays; - -/** - * Samples for StorageTasks PreviewActions. - */ -public final class StorageTasksPreviewActionsSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * PerformStorageTaskActionsPreview.json - */ - /** - * Sample code: PerformStorageTaskActionsPreview. - * - * @param manager Entry point to StorageActionsManager. - */ - 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); - } -} -``` - -### StorageTasks_PreviewActions - -```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; -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; - -/** - * Samples for StorageTasks Create. - */ -public final class StorageTasksCreateSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PutStorageTask.json - */ - /** - * Sample code: PutStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - 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(); - } - - // 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; - } -} -``` - -### StorageTasks_Update - -```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; -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; - -/** - * Samples for StorageTasks Update. - */ -public final class StorageTasksUpdateSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PatchStorageTask.json - */ - /** - * Sample code: PatchStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - StorageTask resource = manager.storageTasks() - .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .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(); - } - - // 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; - } -} -``` - -### StorageTasksReport_List - -```java -/** - * Samples for StorageTasks List. - */ -public final class StorageTasksListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksBySubscription.json - */ - /** - * Sample code: ListStorageTasksBySubscription. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksBySubscription(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().list(com.azure.core.util.Context.NONE); - } -} -``` - diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml index 3ca5800c36cc..4e35d47012d3 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml +++ b/sdk/storageactions/azure-resourcemanager-storageactions/pom.xml @@ -1,7 +1,7 @@ 4.0.0 @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for StorageActions Management - This package contains Microsoft Azure SDK for StorageActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Storage Actions Management API. Package tag package-2023-01-01. + This package contains Microsoft Azure SDK for StorageActions Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Azure Storage Actions Management API. https://github.com/Azure/azure-sdk-for-java 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 e17b94b7573a..4c616deef506 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions; @@ -24,16 +24,14 @@ import com.azure.core.util.Configuration; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storageactions.fluent.StorageActionsMgmtClient; +import com.azure.resourcemanager.storageactions.fluent.StorageActionsClient; import com.azure.resourcemanager.storageactions.implementation.OperationsImpl; -import com.azure.resourcemanager.storageactions.implementation.StorageActionsMgmtClientBuilder; -import com.azure.resourcemanager.storageactions.implementation.StorageTaskAssignmentsImpl; +import com.azure.resourcemanager.storageactions.implementation.StorageActionsClientBuilder; import com.azure.resourcemanager.storageactions.implementation.StorageTasksImpl; -import com.azure.resourcemanager.storageactions.implementation.StorageTasksReportsImpl; +import com.azure.resourcemanager.storageactions.implementation.StorageTasksOperationGroupsImpl; import com.azure.resourcemanager.storageactions.models.Operations; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignments; import com.azure.resourcemanager.storageactions.models.StorageTasks; -import com.azure.resourcemanager.storageactions.models.StorageTasksReports; +import com.azure.resourcemanager.storageactions.models.StorageTasksOperationGroups; import java.time.Duration; import java.time.temporal.ChronoUnit; import java.util.ArrayList; @@ -51,16 +49,14 @@ public final class StorageActionsManager { private StorageTasks storageTasks; - private StorageTaskAssignments storageTaskAssignments; + private StorageTasksOperationGroups storageTasksOperationGroups; - private StorageTasksReports storageTasksReports; - - private final StorageActionsMgmtClient clientObject; + private final StorageActionsClient clientObject; private StorageActionsManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = new StorageActionsMgmtClientBuilder().pipeline(httpPipeline) + this.clientObject = new StorageActionsClientBuilder().pipeline(httpPipeline) .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) .subscriptionId(profile.getSubscriptionId()) .defaultPollInterval(defaultPollInterval) @@ -295,37 +291,25 @@ public StorageTasks storageTasks() { } /** - * Gets the resource collection API of StorageTaskAssignments. - * - * @return Resource collection API of StorageTaskAssignments. - */ - public StorageTaskAssignments storageTaskAssignments() { - if (this.storageTaskAssignments == null) { - this.storageTaskAssignments - = new StorageTaskAssignmentsImpl(clientObject.getStorageTaskAssignments(), this); - } - return storageTaskAssignments; - } - - /** - * Gets the resource collection API of StorageTasksReports. + * Gets the resource collection API of StorageTasksOperationGroups. * - * @return Resource collection API of StorageTasksReports. + * @return Resource collection API of StorageTasksOperationGroups. */ - public StorageTasksReports storageTasksReports() { - if (this.storageTasksReports == null) { - this.storageTasksReports = new StorageTasksReportsImpl(clientObject.getStorageTasksReports(), this); + public StorageTasksOperationGroups storageTasksOperationGroups() { + if (this.storageTasksOperationGroups == null) { + this.storageTasksOperationGroups + = new StorageTasksOperationGroupsImpl(clientObject.getStorageTasksOperationGroups(), this); } - return storageTasksReports; + return storageTasksOperationGroups; } /** - * Gets wrapped service client StorageActionsMgmtClient providing direct access to the underlying auto-generated API + * Gets wrapped service client StorageActionsClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. * - * @return Wrapped service client StorageActionsMgmtClient. + * @return Wrapped service client StorageActionsClient. */ - public StorageActionsMgmtClient serviceClient() { + public StorageActionsClient serviceClient() { return this.clientObject; } } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java index a3947f6b6c4d..9b6c80f45667 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsClient.java similarity index 67% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsClient.java index 9026d03806e1..d935f9c8ea3b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsMgmtClient.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageActionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent; @@ -8,30 +8,30 @@ import java.time.Duration; /** - * The interface for StorageActionsMgmtClient class. + * The interface for StorageActionsClient class. */ -public interface StorageActionsMgmtClient { +public interface StorageActionsClient { /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -61,16 +61,9 @@ public interface StorageActionsMgmtClient { StorageTasksClient getStorageTasks(); /** - * Gets the StorageTaskAssignmentsClient object to access its operations. - * - * @return the StorageTaskAssignmentsClient object. - */ - StorageTaskAssignmentsClient getStorageTaskAssignments(); - - /** - * Gets the StorageTasksReportsClient object to access its operations. + * Gets the StorageTasksOperationGroupsClient object to access its operations. * - * @return the StorageTasksReportsClient object. + * @return the StorageTasksOperationGroupsClient object. */ - StorageTasksReportsClient getStorageTasksReports(); + StorageTasksOperationGroupsClient getStorageTasksOperationGroups(); } 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 deleted file mode 100644 index 30a4aef3fda1..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTaskAssignmentsClient.java +++ /dev/null @@ -1,48 +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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; - -/** - * An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. - */ -public interface StorageTaskAssignmentsClient { - /** - * 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String storageTaskName); - - /** - * 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 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, Context context); -} 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 cf2344edb832..92d8cf6d859f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent; @@ -11,14 +11,45 @@ import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; /** * An instance of this class provides access to all the operations defined in StorageTasksClient. */ public interface StorageTasksClient { + /** + * Get the storage task properties. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context); + + /** + * Get the storage task properties. + * + * @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. + * @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 storage task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName); + /** * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already * created and a subsequent create request is issued with different properties, the storage task properties will be @@ -97,155 +128,150 @@ StorageTaskInner create(String resourceGroupName, String storageTaskName, Storag Context context); /** - * Delete the storage task resource. + * Update storage task properties. * * @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 parameters The parameters to provide to update the storage task resource. * @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 {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of represents Storage Task. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName); + SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters); /** - * Delete the storage task resource. + * Update storage task properties. * * @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 parameters The parameters to provide to update the storage task resource. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of long-running operation. + * @return the {@link SyncPoller} for polling of represents Storage Task. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName, Context context); + SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters, Context context); /** - * Delete the storage task resource. + * Update storage task properties. * * @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 parameters The parameters to provide to update the storage task resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents Storage Task. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String storageTaskName); + StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters); /** - * Delete the storage task resource. + * Update storage task properties. * * @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 parameters The parameters to provide to update the storage task resource. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents Storage Task. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String storageTaskName, Context context); + StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, + Context context); /** - * Get the storage task properties. + * Delete the storage task resource. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties along with {@link Response}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName); /** - * Get the storage task properties. + * Delete the storage task resource. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName, Context context); /** - * Update storage task properties. + * Delete the storage task resource. * * @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 parameters The parameters to provide to update the storage task resource. * @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 {@link SyncPoller} for polling of represents Storage Task. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String storageTaskName); /** - * Update storage task properties. + * Delete the storage task resource. * * @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 parameters The parameters to provide to update the storage task resource. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents Storage Task. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String storageTaskName, Context context); /** - * Update storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 parameters The parameters to provide to update the storage task resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents Storage Task. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Update storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 parameters The parameters to provide to update the storage task resource. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents Storage Task. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageTaskInner update(String resourceGroupName, String storageTaskName, StorageTaskUpdateParameters parameters, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Lists all the storage tasks available under the subscription. @@ -255,7 +281,7 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); + PagedIterable listBySubscription(); /** * Lists all the storage tasks available under the subscription. @@ -267,58 +293,71 @@ StorageTaskInner update(String resourceGroupName, String storageTaskName, Storag * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); + PagedIterable listBySubscription(Context context); /** - * Lists all the storage tasks available under the given resource group. + * Fetch the storage tasks run report summary for each assignment. * * @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. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(String resourceGroupName, String storageTaskName); /** - * Lists all the storage tasks available under the given resource group. + * Fetch the storage tasks run report summary for each assignment. * * @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 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. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String storageTaskName, + Integer maxpagesize, String filter, Context context); /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. - * @param context The context to associate with this operation. + * @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. * @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 storage Task Preview Action along with {@link Response}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response previewActionsWithResponse(String location, - StorageTaskPreviewActionInner parameters, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName); /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return storage Task Preview Action. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName, Integer maxpagesize, Context context); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksOperationGroupsClient.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksOperationGroupsClient.java new file mode 100644 index 000000000000..30c74d5be203 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksOperationGroupsClient.java @@ -0,0 +1,44 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.storageactions.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; + +/** + * An instance of this class provides access to all the operations defined in StorageTasksOperationGroupsClient. + */ +public interface StorageTasksOperationGroupsClient { + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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 storage Task Preview Action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters); +} 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 deleted file mode 100644 index 14686bc66f02..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/StorageTasksReportsClient.java +++ /dev/null @@ -1,49 +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.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; - -/** - * An instance of this class provides access to all the operations defined in StorageTasksReportsClient. - */ -public interface StorageTasksReportsClient { - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String storageTaskName); - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, String filter, Context context); -} 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 9cbc6d0c5eff..e442ec4acd3f 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 @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,7 +19,7 @@ * * Details of a REST API operation, returned from the Resource Provider Operations API. */ -@Fluent +@Immutable public final class OperationInner implements JsonSerializable { /* * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: @@ -28,8 +28,8 @@ public final class OperationInner implements JsonSerializable { 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 Azure + * Resource Manager/control-plane operations. */ private Boolean isDataAction; @@ -45,14 +45,14 @@ public final class OperationInner implements JsonSerializable { private Origin origin; /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ private ActionType actionType; /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -67,7 +67,7 @@ public String name() { /** * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -84,17 +84,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and * audit logs UX. Default value is "user,system". @@ -106,8 +95,8 @@ public Origin origin() { } /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Get the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ 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 0e3b3ccb6a4f..befa741750c6 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent.models; @@ -24,7 +24,7 @@ public final class StorageTaskAssignmentInner implements JsonSerializable tags) { return this; } + /** + * Get the taskVersion property: Storage task version. + * + * @return the taskVersion value. + */ + public Long taskVersion() { + return this.innerProperties() == null ? null : this.innerProperties().taskVersion(); + } + + /** + * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @return the enabled value. + */ + public boolean enabled() { + return this.innerProperties() == null ? false : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled the enabled value to set. + * @return the StorageTaskInner object itself. + */ + public StorageTaskInner withEnabled(boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Text that describes the purpose of the storage task. + * + * @param description the description value to set. + * @return the StorageTaskInner object itself. + */ + public StorageTaskInner withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskProperties(); + } + this.innerProperties().withDescription(description); + return this; + } + + /** + * Get the action property: The storage task action that is executed. + * + * @return the action value. + */ + public StorageTaskAction action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: The storage task action that is executed. + * + * @param action the action value to set. + * @return the StorageTaskInner object itself. + */ + public StorageTaskInner withAction(StorageTaskAction action) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC. + * + * @return the creationTimeInUtc value. + */ + public OffsetDateTime creationTimeInUtc() { + return this.innerProperties() == null ? null : this.innerProperties().creationTimeInUtc(); + } + /** * Validates the instance. * @@ -166,11 +253,12 @@ public void validate() { } else { identity().validate(); } - if (properties() == null) { + if (innerProperties() == null) { throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property properties in model StorageTaskInner")); + .log(new IllegalArgumentException( + "Missing required property innerProperties in model StorageTaskInner")); } else { - properties().validate(); + innerProperties().validate(); } } @@ -185,7 +273,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("identity", this.identity); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -219,7 +307,7 @@ public static StorageTaskInner fromJson(JsonReader jsonReader) throws IOExceptio } else if ("identity".equals(fieldName)) { deserializedStorageTaskInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("properties".equals(fieldName)) { - deserializedStorageTaskInner.properties = StorageTaskProperties.fromJson(reader); + deserializedStorageTaskInner.innerProperties = StorageTaskProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedStorageTaskInner.systemData = SystemData.fromJson(reader); } else { 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 d30d24d7e145..aa0d0ee9514e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent.models; @@ -10,8 +10,11 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; import java.io.IOException; +import java.util.List; /** * Storage Task Preview Action. @@ -21,7 +24,7 @@ public final class StorageTaskPreviewActionInner implements JsonSerializable blobs() { + return this.innerProperties() == null ? null : this.innerProperties().blobs(); + } + + /** + * 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 StorageTaskPreviewActionInner object itself. + */ + public StorageTaskPreviewActionInner withBlobs(List blobs) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskPreviewActionProperties(); + } + this.innerProperties().withBlobs(blobs); + return this; + } + + /** + * Get the action property: Preview action to test. + * + * @return the action value. + */ + public StorageTaskPreviewActionCondition action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Preview action to test. + * + * @param action the action value to set. * @return the StorageTaskPreviewActionInner object itself. */ - public StorageTaskPreviewActionInner withProperties(StorageTaskPreviewActionProperties properties) { - this.properties = properties; + public StorageTaskPreviewActionInner withAction(StorageTaskPreviewActionCondition action) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskPreviewActionProperties(); + } + this.innerProperties().withAction(action); return this; } @@ -55,12 +118,12 @@ public StorageTaskPreviewActionInner withProperties(StorageTaskPreviewActionProp * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() == null) { + if (innerProperties() == null) { throw LOGGER.atError() .log(new IllegalArgumentException( - "Missing required property properties in model StorageTaskPreviewActionInner")); + "Missing required property innerProperties in model StorageTaskPreviewActionInner")); } else { - properties().validate(); + innerProperties().validate(); } } @@ -72,7 +135,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -94,7 +157,7 @@ public static StorageTaskPreviewActionInner fromJson(JsonReader jsonReader) thro reader.nextToken(); if ("properties".equals(fieldName)) { - deserializedStorageTaskPreviewActionInner.properties + deserializedStorageTaskPreviewActionInner.innerProperties = StorageTaskPreviewActionProperties.fromJson(reader); } else { reader.skipChildren(); 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/fluent/models/StorageTaskPreviewActionProperties.java similarity index 94% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionProperties.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskPreviewActionProperties.java index 5077d47426e2..a7bdcf853da3 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/fluent/models/StorageTaskPreviewActionProperties.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.logging.ClientLogger; @@ -10,6 +10,9 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; import java.io.IOException; import java.util.List; 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/fluent/models/StorageTaskProperties.java similarity index 96% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskProperties.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskProperties.java index 3dcee77c5ca0..cb3b4236123d 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/fluent/models/StorageTaskProperties.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.util.CoreUtils; @@ -11,6 +11,8 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storageactions.models.ProvisioningState; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; import java.io.IOException; import java.time.OffsetDateTime; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java index 18d428fcd978..88140d453280 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskReportInstanceInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; @@ -16,7 +16,7 @@ /** * Storage Tasks run report instance. */ -@Fluent +@Immutable public final class StorageTaskReportInstanceInner extends ProxyResource { /* * Storage task execution report for a run instance. @@ -46,7 +46,7 @@ public final class StorageTaskReportInstanceInner extends ProxyResource { /** * Creates an instance of StorageTaskReportInstanceInner class. */ - public StorageTaskReportInstanceInner() { + private StorageTaskReportInstanceInner() { } /** @@ -58,17 +58,6 @@ public StorageTaskReportProperties properties() { return this.properties; } - /** - * Set the properties property: Storage task execution report for a run instance. - * - * @param properties the properties value to set. - * @return the StorageTaskReportInstanceInner object itself. - */ - public StorageTaskReportInstanceInner withProperties(StorageTaskReportProperties properties) { - this.properties = properties; - return this; - } - /** * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskUpdateProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskUpdateProperties.java new file mode 100644 index 000000000000..6236fa1ebf12 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/StorageTaskUpdateProperties.java @@ -0,0 +1,206 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.storageactions.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.storageactions.models.ProvisioningState; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * Properties of the storage task. + */ +@Fluent +public final class StorageTaskUpdateProperties implements JsonSerializable { + /* + * Storage task version. + */ + private Long taskVersion; + + /* + * Storage Task is enabled when set to true and disabled when set to false + */ + private Boolean enabled; + + /* + * Text that describes the purpose of the storage task + */ + private String description; + + /* + * The storage task action that is executed + */ + private StorageTaskAction action; + + /* + * Represents the provisioning state of the storage task. + */ + private ProvisioningState provisioningState; + + /* + * The creation date and time of the storage task in UTC. + */ + private OffsetDateTime creationTimeInUtc; + + /** + * Creates an instance of StorageTaskUpdateProperties class. + */ + public StorageTaskUpdateProperties() { + } + + /** + * Get the taskVersion property: Storage task version. + * + * @return the taskVersion value. + */ + public Long taskVersion() { + return this.taskVersion; + } + + /** + * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.enabled; + } + + /** + * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled the enabled value to set. + * @return the StorageTaskUpdateProperties object itself. + */ + public StorageTaskUpdateProperties withEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Set the description property: Text that describes the purpose of the storage task. + * + * @param description the description value to set. + * @return the StorageTaskUpdateProperties object itself. + */ + public StorageTaskUpdateProperties withDescription(String description) { + this.description = description; + return this; + } + + /** + * Get the action property: The storage task action that is executed. + * + * @return the action value. + */ + public StorageTaskAction action() { + return this.action; + } + + /** + * Set the action property: The storage task action that is executed. + * + * @param action the action value to set. + * @return the StorageTaskUpdateProperties object itself. + */ + public StorageTaskUpdateProperties withAction(StorageTaskAction action) { + this.action = action; + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC. + * + * @return the creationTimeInUtc value. + */ + public OffsetDateTime creationTimeInUtc() { + return this.creationTimeInUtc; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (action() != null) { + action().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("enabled", this.enabled); + jsonWriter.writeStringField("description", this.description); + jsonWriter.writeJsonField("action", this.action); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of StorageTaskUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of StorageTaskUpdateProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the StorageTaskUpdateProperties. + */ + public static StorageTaskUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + StorageTaskUpdateProperties deserializedStorageTaskUpdateProperties = new StorageTaskUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("taskVersion".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.taskVersion = reader.getNullable(JsonReader::getLong); + } else if ("enabled".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.enabled = reader.getNullable(JsonReader::getBoolean); + } else if ("description".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.description = reader.getString(); + } else if ("action".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.action = StorageTaskAction.fromJson(reader); + } else if ("provisioningState".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.provisioningState + = ProvisioningState.fromString(reader.getString()); + } else if ("creationTimeInUtc".equals(fieldName)) { + deserializedStorageTaskUpdateProperties.creationTimeInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedStorageTaskUpdateProperties; + }); + } +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java index 62c75a487a6f..e2cb0c25c67e 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for StorageActionsMgmtClient. + * Package containing the inner data models for StorageActions. * The Azure Storage Actions Management API. */ package com.azure.resourcemanager.storageactions.fluent.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java index 7f6af6f52cb1..63a423cca1bb 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for StorageActionsMgmtClient. + * Package containing the service clients for StorageActions. * The Azure Storage Actions Management API. */ package com.azure.resourcemanager.storageactions.fluent; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java index 2d5d3e2b2e36..8f38d0bf1942 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; 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 2dca62e74955..54319289a066 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -25,9 +25,10 @@ import com.azure.core.management.exception.ManagementException; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storageactions.fluent.OperationsClient; import com.azure.resourcemanager.storageactions.fluent.models.OperationInner; -import com.azure.resourcemanager.storageactions.models.OperationListResult; +import com.azure.resourcemanager.storageactions.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -42,31 +43,38 @@ public final class OperationsClientImpl implements OperationsClient { /** * The service client containing this operation class. */ - private final StorageActionsMgmtClientImpl client; + private final StorageActionsClientImpl client; /** * Initializes an instance of OperationsClientImpl. * * @param client the instance of the service client containing this operation class. */ - OperationsClientImpl(StorageActionsMgmtClientImpl client) { + OperationsClientImpl(StorageActionsClientImpl client) { this.service = RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for StorageActionsMgmtClientOperations to be used by the proxy service to + * The interface defining all the services for StorageActionsClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "StorageActionsMgmtCl") + @Host("{endpoint}") + @ServiceInterface(name = "StorageActionsClient") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.StorageActions/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/providers/Microsoft.StorageActions/operations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +82,14 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -103,24 +118,14 @@ private Mono> listSinglePageAsync() { /** * Lists all of the available Storage Actions Rest API operations. * - * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.list(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -128,12 +133,20 @@ private Mono> listSinglePageAsync(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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage() { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -143,13 +156,20 @@ 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 a list of REST API operations supported by an Azure Resource Provider as paginated response with - * {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -162,7 +182,7 @@ private PagedFlux listAsync(Context context) { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list() { - return new PagedIterable<>(listAsync()); + return new PagedIterable<>(() -> listSinglePage(), nextLink -> listNextSinglePage(nextLink)); } /** @@ -177,7 +197,7 @@ public PagedIterable list() { */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + return new PagedIterable<>(() -> listSinglePage(context), nextLink -> listNextSinglePage(nextLink, context)); } /** @@ -206,6 +226,33 @@ private Mono> listNextSinglePageAsync(String nextL .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -214,22 +261,24 @@ private Mono> listNextSinglePageAsync(String nextL * @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 a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. + * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(OperationsClientImpl.class); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java index acff497f39d0..8e8c775b47ac 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/OperationsImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; 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 5ce8a09099f3..f1b733c9a0b4 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; 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/StorageActionsClientBuilder.java similarity index 66% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientBuilder.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsClientBuilder.java index 451e9efb2239..dd88a9f7b3ae 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/StorageActionsClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -15,39 +15,39 @@ import java.time.Duration; /** - * A builder for creating a new instance of the StorageActionsMgmtClientImpl type. + * A builder for creating a new instance of the StorageActionsClientImpl type. */ -@ServiceClientBuilder(serviceClients = { StorageActionsMgmtClientImpl.class }) -public final class StorageActionsMgmtClientBuilder { +@ServiceClientBuilder(serviceClients = { StorageActionsClientImpl.class }) +public final class StorageActionsClientBuilder { /* - * The ID of the target subscription. The value must be an UUID. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. The value must be an UUID. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. - * @return the StorageActionsMgmtClientBuilder. + * @param endpoint the endpoint value. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public StorageActionsClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. - * @return the StorageActionsMgmtClientBuilder. + * @param subscriptionId the subscriptionId value. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public StorageActionsClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -60,9 +60,9 @@ public StorageActionsMgmtClientBuilder endpoint(String endpoint) { * Sets The environment to connect to. * * @param environment the environment value. - * @return the StorageActionsMgmtClientBuilder. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder environment(AzureEnvironment environment) { + public StorageActionsClientBuilder environment(AzureEnvironment environment) { this.environment = environment; return this; } @@ -76,9 +76,9 @@ public StorageActionsMgmtClientBuilder environment(AzureEnvironment environment) * Sets The HTTP pipeline to send requests through. * * @param pipeline the pipeline value. - * @return the StorageActionsMgmtClientBuilder. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder pipeline(HttpPipeline pipeline) { + public StorageActionsClientBuilder pipeline(HttpPipeline pipeline) { this.pipeline = pipeline; return this; } @@ -92,9 +92,9 @@ public StorageActionsMgmtClientBuilder pipeline(HttpPipeline pipeline) { * Sets The default poll interval for long-running operation. * * @param defaultPollInterval the defaultPollInterval value. - * @return the StorageActionsMgmtClientBuilder. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder defaultPollInterval(Duration defaultPollInterval) { + public StorageActionsClientBuilder defaultPollInterval(Duration defaultPollInterval) { this.defaultPollInterval = defaultPollInterval; return this; } @@ -108,19 +108,19 @@ public StorageActionsMgmtClientBuilder defaultPollInterval(Duration defaultPollI * Sets The serializer to serialize an object into a string. * * @param serializerAdapter the serializerAdapter value. - * @return the StorageActionsMgmtClientBuilder. + * @return the StorageActionsClientBuilder. */ - public StorageActionsMgmtClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { + public StorageActionsClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { this.serializerAdapter = serializerAdapter; return this; } /** - * Builds an instance of StorageActionsMgmtClientImpl with the provided parameters. + * Builds an instance of StorageActionsClientImpl with the provided parameters. * - * @return an instance of StorageActionsMgmtClientImpl. + * @return an instance of StorageActionsClientImpl. */ - public StorageActionsMgmtClientImpl buildClient() { + public StorageActionsClientImpl buildClient() { String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; HttpPipeline localPipeline = (pipeline != null) @@ -131,8 +131,8 @@ public StorageActionsMgmtClientImpl buildClient() { SerializerAdapter localSerializerAdapter = (serializerAdapter != null) ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); - StorageActionsMgmtClientImpl client = new StorageActionsMgmtClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + StorageActionsClientImpl client = new StorageActionsClientImpl(localPipeline, localSerializerAdapter, + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } 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/StorageActionsClientImpl.java similarity index 82% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsMgmtClientImpl.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageActionsClientImpl.java index ffaee39e8292..896ac3ab08f5 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/StorageActionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -15,19 +15,21 @@ 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.SyncPollerFactory; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.CoreUtils; import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.AsyncPollResponse; import com.azure.core.util.polling.LongRunningOperationStatus; import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; import com.azure.core.util.serializer.SerializerAdapter; import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.storageactions.fluent.OperationsClient; -import com.azure.resourcemanager.storageactions.fluent.StorageActionsMgmtClient; -import com.azure.resourcemanager.storageactions.fluent.StorageTaskAssignmentsClient; +import com.azure.resourcemanager.storageactions.fluent.StorageActionsClient; import com.azure.resourcemanager.storageactions.fluent.StorageTasksClient; -import com.azure.resourcemanager.storageactions.fluent.StorageTasksReportsClient; +import com.azure.resourcemanager.storageactions.fluent.StorageTasksOperationGroupsClient; import java.io.IOException; import java.lang.reflect.Type; import java.nio.ByteBuffer; @@ -38,31 +40,17 @@ import reactor.core.publisher.Mono; /** - * Initializes a new instance of the StorageActionsMgmtClientImpl type. + * Initializes a new instance of the StorageActionsClientImpl type. */ -@ServiceClient(builder = StorageActionsMgmtClientBuilder.class) -public final class StorageActionsMgmtClientImpl implements StorageActionsMgmtClient { +@ServiceClient(builder = StorageActionsClientBuilder.class) +public final class StorageActionsClientImpl implements StorageActionsClient { /** - * The ID of the target subscription. The value must be an UUID. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. The value must be an UUID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -71,12 +59,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -84,6 +72,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -155,55 +157,40 @@ public StorageTasksClient getStorageTasks() { } /** - * The StorageTaskAssignmentsClient object to access its operations. + * The StorageTasksOperationGroupsClient object to access its operations. */ - private final StorageTaskAssignmentsClient storageTaskAssignments; + private final StorageTasksOperationGroupsClient storageTasksOperationGroups; /** - * Gets the StorageTaskAssignmentsClient object to access its operations. + * Gets the StorageTasksOperationGroupsClient object to access its operations. * - * @return the StorageTaskAssignmentsClient object. + * @return the StorageTasksOperationGroupsClient object. */ - public StorageTaskAssignmentsClient getStorageTaskAssignments() { - return this.storageTaskAssignments; + public StorageTasksOperationGroupsClient getStorageTasksOperationGroups() { + return this.storageTasksOperationGroups; } /** - * The StorageTasksReportsClient object to access its operations. - */ - private final StorageTasksReportsClient storageTasksReports; - - /** - * Gets the StorageTasksReportsClient object to access its operations. - * - * @return the StorageTasksReportsClient object. - */ - public StorageTasksReportsClient getStorageTasksReports() { - return this.storageTasksReports; - } - - /** - * Initializes an instance of StorageActionsMgmtClient client. + * Initializes an instance of StorageActionsClient client. * * @param httpPipeline The HTTP pipeline to send requests through. * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. + * @param endpoint Service host. * @param subscriptionId The ID of the target subscription. The value must be an UUID. - * @param endpoint server parameter. */ - StorageActionsMgmtClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + StorageActionsClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; + this.subscriptionId = subscriptionId; this.apiVersion = "2023-01-01"; this.operations = new OperationsClientImpl(this); this.storageTasks = new StorageTasksClientImpl(this); - this.storageTaskAssignments = new StorageTaskAssignmentsClientImpl(this); - this.storageTasksReports = new StorageTasksReportsClientImpl(this); + this.storageTasksOperationGroups = new StorageTasksOperationGroupsClientImpl(this); } /** @@ -243,6 +230,23 @@ public PollerFlux, U> getLroResult(Mono type of poll result. + * @param type of final result. + * @return SyncPoller for poll result and final result. + */ + public SyncPoller, U> getLroResult(Response activationResponse, + Type pollResultType, Type finalResultType, Context context) { + return SyncPollerFactory.create(serializerAdapter, httpPipeline, pollResultType, finalResultType, + defaultPollInterval, () -> activationResponse, context); + } + /** * Gets the final result, or an error, based on last async poll response. * @@ -332,5 +336,5 @@ public Mono getBodyAsString(Charset charset) { } } - private static final ClientLogger LOGGER = new ClientLogger(StorageActionsMgmtClientImpl.class); + private static final ClientLogger LOGGER = new ClientLogger(StorageActionsClientImpl.class); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java index 10a32260d52e..9227c15cf1db 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; 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 deleted file mode 100644 index 4ec62c40d5ab..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsClientImpl.java +++ /dev/null @@ -1,317 +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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.storageactions.fluent.StorageTaskAssignmentsClient; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignmentsListResult; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in StorageTaskAssignmentsClient. - */ -public final class StorageTaskAssignmentsClientImpl implements StorageTaskAssignmentsClient { - /** - * The proxy service used to perform REST calls. - */ - private final StorageTaskAssignmentsService service; - - /** - * The service client containing this operation class. - */ - private final StorageActionsMgmtClientImpl client; - - /** - * Initializes an instance of StorageTaskAssignmentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - StorageTaskAssignmentsClientImpl(StorageActionsMgmtClientImpl client) { - this.service = RestProxy.create(StorageTaskAssignmentsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageActionsMgmtClientStorageTaskAssignments to be used by the - * proxy service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageActionsMgmtCl") - public interface StorageTaskAssignmentsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/storageTaskAssignments") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * 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 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. - * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String storageTaskName, Integer maxpagesize) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, storageTaskName, - maxpagesize, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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. - * @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 - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String storageTaskName, Integer maxpagesize, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, storageTaskName, maxpagesize, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * 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 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. - * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName, - Integer maxpagesize) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName) { - final Integer maxpagesize = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName, - Integer maxpagesize, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String storageTaskName) { - final Integer maxpagesize = null; - return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize)); - } - - /** - * 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 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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. - * @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 - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java deleted file mode 100644 index 772bb88c9657..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskAssignmentsImpl.java +++ /dev/null @@ -1,47 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storageactions.fluent.StorageTaskAssignmentsClient; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignments; - -public final class StorageTaskAssignmentsImpl implements StorageTaskAssignments { - private static final ClientLogger LOGGER = new ClientLogger(StorageTaskAssignmentsImpl.class); - - private final StorageTaskAssignmentsClient innerClient; - - private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; - - public StorageTaskAssignmentsImpl(StorageTaskAssignmentsClient innerClient, - com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String storageTaskName) { - PagedIterable inner = this.serviceClient().list(resourceGroupName, storageTaskName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); - } - - private StorageTaskAssignmentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { - return this.serviceManager; - } -} 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 a749eedb6859..9f96d0b3f91d 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -9,9 +9,11 @@ import com.azure.core.util.Context; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; import com.azure.resourcemanager.storageactions.models.ManagedServiceIdentity; +import com.azure.resourcemanager.storageactions.models.ProvisioningState; import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskAction; import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; +import java.time.OffsetDateTime; import java.util.Collections; import java.util.Map; @@ -49,14 +51,34 @@ public ManagedServiceIdentity identity() { return this.innerModel().identity(); } - public StorageTaskProperties properties() { - return this.innerModel().properties(); - } - public SystemData systemData() { return this.innerModel().systemData(); } + public Long taskVersion() { + return this.innerModel().taskVersion(); + } + + public boolean enabled() { + return this.innerModel().enabled(); + } + + public String description() { + return this.innerModel().description(); + } + + public StorageTaskAction action() { + return this.innerModel().action(); + } + + public ProvisioningState provisioningState() { + return this.innerModel().provisioningState(); + } + + public OffsetDateTime creationTimeInUtc() { + return this.innerModel().creationTimeInUtc(); + } + public Region region() { return Region.fromName(this.regionName()); } @@ -171,12 +193,27 @@ public StorageTaskImpl withIdentity(ManagedServiceIdentity identity) { } } - public StorageTaskImpl withProperties(StorageTaskProperties properties) { + public StorageTaskImpl withEnabled(boolean enabled) { + this.innerModel().withEnabled(enabled); + return this; + } + + public StorageTaskImpl withDescription(String description) { if (isInCreateMode()) { - this.innerModel().withProperties(properties); + this.innerModel().withDescription(description); return this; } else { - this.updateParameters.withProperties(properties); + this.updateParameters.withDescription(description); + return this; + } + } + + public StorageTaskImpl withAction(StorageTaskAction action) { + if (isInCreateMode()) { + this.innerModel().withAction(action); + return this; + } else { + this.updateParameters.withAction(action); return this; } } @@ -191,6 +228,11 @@ public StorageTaskImpl withTags(Map tags) { } } + public StorageTaskImpl withEnabled(Boolean enabled) { + this.updateParameters.withEnabled(enabled); + return this; + } + private boolean isInCreateMode() { return this.innerModel().id() == null; } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java index 2f8e93761fde..e82f3172d3f6 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskPreviewActionImpl.java @@ -1,12 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewAction; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; +import java.util.Collections; +import java.util.List; public final class StorageTaskPreviewActionImpl implements StorageTaskPreviewAction { private StorageTaskPreviewActionInner innerObject; @@ -19,8 +23,21 @@ public final class StorageTaskPreviewActionImpl implements StorageTaskPreviewAct this.serviceManager = serviceManager; } - public StorageTaskPreviewActionProperties properties() { - return this.innerModel().properties(); + public StorageTaskPreviewContainerProperties container() { + return this.innerModel().container(); + } + + public List blobs() { + List inner = this.innerModel().blobs(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + + public StorageTaskPreviewActionCondition action() { + return this.innerModel().action(); } public StorageTaskPreviewActionInner innerModel() { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java index da65db288bba..23e7f67ac59a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTaskReportInstanceImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; 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 cfa78c8fd4a5..03526637a288 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -14,7 +14,6 @@ import com.azure.core.annotation.HostParam; import com.azure.core.annotation.Patch; import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; import com.azure.core.annotation.Put; import com.azure.core.annotation.QueryParam; import com.azure.core.annotation.ReturnType; @@ -29,15 +28,20 @@ import com.azure.core.http.rest.RestProxy; import com.azure.core.management.exception.ManagementException; import com.azure.core.management.polling.PollResult; +import com.azure.core.util.BinaryData; import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.storageactions.fluent.StorageTasksClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; +import com.azure.resourcemanager.storageactions.implementation.models.StorageTaskAssignmentsListResult; +import com.azure.resourcemanager.storageactions.implementation.models.StorageTaskReportSummary; +import com.azure.resourcemanager.storageactions.implementation.models.StorageTasksListResult; import com.azure.resourcemanager.storageactions.models.StorageTaskUpdateParameters; -import com.azure.resourcemanager.storageactions.models.StorageTasksListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -54,90 +58,195 @@ public final class StorageTasksClientImpl implements StorageTasksClient { /** * The service client containing this operation class. */ - private final StorageActionsMgmtClientImpl client; + private final StorageActionsClientImpl client; /** * Initializes an instance of StorageTasksClientImpl. * * @param client the instance of the service client containing this operation class. */ - StorageTasksClientImpl(StorageActionsMgmtClientImpl client) { + StorageTasksClientImpl(StorageActionsClientImpl client) { this.service = RestProxy.create(StorageTasksService.class, client.getHttpPipeline(), client.getSerializerAdapter()); this.client = client; } /** - * The interface defining all the services for StorageActionsMgmtClientStorageTasks to be used by the proxy service - * to perform REST calls. + * The interface defining all the services for StorageActionsClientStorageTasks to be used by the proxy service to + * perform REST calls. */ - @Host("{$host}") - @ServiceInterface(name = "StorageActionsMgmtCl") + @Host("{endpoint}") + @ServiceInterface(name = "StorageActionsClient") public interface StorageTasksService { @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response getByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Accept") String accept, + Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") @ExpectedResponses({ 200, 201, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageTaskInner parameters, @HeaderParam("Accept") String accept, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageTaskInner parameters, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200, 201, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response createSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageTaskInner parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageTaskUpdateParameters parameters, + Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response updateSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") StorageTaskUpdateParameters parameters, Context context); @Headers({ "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, + Response deleteSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + @PathParam("storageTaskName") String storageTaskName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @BodyParam("application/json") StorageTaskUpdateParameters parameters, @HeaderParam("Accept") String accept, + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/storageTasks") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> listBySubscription(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/storageTasks") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listBySubscriptionSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/reports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/reports") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/storageTaskAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono> storageTaskAssignmentList( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/locations/{location}/previewActions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/storageTaskAssignments") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> previewActions(@HostParam("$host") String endpoint, + Response storageTaskAssignmentListSync(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, - @BodyParam("application/json") StorageTaskPreviewActionInner parameters, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listByResourceGroupNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -145,18 +254,157 @@ Mono> previewActions(@HostParam("$host") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listBySubscriptionNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + Response listBySubscriptionNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response listNextSync(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> storageTaskAssignmentListNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response storageTaskAssignmentListNextSync( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Get the storage task properties. + * + * @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. + * @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 storage task properties along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String storageTaskName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the storage task properties. + * + * @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. + * @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 storage task properties on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono getByResourceGroupAsync(String resourceGroupName, String storageTaskName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the storage task properties. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.getByResourceGroupSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, accept, context); + } + + /** + * Get the storage task properties. + * + * @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. + * @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 storage task properties. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName) { + return getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue(); + } + /** * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already * created and a subsequent create request is issued with different properties, the storage task properties will be @@ -179,6 +427,10 @@ private Mono>> createWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -187,22 +439,69 @@ private Mono>> createWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } if (parameters == null) { return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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 represents Storage Task along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response createWithResponse(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + Context.NONE); + } + /** * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already * created and a subsequent create request is issued with different properties, the storage task properties will be @@ -217,118 +516,361 @@ private Mono>> createWithResponseAsync(String resource * @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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + * @return represents Storage Task along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createWithResponseAsync(String resourceGroupName, String storageTaskName, + private Response createWithResponse(String resourceGroupName, String storageTaskName, StorageTaskInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.createSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + context); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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 {@link PollerFlux} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, StorageTaskInner> beginCreateAsync(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters) { + Mono>> mono = createWithResponseAsync(resourceGroupName, storageTaskName, parameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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 {@link SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters) { + Response response = createWithResponse(resourceGroupName, storageTaskName, parameters); + return this.client.getLroResult(response, StorageTaskInner.class, + StorageTaskInner.class, Context.NONE); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the {@link SyncPoller} for polling of represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, + String storageTaskName, StorageTaskInner parameters, Context context) { + Response response = createWithResponse(resourceGroupName, storageTaskName, parameters, context); + return this.client.getLroResult(response, StorageTaskInner.class, + StorageTaskInner.class, context); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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 represents Storage Task on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String storageTaskName, + StorageTaskInner parameters) { + return beginCreateAsync(resourceGroupName, storageTaskName, parameters).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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 represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters) { + return beginCreate(resourceGroupName, storageTaskName, parameters).getFinalResult(); + } + + /** + * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already + * created and a subsequent create request is issued with different properties, the storage task properties will be + * updated. If a storage task is already created and a subsequent create or update request is issued with the exact + * same set of properties, the request will succeed. + * + * @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 parameters The parameters to create a Storage Task. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return represents Storage Task. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters, + Context context) { + return beginCreate(resourceGroupName, storageTaskName, parameters, context).getFinalResult(); + } + + /** + * Update storage task properties. + * + * @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 parameters The parameters to provide to update the storage task resource. + * @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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Update storage task properties. + * + * @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 parameters The parameters to provide to update the storage task resource. + * @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 represents Storage Task along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + Context.NONE); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. + * @param parameters The parameters to provide to update the storage task resource. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents Storage Task. + * @return represents Storage Task along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageTaskInner> beginCreateAsync(String resourceGroupName, - String storageTaskName, StorageTaskInner parameters) { - Mono>> mono = createWithResponseAsync(resourceGroupName, storageTaskName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response updateWithResponse(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.updateSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, contentType, accept, parameters, + context); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. - * @param context The context to associate with this operation. + * @param parameters The parameters to provide to update the storage task resource. * @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 {@link PollerFlux} for polling of represents Storage Task. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageTaskInner> beginCreateAsync(String resourceGroupName, - String storageTaskName, StorageTaskInner parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = createWithResponseAsync(resourceGroupName, storageTaskName, parameters, context); + private PollerFlux, StorageTaskInner> beginUpdateAsync(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageTaskInner.class, StorageTaskInner.class, context); + StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. + * @param parameters The parameters to provide to update the storage task resource. * @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 {@link SyncPoller} for polling of represents Storage Task. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, - String storageTaskName, StorageTaskInner parameters) { - return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller(); + public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters) { + Response response = updateWithResponse(resourceGroupName, storageTaskName, parameters); + return this.client.getLroResult(response, StorageTaskInner.class, + StorageTaskInner.class, Context.NONE); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. + * @param parameters The parameters to provide to update the storage task resource. * @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. @@ -336,86 +878,57 @@ public SyncPoller, StorageTaskInner> beginCreate(St * @return the {@link SyncPoller} for polling of represents Storage Task. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageTaskInner> beginCreate(String resourceGroupName, - String storageTaskName, StorageTaskInner parameters, Context context) { - return this.beginCreateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller(); - } - - /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. - * - * @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 parameters The parameters to create a Storage Task. - * @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 represents Storage Task on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String storageTaskName, - StorageTaskInner parameters) { - return beginCreateAsync(resourceGroupName, storageTaskName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, + String storageTaskName, StorageTaskUpdateParameters parameters, Context context) { + Response response = updateWithResponse(resourceGroupName, storageTaskName, parameters, context); + return this.client.getLroResult(response, StorageTaskInner.class, + StorageTaskInner.class, context); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. - * @param context The context to associate with this operation. + * @param parameters The parameters to provide to update the storage task resource. * @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 represents Storage Task on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createAsync(String resourceGroupName, String storageTaskName, - StorageTaskInner parameters, Context context) { - return beginCreateAsync(resourceGroupName, storageTaskName, parameters, context).last() + private Mono updateAsync(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + return beginUpdateAsync(resourceGroupName, storageTaskName, parameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. + * @param parameters The parameters to provide to update the storage task resource. * @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 represents Storage Task. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters) { - return createAsync(resourceGroupName, storageTaskName, parameters).block(); + public StorageTaskInner update(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters) { + return beginUpdate(resourceGroupName, storageTaskName, parameters).getFinalResult(); } /** - * Asynchronously creates a new storage task resource with the specified parameters. If a storage task is already - * created and a subsequent create request is issued with different properties, the storage task properties will be - * updated. If a storage task is already created and a subsequent create or update request is issued with the exact - * same set of properties, the request will succeed. + * Update storage task properties. * * @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 parameters The parameters to create a Storage Task. + * @param parameters The parameters to provide to update the storage task resource. * @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. @@ -423,9 +936,9 @@ public StorageTaskInner create(String resourceGroupName, String storageTaskName, * @return represents Storage Task. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskInner create(String resourceGroupName, String storageTaskName, StorageTaskInner parameters, - Context context) { - return createAsync(resourceGroupName, storageTaskName, parameters, context).block(); + public StorageTaskInner update(String resourceGroupName, String storageTaskName, + StorageTaskUpdateParameters parameters, Context context) { + return beginUpdate(resourceGroupName, storageTaskName, parameters, context).getFinalResult(); } /** @@ -445,6 +958,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); @@ -453,14 +970,10 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -470,35 +983,34 @@ private Mono>> deleteWithResponseAsync(String resource * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String storageTaskName, - Context context) { + private Response deleteWithResponse(String resourceGroupName, String storageTaskName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, accept, Context.NONE); } /** @@ -507,16 +1019,35 @@ private Mono>> deleteWithResponseAsync(String resource * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of long-running operation. + * @return the response body along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageTaskName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Response deleteWithResponse(String resourceGroupName, String storageTaskName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + return service.deleteSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, accept, context); } /** @@ -525,19 +1056,16 @@ private PollerFlux, Void> beginDeleteAsync(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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageTaskName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName, context); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String storageTaskName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, storageTaskName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + this.client.getContext()); } /** @@ -553,7 +1081,8 @@ private PollerFlux, Void> beginDeleteAsync(String resourceGroup */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName) { - return this.beginDeleteAsync(resourceGroupName, storageTaskName).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, storageTaskName); + return this.client.getLroResult(response, Void.class, Void.class, Context.NONE); } /** @@ -571,7 +1100,8 @@ public SyncPoller, Void> beginDelete(String resourceGroupName, @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDelete(String resourceGroupName, String storageTaskName, Context context) { - return this.beginDeleteAsync(resourceGroupName, storageTaskName, context).getSyncPoller(); + Response response = deleteWithResponse(resourceGroupName, storageTaskName, context); + return this.client.getLroResult(response, Void.class, Void.class, context); } /** @@ -591,24 +1121,6 @@ private Mono deleteAsync(String resourceGroupName, String storageTaskName) .flatMap(this.client::getLroFinalResultOrError); } - /** - * Delete the storage task resource. - * - * @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 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String storageTaskName, Context context) { - return beginDeleteAsync(resourceGroupName, storageTaskName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - /** * Delete the storage task resource. * @@ -621,7 +1133,7 @@ private Mono deleteAsync(String resourceGroupName, String storageTaskName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String storageTaskName) { - deleteAsync(resourceGroupName, storageTaskName).block(); + beginDelete(resourceGroupName, storageTaskName).getFinalResult(); } /** @@ -637,415 +1149,503 @@ public void delete(String resourceGroupName, String storageTaskName) { */ @ServiceMethod(returns = ReturnType.SINGLE) public void delete(String resourceGroupName, String storageTaskName, Context context) { - deleteAsync(resourceGroupName, storageTaskName, context).block(); + beginDelete(resourceGroupName, storageTaskName, context).getFinalResult(); } /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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. * @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 storage task properties along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String storageTaskName) { + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, - storageTaskName, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage tasks available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String storageTaskName, Context context) { + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String storageTaskName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listByResourceGroupSinglePage(String resourceGroupName, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res = service.listByResourceGroupSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties along with {@link Response}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, storageTaskName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePage(nextLink)); } /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskInner getByResourceGroup(String resourceGroupName, String storageTaskName) { - return getByResourceGroupWithResponse(resourceGroupName, storageTaskName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(() -> listByResourceGroupSinglePage(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePage(nextLink, context)); } /** - * Update storage task properties. + * Lists all the storage tasks available under the subscription. * - * @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 parameters The parameters to provide to update the storage task resource. - * @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 represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters) { + private Mono> listBySubscriptionSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } if (this.client.getSubscriptionId() == null) { return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context)) + .withContext(context -> service.listBySubscription(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update storage task properties. + * Lists all the storage tasks available under the subscription. * - * @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 parameters The parameters to provide to update the storage task resource. - * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents Storage Task along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBySubscriptionAsync() { + return new PagedFlux<>(() -> listBySubscriptionSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @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 Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters, Context context) { + private PagedResponse listBySubscriptionSinglePage() { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + final String accept = "application/json"; + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + + /** + * Lists all the storage tasks available under the subscription. + * + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listBySubscriptionSinglePage(Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), resourceGroupName, storageTaskName, - this.client.getApiVersion(), this.client.getSubscriptionId(), parameters, accept, context); + Response res = service.listBySubscriptionSync(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update storage task properties. + * Lists all the storage tasks available under the subscription. * - * @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 parameters The parameters to provide to update the storage task resource. - * @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 {@link PollerFlux} for polling of represents Storage Task. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageTaskInner> beginUpdateAsync(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageTaskInner.class, StorageTaskInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription() { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(), + nextLink -> listBySubscriptionNextSinglePage(nextLink)); } /** - * Update storage task properties. + * Lists all the storage tasks available under the subscription. * - * @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 parameters The parameters to provide to update the storage task resource. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link PollerFlux} for polling of represents Storage Task. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, StorageTaskInner> beginUpdateAsync(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = updateWithResponseAsync(resourceGroupName, storageTaskName, parameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - StorageTaskInner.class, StorageTaskInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBySubscription(Context context) { + return new PagedIterable<>(() -> listBySubscriptionSinglePage(context), + nextLink -> listBySubscriptionNextSinglePage(nextLink, context)); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents Storage Task. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters) { - return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters).getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String storageTaskName, Integer maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, maxpagesize, filter, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. - * @param context The context to associate with this operation. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the {@link SyncPoller} for polling of represents Storage Task. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, StorageTaskInner> beginUpdate(String resourceGroupName, - String storageTaskName, StorageTaskUpdateParameters parameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName, + Integer maxpagesize, String filter) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. * @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 represents Storage Task on successful completion of {@link Mono}. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters) { - return beginUpdateAsync(resourceGroupName, storageTaskName, parameters).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String storageTaskName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. - * @param context The context to associate with this operation. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents Storage Task on successful completion of {@link Mono}. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters, Context context) { - return beginUpdateAsync(resourceGroupName, storageTaskName, parameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private PagedResponse listSinglePage(String resourceGroupName, + String storageTaskName, Integer maxpagesize, String filter) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, storageTaskName, maxpagesize, filter, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. + * @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. * @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 represents Storage Task. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskInner update(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters) { - return updateAsync(resourceGroupName, storageTaskName, parameters).block(); + private PagedResponse listSinglePage(String resourceGroupName, + String storageTaskName, Integer maxpagesize, String filter, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (resourceGroupName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listSync(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, storageTaskName, maxpagesize, filter, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Update storage task properties. + * Fetch the storage tasks run report summary for each assignment. * * @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 parameters The parameters to provide to update the storage task resource. - * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return represents Storage Task. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskInner update(String resourceGroupName, String storageTaskName, - StorageTaskUpdateParameters parameters, Context context) { - return updateAsync(resourceGroupName, storageTaskName, parameters, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName) { + final Integer maxpagesize = null; + final String filter = null; + return new PagedIterable<>(() -> listSinglePage(resourceGroupName, storageTaskName, maxpagesize, filter), + nextLink -> listNextSinglePage(nextLink)); } /** - * Lists all the storage tasks available under the subscription. + * Fetch the storage tasks run report summary for each assignment. * - * @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 Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + * @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 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. + * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String storageTaskName, + Integer maxpagesize, String filter, Context context) { + return new PagedIterable<>( + () -> listSinglePage(resourceGroupName, storageTaskName, maxpagesize, filter, context), + nextLink -> listNextSinglePage(nextLink, context)); } /** - * Lists all the storage tasks available under the subscription. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param context The context to associate with this operation. + * @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 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. - * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> storageTaskAssignmentListSinglePageAsync( + String resourceGroupName, String storageTaskName, Integer maxpagesize) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1054,315 +1654,382 @@ private Mono> listSinglePageAsync(Context contex return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } + if (resourceGroupName == null) { + return Mono + .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + } + if (storageTaskName == null) { + return Mono + .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); + } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the storage tasks available under the subscription. - * - * @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 Task operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + return FluxUtil + .withContext( + context -> service.storageTaskAssignmentList(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, maxpagesize, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the storage tasks available under the subscription. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param context The context to associate with this operation. + * @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 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. - * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the storage tasks available under the subscription. - * - * @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 Task operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + private PagedFlux storageTaskAssignmentListAsync(String resourceGroupName, + String storageTaskName, Integer maxpagesize) { + return new PagedFlux<>( + () -> storageTaskAssignmentListSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), + nextLink -> storageTaskAssignmentListNextSinglePageAsync(nextLink)); } /** - * Lists all the storage tasks available under the subscription. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param context The context to associate with this operation. + * @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. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + private PagedFlux storageTaskAssignmentListAsync(String resourceGroupName, + String storageTaskName) { + final Integer maxpagesize = null; + return new PagedFlux<>( + () -> storageTaskAssignmentListSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize), + nextLink -> storageTaskAssignmentListNextSinglePageAsync(nextLink)); } /** - * 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 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. - * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response from the List Storage Tasks operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + private PagedResponse storageTaskAssignmentListSinglePage(String resourceGroupName, + String storageTaskName, Integer maxpagesize) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.storageTaskAssignmentListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, maxpagesize, accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response from the List Storage Tasks operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { + private PagedResponse storageTaskAssignmentListSinglePage(String resourceGroupName, + String storageTaskName, Integer maxpagesize, Context context) { if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + if (storageTaskName == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.storageTaskAssignmentListSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, storageTaskName, maxpagesize, accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * 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. * @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 Task operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + public PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName) { + final Integer maxpagesize = null; + return new PagedIterable<>( + () -> storageTaskAssignmentListSinglePage(resourceGroupName, storageTaskName, maxpagesize), + nextLink -> storageTaskAssignmentListNextSinglePage(nextLink)); } /** - * 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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the response from the List Storage Task operation as paginated response with {@link PagedFlux}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + public PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName, Integer maxpagesize, Context context) { + return new PagedIterable<>( + () -> storageTaskAssignmentListSinglePage(resourceGroupName, storageTaskName, maxpagesize, context), + nextLink -> storageTaskAssignmentListNextSinglePage(nextLink, context)); } /** - * Lists all the storage tasks available under the given resource group. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param nextLink The URL to get the next list of items. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the storage tasks available under the given resource group. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse listByResourceGroupNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Get the next page of items. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @param nextLink The URL to get the next list of items. + * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> previewActionsWithResponseAsync(String location, - StorageTaskPreviewActionInner parameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + private PagedResponse listByResourceGroupNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.previewActions(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, parameters, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listByResourceGroupNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Get the next page of items. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. - * @param context The context to associate with this operation. + * @param nextLink The URL to get the next list of items. * @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 storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> previewActionsWithResponseAsync(String location, - StorageTaskPreviewActionInner parameters, Context context) { + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (parameters == null) { - return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); - } else { - parameters.validate(); - } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.previewActions(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, parameters, accept, context); + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Get the next page of items. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @param nextLink The URL to get the next list of items. * @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 storage Task Preview Action on successful completion of {@link Mono}. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono previewActionsAsync(String location, - StorageTaskPreviewActionInner parameters) { - return previewActionsWithResponseAsync(location, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private PagedResponse listBySubscriptionNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Get the next page of items. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @param nextLink The URL to get the next list of items. * @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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return storage Task Preview Action along with {@link Response}. + * @return the response from the List Storage Task operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response previewActionsWithResponse(String location, - StorageTaskPreviewActionInner parameters, Context context) { - return previewActionsWithResponseAsync(location, parameters, context).block(); + private PagedResponse listBySubscriptionNextSinglePage(String nextLink, Context context) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.listBySubscriptionNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Get the next page of items. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @param nextLink The URL to get the next list of items. * @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 storage Task Preview Action. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters) { - return previewActionsWithResponse(location, parameters, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** @@ -1372,25 +2039,24 @@ 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 Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + private PagedResponse listNextSinglePage(String nextLink) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1401,24 +2067,24 @@ 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 Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return fetch Storage Tasks Run Summary along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, - Context context) { + private PagedResponse listNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.listNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } /** @@ -1428,11 +2094,12 @@ 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 Task operation along with {@link PagedResponse} on successful + * @return the response from the List Storage Tasks operation along with {@link PagedResponse} on successful * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> + storageTaskAssignmentListNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1443,12 +2110,39 @@ private Mono> listByResourceGroupNextSinglePageA final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + context -> service.storageTaskAssignmentListNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private PagedResponse storageTaskAssignmentListNextSinglePage(String nextLink) { + if (nextLink == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + Response res + = service.storageTaskAssignmentListNextSync(nextLink, this.client.getEndpoint(), accept, Context.NONE); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); + } + /** * Get the next page of items. * @@ -1457,23 +2151,26 @@ 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 Task operation along with {@link PagedResponse} on successful - * completion of {@link Mono}. + * @return the response from the List Storage Tasks operation along with {@link PagedResponse}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + private PagedResponse storageTaskAssignmentListNextSinglePage(String nextLink, Context context) { if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); + Response res + = service.storageTaskAssignmentListNextSync(nextLink, this.client.getEndpoint(), accept, context); + return new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), + res.getValue().nextLink(), null); } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTasksClientImpl.class); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java index 361b20f46f6f..dc7626cf937a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.implementation; @@ -10,10 +10,12 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.storageactions.fluent.StorageTasksClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskAssignmentInner; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; import com.azure.resourcemanager.storageactions.models.StorageTask; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewAction; +import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; +import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; import com.azure.resourcemanager.storageactions.models.StorageTasks; public final class StorageTasksImpl implements StorageTasks { @@ -29,14 +31,6 @@ public StorageTasksImpl(StorageTasksClient innerClient, this.serviceManager = serviceManager; } - public void deleteByResourceGroup(String resourceGroupName, String storageTaskName) { - this.serviceClient().delete(resourceGroupName, storageTaskName); - } - - public void delete(String resourceGroupName, String storageTaskName, Context context) { - this.serviceClient().delete(resourceGroupName, storageTaskName, context); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, Context context) { Response inner @@ -58,14 +52,12 @@ public StorageTask getByResourceGroup(String resourceGroupName, String storageTa } } - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + public void deleteByResourceGroup(String resourceGroupName, String storageTaskName) { + this.serviceClient().delete(resourceGroupName, storageTaskName); } - public PagedIterable list(Context context) { - PagedIterable inner = this.serviceClient().list(context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + public void delete(String resourceGroupName, String storageTaskName, Context context) { + this.serviceClient().delete(resourceGroupName, storageTaskName, context); } public PagedIterable listByResourceGroup(String resourceGroupName) { @@ -78,25 +70,41 @@ public PagedIterable listByResourceGroup(String resourceGroupName, return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); } - public Response previewActionsWithResponse(String location, - StorageTaskPreviewActionInner parameters, Context context) { - Response inner - = this.serviceClient().previewActionsWithResponse(location, parameters, context); - if (inner != null) { - return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new StorageTaskPreviewActionImpl(inner.getValue(), this.manager())); - } else { - return null; - } + public PagedIterable listBySubscription() { + PagedIterable inner = this.serviceClient().listBySubscription(); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); } - public StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters) { - StorageTaskPreviewActionInner inner = this.serviceClient().previewActions(location, parameters); - if (inner != null) { - return new StorageTaskPreviewActionImpl(inner, this.manager()); - } else { - return null; - } + public PagedIterable listBySubscription(Context context) { + PagedIterable inner = this.serviceClient().listBySubscription(context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String storageTaskName) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, storageTaskName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + public PagedIterable list(String resourceGroupName, String storageTaskName, + Integer maxpagesize, String filter, Context context) { + PagedIterable inner + = this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, filter, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); + } + + public PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName) { + PagedIterable inner + = this.serviceClient().storageTaskAssignmentList(resourceGroupName, storageTaskName); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); + } + + public PagedIterable storageTaskAssignmentList(String resourceGroupName, + String storageTaskName, Integer maxpagesize, Context context) { + PagedIterable inner + = this.serviceClient().storageTaskAssignmentList(resourceGroupName, storageTaskName, maxpagesize, context); + return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskAssignmentImpl(inner1, this.manager())); } public StorageTask getById(String id) { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsClientImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsClientImpl.java new file mode 100644 index 000000000000..8f903a675a22 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsClientImpl.java @@ -0,0 +1,189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.core.annotation.BodyParam; +import com.azure.core.annotation.ExpectedResponses; +import com.azure.core.annotation.HeaderParam; +import com.azure.core.annotation.Host; +import com.azure.core.annotation.HostParam; +import com.azure.core.annotation.PathParam; +import com.azure.core.annotation.Post; +import com.azure.core.annotation.QueryParam; +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceInterface; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.annotation.UnexpectedResponseExceptionType; +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.RestProxy; +import com.azure.core.management.exception.ManagementException; +import com.azure.core.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storageactions.fluent.StorageTasksOperationGroupsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in StorageTasksOperationGroupsClient. + */ +public final class StorageTasksOperationGroupsClientImpl implements StorageTasksOperationGroupsClient { + /** + * The proxy service used to perform REST calls. + */ + private final StorageTasksOperationGroupsService service; + + /** + * The service client containing this operation class. + */ + private final StorageActionsClientImpl client; + + /** + * Initializes an instance of StorageTasksOperationGroupsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + StorageTasksOperationGroupsClientImpl(StorageActionsClientImpl client) { + this.service = RestProxy.create(StorageTasksOperationGroupsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for StorageActionsClientStorageTasksOperationGroups to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "StorageActionsClient") + public interface StorageTasksOperationGroupsService { + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/locations/{location}/previewActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> previewActions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") StorageTaskPreviewActionInner parameters, Context context); + + @Post("/subscriptions/{subscriptionId}/providers/Microsoft.StorageActions/locations/{location}/previewActions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Response previewActionsSync(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") StorageTaskPreviewActionInner parameters, Context context); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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 storage Task Preview Action along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> previewActionsWithResponseAsync(String location, + StorageTaskPreviewActionInner parameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + return Mono.error(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + return Mono.error(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.previewActions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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 storage Task Preview Action on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono previewActionsAsync(String location, + StorageTaskPreviewActionInner parameters) { + return previewActionsWithResponseAsync(location, parameters).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context) { + if (this.client.getEndpoint() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (this.client.getSubscriptionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Parameter this.client.getSubscriptionId() is required and cannot be null.")); + } + if (location == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (parameters == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Parameter parameters is required and cannot be null.")); + } else { + parameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return service.previewActionsSync(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, contentType, accept, parameters, context); + } + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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 storage Task Preview Action. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public StorageTaskPreviewActionInner previewActions(String location, StorageTaskPreviewActionInner parameters) { + return previewActionsWithResponse(location, parameters, Context.NONE).getValue(); + } + + private static final ClientLogger LOGGER = new ClientLogger(StorageTasksOperationGroupsClientImpl.class); +} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsImpl.java new file mode 100644 index 000000000000..c40729825955 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksOperationGroupsImpl.java @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.storageactions.implementation; + +import com.azure.core.http.rest.Response; +import com.azure.core.http.rest.SimpleResponse; +import com.azure.core.util.Context; +import com.azure.core.util.logging.ClientLogger; +import com.azure.resourcemanager.storageactions.fluent.StorageTasksOperationGroupsClient; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewAction; +import com.azure.resourcemanager.storageactions.models.StorageTasksOperationGroups; + +public final class StorageTasksOperationGroupsImpl implements StorageTasksOperationGroups { + private static final ClientLogger LOGGER = new ClientLogger(StorageTasksOperationGroupsImpl.class); + + private final StorageTasksOperationGroupsClient innerClient; + + private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; + + public StorageTasksOperationGroupsImpl(StorageTasksOperationGroupsClient innerClient, + com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { + this.innerClient = innerClient; + this.serviceManager = serviceManager; + } + + public Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context) { + Response inner + = this.serviceClient().previewActionsWithResponse(location, parameters, context); + if (inner != null) { + return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), + new StorageTaskPreviewActionImpl(inner.getValue(), this.manager())); + } else { + return null; + } + } + + public StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters) { + StorageTaskPreviewActionInner inner = this.serviceClient().previewActions(location, parameters); + if (inner != null) { + return new StorageTaskPreviewActionImpl(inner, this.manager()); + } else { + return null; + } + } + + private StorageTasksOperationGroupsClient serviceClient() { + return this.innerClient; + } + + private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { + return this.serviceManager; + } +} 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 deleted file mode 100644 index 369c786d124b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsClientImpl.java +++ /dev/null @@ -1,326 +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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.storageactions.fluent.StorageTasksReportsClient; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportSummary; -import reactor.core.publisher.Mono; - -/** - * An instance of this class provides access to all the operations defined in StorageTasksReportsClient. - */ -public final class StorageTasksReportsClientImpl implements StorageTasksReportsClient { - /** - * The proxy service used to perform REST calls. - */ - private final StorageTasksReportsService service; - - /** - * The service client containing this operation class. - */ - private final StorageActionsMgmtClientImpl client; - - /** - * Initializes an instance of StorageTasksReportsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - StorageTasksReportsClientImpl(StorageActionsMgmtClientImpl client) { - this.service = RestProxy.create(StorageTasksReportsService.class, client.getHttpPipeline(), - client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for StorageActionsMgmtClientStorageTasksReports to be used by the proxy - * service to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "StorageActionsMgmtCl") - public interface StorageTasksReportsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.StorageActions/storageTasks/{storageTaskName}/reports") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("storageTaskName") String storageTaskName, @QueryParam("$maxpagesize") Integer maxpagesize, - @QueryParam("$filter") String filter, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String storageTaskName, Integer maxpagesize, String filter) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), resourceGroupName, storageTaskName, - maxpagesize, filter, this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String storageTaskName, Integer maxpagesize, String filter, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (resourceGroupName == null) { - return Mono - .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); - } - if (storageTaskName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storageTaskName is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), resourceGroupName, storageTaskName, maxpagesize, filter, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName, - Integer maxpagesize, String filter) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName) { - final Integer maxpagesize = null; - final String filter = null; - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String storageTaskName, - Integer maxpagesize, String filter, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String storageTaskName) { - final Integer maxpagesize = null; - final String filter = null; - return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter)); - } - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, String filter, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, storageTaskName, maxpagesize, filter, context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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 fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items. - * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return fetch Storage Tasks Run Summary along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, - Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java deleted file mode 100644 index 72622e9d4c64..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/StorageTasksReportsImpl.java +++ /dev/null @@ -1,48 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.storageactions.fluent.StorageTasksReportsClient; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskReportInstanceInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; -import com.azure.resourcemanager.storageactions.models.StorageTasksReports; - -public final class StorageTasksReportsImpl implements StorageTasksReports { - private static final ClientLogger LOGGER = new ClientLogger(StorageTasksReportsImpl.class); - - private final StorageTasksReportsClient innerClient; - - private final com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager; - - public StorageTasksReportsImpl(StorageTasksReportsClient innerClient, - com.azure.resourcemanager.storageactions.StorageActionsManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String resourceGroupName, String storageTaskName) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, storageTaskName); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); - } - - public PagedIterable list(String resourceGroupName, String storageTaskName, - Integer maxpagesize, String filter, Context context) { - PagedIterable inner - = this.serviceClient().list(resourceGroupName, storageTaskName, maxpagesize, filter, context); - return ResourceManagerUtils.mapPage(inner, inner1 -> new StorageTaskReportInstanceImpl(inner1, this.manager())); - } - - private StorageTasksReportsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.storageactions.StorageActionsManager manager() { - return this.serviceManager; - } -} 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/implementation/models/OperationListResult.java similarity index 85% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OperationListResult.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/models/OperationListResult.java index cde7b7be6056..ca4cf19c34da 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/implementation/models/OperationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -20,23 +20,23 @@ @Immutable public final class OperationListResult implements JsonSerializable { /* - * List of operations supported by the resource provider + * The Operation items on this page */ private List value; /* - * URL to get the next set of operation list results (if there are any). + * The link to the next page of items */ private String nextLink; /** * Creates an instance of OperationListResult class. */ - public OperationListResult() { + private OperationListResult() { } /** - * Get the value property: List of operations supported by the resource provider. + * Get the value property: The Operation items on this page. * * @return the value value. */ @@ -45,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -79,6 +79,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/StorageTaskAssignmentsListResult.java similarity index 86% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignmentsListResult.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/models/StorageTaskAssignmentsListResult.java index 7a7f340075f5..fea5be746e64 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/implementation/models/StorageTaskAssignmentsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,15 +24,14 @@ public final class StorageTaskAssignmentsListResult implements JsonSerializable< private List value; /* - * 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. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of StorageTaskAssignmentsListResult class. */ - public StorageTaskAssignmentsListResult() { + private StorageTaskAssignmentsListResult() { } /** @@ -45,8 +44,7 @@ public List value() { } /** - * 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -80,6 +78,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of StorageTaskAssignmentsListResult if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the StorageTaskAssignmentsListResult. */ public static StorageTaskAssignmentsListResult fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/StorageTaskReportSummary.java similarity index 84% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportSummary.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/models/StorageTaskReportSummary.java index 004b24297d6a..37b3a67d4b65 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/implementation/models/StorageTaskReportSummary.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,15 +24,14 @@ public final class StorageTaskReportSummary implements JsonSerializable 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. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of StorageTaskReportSummary class. */ - public StorageTaskReportSummary() { + private StorageTaskReportSummary() { } /** @@ -45,8 +44,7 @@ public List value() { } /** - * Get the nextLink property: 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -80,6 +78,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of StorageTaskReportSummary if the JsonReader was pointing to an instance of it, or null if * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the StorageTaskReportSummary. */ public static StorageTaskReportSummary fromJson(JsonReader jsonReader) throws IOException { 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/implementation/models/StorageTasksListResult.java similarity index 85% rename from sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksListResult.java rename to sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/models/StorageTasksListResult.java index 069fa50532da..6311a09e0306 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/implementation/models/StorageTasksListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.storageactions.models; +package com.azure.resourcemanager.storageactions.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,15 +24,14 @@ public final class StorageTasksListResult implements JsonSerializable 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. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of StorageTasksListResult class. */ - public StorageTasksListResult() { + private StorageTasksListResult() { } /** @@ -45,8 +44,7 @@ public List value() { } /** - * Get the nextLink property: 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. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -80,6 +78,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of StorageTasksListResult if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the StorageTasksListResult. */ public static StorageTasksListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java index 6d2cd3579d35..c7608c0daec7 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/implementation/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the implementations for StorageActionsMgmtClient. + * Package containing the implementations for StorageActions. * The Azure Storage Actions Management API. */ package com.azure.resourcemanager.storageactions.implementation; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java index b98f74112441..be43541c993b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ActionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -8,11 +8,11 @@ import java.util.Collection; /** - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. + * Extensible enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ public final class ActionType extends ExpandableStringEnum { /** - * Static value Internal for ActionType. + * Actions are for internal-only APIs. */ public static final ActionType INTERNAL = fromString("Internal"); 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 f929177a8436..b91ffb1c8b92 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 df4a31dffb5e..624d46c2f22e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 652eb9420b69..d9f50f84c30f 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -12,7 +12,6 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.Map; -import java.util.UUID; /** * Managed service identity (system assigned and/or user assigned identities). @@ -23,24 +22,21 @@ public final class ManagedServiceIdentity implements JsonSerializable userAssignedIdentities; @@ -56,7 +52,7 @@ public ManagedServiceIdentity() { * * @return the principalId value. */ - public UUID principalId() { + public String principalId() { return this.principalId; } @@ -66,13 +62,12 @@ public UUID principalId() { * * @return the tenantId value. */ - public UUID tenantId() { + public String tenantId() { return this.tenantId; } /** - * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Get the type property: The type of managed identity assigned to this resource. * * @return the type value. */ @@ -81,8 +76,7 @@ public ManagedServiceIdentityType type() { } /** - * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are - * allowed). + * Set the type property: The type of managed identity assigned to this resource. * * @param type the type value to set. * @return the ManagedServiceIdentity object itself. @@ -93,10 +87,7 @@ public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { } /** - * Get the userAssignedIdentities property: 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. + * Get the userAssignedIdentities property: The identities assigned to this resource by the user. * * @return the userAssignedIdentities value. */ @@ -105,10 +96,7 @@ public Map userAssignedIdentities() { } /** - * Set the userAssignedIdentities property: 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. + * Set the userAssignedIdentities property: The identities assigned to this resource by the user. * * @param userAssignedIdentities the userAssignedIdentities value to set. * @return the ManagedServiceIdentity object itself. @@ -170,11 +158,9 @@ public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOEx if ("type".equals(fieldName)) { deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); } else if ("principalId".equals(fieldName)) { - deserializedManagedServiceIdentity.principalId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.principalId = reader.getString(); } else if ("tenantId".equals(fieldName)) { - deserializedManagedServiceIdentity.tenantId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedManagedServiceIdentity.tenantId = reader.getString(); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java index e48bba721327..029a4fb55f1b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ManagedServiceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -12,22 +12,22 @@ */ public final class ManagedServiceIdentityType extends ExpandableStringEnum { /** - * Static value None for ManagedServiceIdentityType. + * No managed identity. */ public static final ManagedServiceIdentityType NONE = fromString("None"); /** - * Static value SystemAssigned for ManagedServiceIdentityType. + * System assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); /** - * Static value UserAssigned for ManagedServiceIdentityType. + * User assigned managed identity. */ public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); /** - * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + * System and user assigned managed identity. */ public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED = fromString("SystemAssigned,UserAssigned"); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java index 978baf2ab549..db8f75e9a62a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/MatchedBlockName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java index 612f96fc3451..80e67af53650 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnFailure.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java index 2eae84b6e3e2..2d6c6f4c47b1 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/OnSuccess.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java index 6466484007ce..640e21ee1293 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/Operation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -20,7 +20,7 @@ public interface Operation { /** * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. + * operations and "false" for Azure Resource Manager/control-plane operations. * * @return the isDataAction value. */ @@ -42,8 +42,8 @@ public interface Operation { Origin origin(); /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. + * Gets the actionType property: Extensible enum. Indicates the action type. "Internal" refers to actions that are + * for internal only APIs. * * @return the actionType value. */ 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 b17e85cafd33..0d95685a9eb3 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -12,7 +12,7 @@ import java.io.IOException; /** - * Localized display information for this particular operation. + * Localized display information for and operation. */ @Immutable public final class OperationDisplay implements JsonSerializable { @@ -42,7 +42,7 @@ public final class OperationDisplay implements JsonSerializable { /** - * Static value user for Origin. + * Indicates the operation is initiated by a user. */ public static final Origin USER = fromString("user"); /** - * Static value system for Origin. + * Indicates the operation is initiated by a system. */ public static final Origin SYSTEM = fromString("system"); /** - * Static value user,system for Origin. + * Indicates the operation is initiated by a user or system. */ public static final Origin USER_SYSTEM = fromString("user,system"); diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java index 1c10adee8f2a..1d9a0f6c7391 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/ProvisioningState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java index b58d95065eb8..d270147f1533 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunResult.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java index b53a19ba68c6..677d0106ca4b 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/RunStatusEnum.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 839975b2fe84..62e724cfaf38 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -8,6 +8,7 @@ import com.azure.core.management.SystemData; import com.azure.core.util.Context; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskInner; +import java.time.OffsetDateTime; import java.util.Map; /** @@ -57,18 +58,53 @@ public interface StorageTask { ManagedServiceIdentity identity(); /** - * Gets the properties property: Properties of the storage task. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - StorageTaskProperties properties(); + SystemData systemData(); /** - * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * Gets the taskVersion property: Storage task version. * - * @return the systemData value. + * @return the taskVersion value. */ - SystemData systemData(); + Long taskVersion(); + + /** + * Gets the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @return the enabled value. + */ + boolean enabled(); + + /** + * Gets the description property: Text that describes the purpose of the storage task. + * + * @return the description value. + */ + String description(); + + /** + * Gets the action property: The storage task action that is executed. + * + * @return the action value. + */ + StorageTaskAction action(); + + /** + * Gets the provisioningState property: Represents the provisioning state of the storage task. + * + * @return the provisioningState value. + */ + ProvisioningState provisioningState(); + + /** + * Gets the creationTimeInUtc property: The creation date and time of the storage task in UTC. + * + * @return the creationTimeInUtc value. + */ + OffsetDateTime creationTimeInUtc(); /** * Gets the region of the resource. @@ -101,9 +137,9 @@ public interface StorageTask { /** * The entirety of the StorageTask definition. */ - interface Definition - extends DefinitionStages.Blank, DefinitionStages.WithLocation, DefinitionStages.WithResourceGroup, - DefinitionStages.WithIdentity, DefinitionStages.WithProperties, DefinitionStages.WithCreate { + interface Definition extends DefinitionStages.Blank, DefinitionStages.WithLocation, + DefinitionStages.WithResourceGroup, DefinitionStages.WithIdentity, DefinitionStages.WithEnabled, + DefinitionStages.WithDescription, DefinitionStages.WithAction, DefinitionStages.WithCreate { } /** @@ -160,20 +196,46 @@ interface WithIdentity { * @param identity The managed service identity of the resource. * @return the next definition stage. */ - WithProperties withIdentity(ManagedServiceIdentity identity); + WithEnabled withIdentity(ManagedServiceIdentity identity); + } + + /** + * The stage of the StorageTask definition allowing to specify enabled. + */ + interface WithEnabled { + /** + * Specifies the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled Storage Task is enabled when set to true and disabled when set to false. + * @return the next definition stage. + */ + WithDescription withEnabled(boolean enabled); } /** - * The stage of the StorageTask definition allowing to specify properties. + * The stage of the StorageTask definition allowing to specify description. */ - interface WithProperties { + interface WithDescription { /** - * Specifies the properties property: Properties of the storage task.. + * Specifies the description property: Text that describes the purpose of the storage task. * - * @param properties Properties of the storage task. + * @param description Text that describes the purpose of the storage task. * @return the next definition stage. */ - WithCreate withProperties(StorageTaskProperties properties); + WithAction withDescription(String description); + } + + /** + * The stage of the StorageTask definition allowing to specify action. + */ + interface WithAction { + /** + * Specifies the action property: The storage task action that is executed. + * + * @param action The storage task action that is executed. + * @return the next definition stage. + */ + WithCreate withAction(StorageTaskAction action); } /** @@ -221,7 +283,8 @@ interface WithTags { /** * The template for StorageTask update. */ - interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithProperties { + interface Update extends UpdateStages.WithTags, UpdateStages.WithIdentity, UpdateStages.WithEnabled, + UpdateStages.WithDescription, UpdateStages.WithAction { /** * Executes the update request. * @@ -275,16 +338,42 @@ interface WithIdentity { } /** - * The stage of the StorageTask update allowing to specify properties. + * The stage of the StorageTask update allowing to specify enabled. + */ + interface WithEnabled { + /** + * Specifies the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled Storage Task is enabled when set to true and disabled when set to false. + * @return the next definition stage. + */ + Update withEnabled(Boolean enabled); + } + + /** + * The stage of the StorageTask update allowing to specify description. + */ + interface WithDescription { + /** + * Specifies the description property: Text that describes the purpose of the storage task. + * + * @param description Text that describes the purpose of the storage task. + * @return the next definition stage. + */ + Update withDescription(String description); + } + + /** + * The stage of the StorageTask update allowing to specify action. */ - interface WithProperties { + interface WithAction { /** - * Specifies the properties property: Properties of the storage task.. + * Specifies the action property: The storage task action that is executed. * - * @param properties Properties of the storage task. + * @param action The storage task action that is executed. * @return the next definition stage. */ - Update withProperties(StorageTaskProperties properties); + Update withAction(StorageTaskAction action); } } 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 d219db28a148..dc3d99e67b90 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 7ea06740666f..292f10c67151 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 deleted file mode 100644 index 144a1bae47d1..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskAssignments.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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of StorageTaskAssignments. - */ -public interface StorageTaskAssignments { - /** - * 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. - * @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}. - */ - PagedIterable list(String resourceGroupName, String storageTaskName); - - /** - * 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 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. - * @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}. - */ - PagedIterable list(String resourceGroupName, String storageTaskName, Integer maxpagesize, - Context context); -} 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 8175f3b8c319..009365eb659e 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java index e4b2daed15be..00a9294d7653 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskOperationName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java index c085d1ce99a7..3969d0019299 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewAction.java @@ -1,21 +1,37 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; +import java.util.List; /** * An immutable client-side representation of StorageTaskPreviewAction. */ public interface StorageTaskPreviewAction { /** - * Gets the properties property: Properties of the storage task preview. + * Gets the container property: Properties of a sample container to test for a match with the preview action. * - * @return the properties value. + * @return the container value. */ - StorageTaskPreviewActionProperties properties(); + StorageTaskPreviewContainerProperties container(); + + /** + * Gets the blobs property: Properties of some sample blobs in the container to test for matches with the preview + * action. + * + * @return the blobs value. + */ + List blobs(); + + /** + * Gets the action property: Preview action to test. + * + * @return the action value. + */ + StorageTaskPreviewActionCondition action(); /** * Gets the inner com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner object. 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 d45a9166254e..f94732958c60 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java index c5f7f9e90480..afaabd744782 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewActionIfCondition.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 32da7f60597e..b18c87404c44 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 64d0b26323ce..2d0bcf5808e5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java index dfb56f36cae6..1e3ee63e9cb4 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskPreviewKeyValueProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java index c59762ee7555..b5e5a09072fe 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTaskReportInstance.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; 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 08b2ec75901a..b72eebc779d5 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -109,7 +109,7 @@ public final class StorageTaskReportProperties implements JsonSerializable tags) { } /** - * Get the properties property: Properties of the storage task. + * Get the innerProperties property: Properties of the storage task. * - * @return the properties value. + * @return the innerProperties value. */ - public StorageTaskProperties properties() { - return this.properties; + private StorageTaskUpdateProperties innerProperties() { + return this.innerProperties; } /** - * Set the properties property: Properties of the storage task. + * Get the taskVersion property: Storage task version. * - * @param properties the properties value to set. + * @return the taskVersion value. + */ + public Long taskVersion() { + return this.innerProperties() == null ? null : this.innerProperties().taskVersion(); + } + + /** + * Get the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @return the enabled value. + */ + public Boolean enabled() { + return this.innerProperties() == null ? null : this.innerProperties().enabled(); + } + + /** + * Set the enabled property: Storage Task is enabled when set to true and disabled when set to false. + * + * @param enabled the enabled value to set. + * @return the StorageTaskUpdateParameters object itself. + */ + public StorageTaskUpdateParameters withEnabled(Boolean enabled) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskUpdateProperties(); + } + this.innerProperties().withEnabled(enabled); + return this; + } + + /** + * Get the description property: Text that describes the purpose of the storage task. + * + * @return the description value. + */ + public String description() { + return this.innerProperties() == null ? null : this.innerProperties().description(); + } + + /** + * Set the description property: Text that describes the purpose of the storage task. + * + * @param description the description value to set. * @return the StorageTaskUpdateParameters object itself. */ - public StorageTaskUpdateParameters withProperties(StorageTaskProperties properties) { - this.properties = properties; + public StorageTaskUpdateParameters withDescription(String description) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskUpdateProperties(); + } + this.innerProperties().withDescription(description); return this; } + /** + * Get the action property: The storage task action that is executed. + * + * @return the action value. + */ + public StorageTaskAction action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: The storage task action that is executed. + * + * @param action the action value to set. + * @return the StorageTaskUpdateParameters object itself. + */ + public StorageTaskUpdateParameters withAction(StorageTaskAction action) { + if (this.innerProperties() == null) { + this.innerProperties = new StorageTaskUpdateProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the provisioningState property: Represents the provisioning state of the storage task. + * + * @return the provisioningState value. + */ + public ProvisioningState provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the creationTimeInUtc property: The creation date and time of the storage task in UTC. + * + * @return the creationTimeInUtc value. + */ + public OffsetDateTime creationTimeInUtc() { + return this.innerProperties() == null ? null : this.innerProperties().creationTimeInUtc(); + } + /** * Validates the instance. * @@ -115,8 +202,8 @@ public void validate() { if (identity() != null) { identity().validate(); } - if (properties() != null) { - properties().validate(); + if (innerProperties() != null) { + innerProperties().validate(); } } @@ -128,7 +215,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -153,7 +240,8 @@ public static StorageTaskUpdateParameters fromJson(JsonReader jsonReader) throws Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedStorageTaskUpdateParameters.tags = tags; } else if ("properties".equals(fieldName)) { - deserializedStorageTaskUpdateParameters.properties = StorageTaskProperties.fromJson(reader); + deserializedStorageTaskUpdateParameters.innerProperties + = StorageTaskUpdateProperties.fromJson(reader); } else { reader.skipChildren(); } 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 ca8903dfee6a..c317bb7618d9 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 @@ -1,18 +1,45 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; import com.azure.core.http.rest.PagedIterable; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; /** * Resource collection API of StorageTasks. */ public interface StorageTasks { + /** + * Get the storage task properties. + * + * @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 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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return the storage task properties along with {@link Response}. + */ + Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, + Context context); + + /** + * Get the storage task properties. + * + * @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. + * @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 storage task properties. + */ + StorageTask getByResourceGroup(String resourceGroupName, String storageTaskName); + /** * Delete the storage task resource. * @@ -39,32 +66,27 @@ public interface StorageTasks { void delete(String resourceGroupName, String storageTaskName, Context context); /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties along with {@link Response}. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - Response getByResourceGroupWithResponse(String resourceGroupName, String storageTaskName, - Context context); + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Get the storage task properties. + * Lists all the storage tasks available under the given resource group. * * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return the storage task properties. + * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - StorageTask getByResourceGroup(String resourceGroupName, String storageTaskName); + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** * Lists all the storage tasks available under the subscription. @@ -73,7 +95,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(); + PagedIterable listBySubscription(); /** * Lists all the storage tasks available under the subscription. @@ -84,56 +106,68 @@ Response getByResourceGroupWithResponse(String resourceGroupName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the response from the List Storage Task operation as paginated response with {@link PagedIterable}. */ - PagedIterable list(Context context); + PagedIterable listBySubscription(Context context); /** - * Lists all the storage tasks available under the given resource group. + * Fetch the storage tasks run report summary for each assignment. * * @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. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName); + PagedIterable list(String resourceGroupName, String storageTaskName); /** - * Lists all the storage tasks available under the given resource group. + * Fetch the storage tasks run report summary for each assignment. * * @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 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. * @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 Task operation as paginated response with {@link PagedIterable}. + * @return fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. */ - PagedIterable listByResourceGroup(String resourceGroupName, Context context); + PagedIterable list(String resourceGroupName, String storageTaskName, Integer maxpagesize, + String filter, Context context); /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. - * @param context The context to associate with this operation. + * @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. * @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 storage Task Preview Action along with {@link Response}. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ - Response previewActionsWithResponse(String location, - StorageTaskPreviewActionInner parameters, Context context); + PagedIterable storageTaskAssignmentList(String resourceGroupName, String storageTaskName); /** - * Runs the input conditions against input object metadata properties and designates matched objects in response. + * Lists Resource IDs of the Storage Task Assignments associated with this Storage Task. * - * @param location The location to perform preview of the actions. - * @param parameters The parameters to preview action condition. + * @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 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. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return storage Task Preview Action. + * @return the response from the List Storage Tasks operation as paginated response with {@link PagedIterable}. */ - StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters); + PagedIterable storageTaskAssignmentList(String resourceGroupName, String storageTaskName, + Integer maxpagesize, Context context); /** * Get the storage task properties. diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksOperationGroups.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksOperationGroups.java new file mode 100644 index 000000000000..490c74818243 --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksOperationGroups.java @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.storageactions.models; + +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; + +/** + * Resource collection API of StorageTasksOperationGroups. + */ +public interface StorageTasksOperationGroups { + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return storage Task Preview Action along with {@link Response}. + */ + Response previewActionsWithResponse(String location, + StorageTaskPreviewActionInner parameters, Context context); + + /** + * Runs the input conditions against input object metadata properties and designates matched objects in response. + * + * @param location The location parameter. + * @param parameters The parameters to preview action condition. + * @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 storage Task Preview Action. + */ + StorageTaskPreviewAction previewActions(String location, StorageTaskPreviewActionInner parameters); +} 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 deleted file mode 100644 index 9c2e513518aa..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/StorageTasksReports.java +++ /dev/null @@ -1,44 +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.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** - * Resource collection API of StorageTasksReports. - */ -public interface StorageTasksReports { - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String storageTaskName); - - /** - * Fetch the storage tasks run report summary for each assignment. - * - * @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 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. - * @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 fetch Storage Tasks Run Summary as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String resourceGroupName, String storageTaskName, Integer maxpagesize, - String filter, Context context); -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java index da73ac9ae931..cbdc5b06067c 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/UserAssignedIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.storageactions.models; @@ -10,7 +10,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.UUID; /** * User assigned identity properties. @@ -20,12 +19,12 @@ public final class UserAssignedIdentity implements JsonSerializable UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.principalId = reader.getString(); } else if ("clientId".equals(fieldName)) { - deserializedUserAssignedIdentity.clientId - = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + deserializedUserAssignedIdentity.clientId = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java index 8ebe8db8ef6a..91ad3c201577 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for StorageActionsMgmtClient. + * Package containing the data models for StorageActions. * The Azure Storage Actions Management API. */ package com.azure.resourcemanager.storageactions.models; diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java index 307bd3453167..cad10190b99a 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/java/com/azure/resourcemanager/storageactions/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for StorageActionsMgmtClient. + * Package containing the classes for StorageActions. * The Azure Storage Actions Management API. */ package com.azure.resourcemanager.storageactions; 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 4bf31a14e2bf..bc9fccdd3066 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 @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. module com.azure.resourcemanager.storageactions { requires transitive com.azure.core.management; @@ -12,4 +12,5 @@ opens com.azure.resourcemanager.storageactions.fluent.models to com.azure.core; opens com.azure.resourcemanager.storageactions.models to com.azure.core; + opens com.azure.resourcemanager.storageactions.implementation.models to com.azure.core; } diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json index b865e498afad..2f4e645ed703 100644 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json +++ b/sdk/storageactions/azure-resourcemanager-storageactions/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-storageactions/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.storageactions.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.storageactions.implementation.StorageTaskAssignmentsClientImpl$StorageTaskAssignmentsService"],["com.azure.resourcemanager.storageactions.implementation.StorageTasksClientImpl$StorageTasksService"],["com.azure.resourcemanager.storageactions.implementation.StorageTasksReportsClientImpl$StorageTasksReportsService"]] \ No newline at end of file +[["com.azure.resourcemanager.storageactions.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.storageactions.implementation.StorageTasksClientImpl$StorageTasksService"],["com.azure.resourcemanager.storageactions.implementation.StorageTasksOperationGroupsClientImpl$StorageTasksOperationGroupsService"]] \ No newline at end of file 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 deleted file mode 100644 index 820de9b40e6c..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/OperationsListSamples.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; - -/** - * Samples for Operations List. - */ -public final class OperationsListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * OperationsList.json - */ - /** - * Sample code: OperationsList. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void operationsList(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.operations().list(com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 6b377965535d..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentListSamples.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; - -/** - * Samples for StorageTaskAssignment List. - */ -public final class StorageTaskAssignmentListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTaskAssignmentIds.json - */ - /** - * Sample code: ListStorageTaskAssignmentsByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void listStorageTaskAssignmentsByResourceGroup( - com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTaskAssignments().list("rgroup1", "mytask1", null, com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index bb0ae6df447d..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateSamples.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.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 java.util.Arrays; -import java.util.HashMap; -import java.util.Map; - -/** - * Samples for StorageTasks Create. - */ -public final class StorageTasksCreateSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PutStorageTask.json - */ - /** - * Sample code: PutStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void putStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - 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(); - } - - // 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/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 deleted file mode 100644 index b6e14148befa..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksDeleteSamples.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; - -/** - * Samples for StorageTasks Delete. - */ -public final class StorageTasksDeleteSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/DeleteStorageTask.json - */ - /** - * Sample code: DeleteStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void deleteStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().delete("res4228", "mytask1", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index cf1ef73a4d69..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupSamples.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; - -/** - * Samples for StorageTasks GetByResourceGroup. - */ -public final class StorageTasksGetByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/GetStorageTask.json - */ - /** - * Sample code: GetStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void getStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 98748277e806..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupSamples.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; - -/** - * Samples for StorageTasks ListByResourceGroup. - */ -public final class StorageTasksListByResourceGroupSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksByResourceGroup.json - */ - /** - * Sample code: ListStorageTasksByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().listByResourceGroup("res6117", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index e64256bddcc0..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListSamples.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; - -/** - * Samples for StorageTasks List. - */ -public final class StorageTasksListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksBySubscription.json - */ - /** - * Sample code: ListStorageTasksBySubscription. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksBySubscription(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasks().list(com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 7a431241c6fa..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksPreviewActionsSamples.java +++ /dev/null @@ -1,110 +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.resourcemanager.storageactions.fluent.models.StorageTaskPreviewActionInner; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionIfCondition; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewActionProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewBlobProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewContainerProperties; -import com.azure.resourcemanager.storageactions.models.StorageTaskPreviewKeyValueProperties; -import java.util.Arrays; - -/** - * Samples for StorageTasks PreviewActions. - */ -public final class StorageTasksPreviewActionsSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/misc/ - * PerformStorageTaskActionsPreview.json - */ - /** - * Sample code: PerformStorageTaskActionsPreview. - * - * @param manager Entry point to StorageActionsManager. - */ - 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); - } -} 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 deleted file mode 100644 index 404c20cead31..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportListSamples.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; - -/** - * Samples for StorageTasksReport List. - */ -public final class StorageTasksReportListSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksList/ListStorageTasksRunReportSummary.json - */ - /** - * Sample code: ListStorageTasksByResourceGroup. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void - listStorageTasksByResourceGroup(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - manager.storageTasksReports().list("rgroup1", "mytask1", null, null, com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 1f20f76a3abe..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/samples/java/com/azure/resourcemanager/storageactions/generated/StorageTasksUpdateSamples.java +++ /dev/null @@ -1,74 +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.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; -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; - -/** - * Samples for StorageTasks Update. - */ -public final class StorageTasksUpdateSamples { - /* - * x-ms-original-file: - * specification/storageactions/resource-manager/Microsoft.StorageActions/stable/2023-01-01/examples/ - * storageTasksCrud/PatchStorageTask.json - */ - /** - * Sample code: PatchStorageTask. - * - * @param manager Entry point to StorageActionsManager. - */ - public static void patchStorageTask(com.azure.resourcemanager.storageactions.StorageActionsManager manager) { - StorageTask resource = manager.storageTasks() - .getByResourceGroupWithResponse("res4228", "mytask1", com.azure.core.util.Context.NONE) - .getValue(); - resource.update() - .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(); - } - - // 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/ElseConditionTests.java b/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java deleted file mode 100644 index 199b34a60525..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ElseConditionTests.java +++ /dev/null @@ -1,56 +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\":\"UndeleteBlob\",\"parameters\":{\"orcjxvsnby\":\"jxsqwpgrjbz\",\"cyshurzafbljjgp\":\"qabnmoc\",\"bqidtqaj\":\"toqcjmklja\",\"khbzhfepgzg\":\"yulpkudjkr\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("jxsqwpgrjbz", model.operations().get(0).parameters().get("orcjxvsnby")); - 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.UNDELETE_BLOB) - .withParameters(mapOf("orcjxvsnby", "jxsqwpgrjbz", "cyshurzafbljjgp", "qabnmoc", "bqidtqaj", - "toqcjmklja", "khbzhfepgzg", "yulpkudjkr")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(ElseCondition.class); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, model.operations().get(0).name()); - Assertions.assertEquals("jxsqwpgrjbz", model.operations().get(0).parameters().get("orcjxvsnby")); - 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 433c1126169b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/IfConditionTests.java +++ /dev/null @@ -1,63 +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\":\"wbnguitnwui\",\"operations\":[{\"name\":\"SetBlobExpiry\",\"parameters\":{\"hr\":\"ufizuckyf\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"nteiwaopv\":\"zuhtymwisdkfthwx\",\"pymzidnsezcxtbzs\":\"mijcmmxdcufufs\",\"newmdwzjeiachbo\":\"fycc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}") - .toObject(IfCondition.class); - Assertions.assertEquals("wbnguitnwui", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, model.operations().get(0).name()); - Assertions.assertEquals("ufizuckyf", model.operations().get(0).parameters().get("hr")); - 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("wbnguitnwui") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) - .withParameters(mapOf("hr", "ufizuckyf")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("nteiwaopv", "zuhtymwisdkfthwx", "pymzidnsezcxtbzs", "mijcmmxdcufufs", - "newmdwzjeiachbo", "fycc")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))); - model = BinaryData.fromObject(model).toObject(IfCondition.class); - Assertions.assertEquals("wbnguitnwui", model.condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, model.operations().get(0).name()); - Assertions.assertEquals("ufizuckyf", model.operations().get(0).parameters().get("hr")); - 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 74074ab63c25..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/ManagedServiceIdentityTests.java +++ /dev/null @@ -1,45 +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\":\"1f7e9ee1-f082-45fa-9bd8-6d8ca1bcdce0\",\"tenantId\":\"24c7a786-51b9-4715-9a0e-5804a01eee23\",\"type\":\"SystemAssigned,UserAssigned\",\"userAssignedIdentities\":{\"peqfpjkjl\":{\"principalId\":\"45da1ced-c990-418f-8274-0674f7071816\",\"clientId\":\"6096833f-49a4-4023-95e8-9a4aaec2a0cd\"},\"pdvhpfxxypin\":{\"principalId\":\"641031b9-e2a1-41dd-9df7-1c7ef396aa47\",\"clientId\":\"f324fab9-3741-49c0-94cf-b88cdc34307c\"}}}") - .toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ManagedServiceIdentity model - = new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED_USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("peqfpjkjl", new UserAssignedIdentity(), "pdvhpfxxypin", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ManagedServiceIdentity.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED_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 4bf898e29642..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/OperationsListMockTests.java +++ /dev/null @@ -1,36 +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.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.Operation; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class OperationsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"name\":\"yeamdphagalpb\",\"isDataAction\":true,\"display\":{\"provider\":\"pwhonowkg\",\"resource\":\"wankixzbi\",\"operation\":\"eputtmrywnuzoqf\",\"description\":\"yqzrnkcqvyxlw\"},\"origin\":\"user\",\"actionType\":\"Internal\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - 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 e39544353c9c..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskActionTests.java +++ /dev/null @@ -1,92 +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\":\"ypnddhsgcb\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"nqgoulzndli\":\"jkot\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"qqedqytbciqfou\":\"madgakeqsrxyb\",\"gpbkwtmut\":\"lmmnkzsmodmglo\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTier\",\"parameters\":{\"kdosvqw\":\"pwgcuertu\",\"bjf\":\"bmdg\",\"bexppb\":\"dgmb\",\"rolfpfp\":\"tq\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"jaoyfhrtx\":\"igjyjg\",\"fqawrlyxw\":\"lnerkujysvleju\",\"xgjvtbv\":\"kcprbnw\",\"uouq\":\"ysszdnrujqguh\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}}") - .toObject(StorageTaskAction.class); - Assertions.assertEquals("ypnddhsgcb", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("jkot", model.ifProperty().operations().get(0).parameters().get("nqgoulzndli")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("madgakeqsrxyb", - model.elseProperty().operations().get(0).parameters().get("qqedqytbciqfou")); - 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("ypnddhsgcb") - .withOperations(Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters(mapOf("nqgoulzndli", "jkot")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty( - new ElseCondition() - .withOperations( - Arrays - .asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters( - mapOf("qqedqytbciqfou", "madgakeqsrxyb", "gpbkwtmut", "lmmnkzsmodmglo")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters( - mapOf("kdosvqw", "pwgcuertu", "bjf", "bmdg", "bexppb", "dgmb", "rolfpfp", "tq")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters(mapOf("jaoyfhrtx", "igjyjg", "fqawrlyxw", "lnerkujysvleju", - "xgjvtbv", "kcprbnw", "uouq", "ysszdnrujqguh")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))); - model = BinaryData.fromObject(model).toObject(StorageTaskAction.class); - Assertions.assertEquals("ypnddhsgcb", model.ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, model.ifProperty().operations().get(0).name()); - Assertions.assertEquals("jkot", model.ifProperty().operations().get(0).parameters().get("nqgoulzndli")); - Assertions.assertEquals(OnSuccess.CONTINUE, model.ifProperty().operations().get(0).onSuccess()); - Assertions.assertEquals(OnFailure.BREAK, model.ifProperty().operations().get(0).onFailure()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, - model.elseProperty().operations().get(0).name()); - Assertions.assertEquals("madgakeqsrxyb", - model.elseProperty().operations().get(0).parameters().get("qqedqytbciqfou")); - 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 5419df3c8f20..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\":\"drvyn\"}").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 38b98716932b..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListMockTests.java +++ /dev/null @@ -1,36 +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.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskAssignment; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTaskAssignmentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr = "{\"value\":[{\"id\":\"yvpycanuzbpzk\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.storageTaskAssignments().list("qj", "hckfrlhrx", 1228255689, 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 798de12125ff..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskAssignmentsListResultTests.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.StorageTaskAssignmentsListResult; - -public final class StorageTaskAssignmentsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StorageTaskAssignmentsListResult model = BinaryData.fromString( - "{\"value\":[{\"id\":\"rabhjybigeho\"},{\"id\":\"bowsk\"},{\"id\":\"yktz\"},{\"id\":\"u\"}],\"nextLink\":\"wgqyw\"}") - .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 83629355c379..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskInnerTests.java +++ /dev/null @@ -1,124 +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\":\"36049dc6-25d9-415c-9eb6-712887b3a6a2\",\"tenantId\":\"a3e87f71-d138-4c74-bf14-455e1d90e281\",\"type\":\"None\",\"userAssignedIdentities\":{\"qhabifpikxwcz\":{\"principalId\":\"e34752b1-aa5a-4b86-9664-def16807e4f6\",\"clientId\":\"87a51fe6-d3fe-4165-97a7-1f5865a7c37a\"}}},\"properties\":{\"taskVersion\":3372129920897146496,\"enabled\":false,\"description\":\"pqxu\",\"action\":{\"if\":{\"condition\":\"ivyqniwbybrkxvd\",\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"snhsjcnyejhkryh\":\"tfwvukxgaudc\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"kkvnipjox\":\"jye\",\"podmailzydehojwy\":\"jnchgej\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobImmutabilityPolicy\",\"parameters\":{\"sprozvcput\":\"qnjaqwix\",\"fdatsc\":\"gjvw\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-02-16T21:00:55Z\"},\"location\":\"uvm\",\"tags\":{\"iodjp\":\"zkrwfn\",\"ryo\":\"lwejdpv\",\"hbcryffdfdosyge\":\"psoacctazakljl\",\"rzevdphlxaol\":\"paojakhmsbzjh\"},\"id\":\"hqtrgqjbpf\",\"name\":\"fsinzgvfcjrwzoxx\",\"type\":\"tfell\"}") - .toObject(StorageTaskInner.class); - Assertions.assertEquals("uvm", model.location()); - Assertions.assertEquals("zkrwfn", model.tags().get("iodjp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertFalse(model.properties().enabled()); - Assertions.assertEquals("pqxu", model.properties().description()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", - model.properties().action().ifProperty().operations().get(0).parameters().get("snhsjcnyejhkryh")); - 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_IMMUTABILITY_POLICY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("jye", - model.properties().action().elseProperty().operations().get(0).parameters().get("kkvnipjox")); - 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("uvm") - .withTags(mapOf("iodjp", "zkrwfn", "ryo", "lwejdpv", "hbcryffdfdosyge", "psoacctazakljl", - "rzevdphlxaol", "paojakhmsbzjh")) - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("qhabifpikxwcz", new UserAssignedIdentity()))) - .withProperties( - new StorageTaskProperties().withEnabled(false) - .withDescription("pqxu") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("ivyqniwbybrkxvd") - .withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("snhsjcnyejhkryh", "tfwvukxgaudc")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty( - new ElseCondition() - .withOperations( - Arrays.asList( - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters( - mapOf("kkvnipjox", "jye", "podmailzydehojwy", "jnchgej")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY) - .withParameters(mapOf("sprozvcput", "qnjaqwix", "fdatsc", "gjvw")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskInner.class); - Assertions.assertEquals("uvm", model.location()); - Assertions.assertEquals("zkrwfn", model.tags().get("iodjp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, model.identity().type()); - Assertions.assertFalse(model.properties().enabled()); - Assertions.assertEquals("pqxu", model.properties().description()); - Assertions.assertEquals("ivyqniwbybrkxvd", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("tfwvukxgaudc", - model.properties().action().ifProperty().operations().get(0).parameters().get("snhsjcnyejhkryh")); - 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_IMMUTABILITY_POLICY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("jye", - model.properties().action().elseProperty().operations().get(0).parameters().get("kkvnipjox")); - 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 01bbdf81ed96..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\":\"SetBlobLegalHold\",\"parameters\":{\"hzzvypyq\":\"fqpte\",\"z\":\"i\",\"dqxhcrmnohjtckwh\":\"npvswjdkirso\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}") - .toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, model.name()); - Assertions.assertEquals("fqpte", model.parameters().get("hzzvypyq")); - 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_LEGAL_HOLD) - .withParameters(mapOf("hzzvypyq", "fqpte", "z", "i", "dqxhcrmnohjtckwh", "npvswjdkirso")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK); - model = BinaryData.fromObject(model).toObject(StorageTaskOperation.class); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD, model.name()); - Assertions.assertEquals("fqpte", model.parameters().get("hzzvypyq")); - 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 8cf554d1e993..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionConditionTests.java +++ /dev/null @@ -1,31 +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\":\"ttgzfbis\"},\"elseBlockExists\":true}") - .toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("ttgzfbis", model.ifProperty().condition()); - Assertions.assertTrue(model.elseBlockExists()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionCondition model = new StorageTaskPreviewActionCondition() - .withIfProperty(new StorageTaskPreviewActionIfCondition().withCondition("ttgzfbis")) - .withElseBlockExists(true); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionCondition.class); - Assertions.assertEquals("ttgzfbis", model.ifProperty().condition()); - Assertions.assertTrue(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 d4c254191d6e..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPreviewActionIfConditionTests.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.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\":\"khaj\"}").toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("khaj", model.condition()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StorageTaskPreviewActionIfCondition model = new StorageTaskPreviewActionIfCondition().withCondition("khaj"); - model = BinaryData.fromObject(model).toObject(StorageTaskPreviewActionIfCondition.class); - Assertions.assertEquals("khaj", 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 df135889d8d4..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskPropertiesTests.java +++ /dev/null @@ -1,111 +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\":1351173386215455176,\"enabled\":true,\"description\":\"ybb\",\"action\":{\"if\":{\"condition\":\"podepoo\",\"operations\":[{\"name\":\"SetBlobTier\",\"parameters\":{\"theotusiv\":\"amiheognarxz\",\"bwjzr\":\"evcciqihnhun\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"qeof\":\"pemvtzfkufubljof\",\"jqul\":\"aeqjhqjbasvms\",\"clxxwrljdo\":\"gsntnbybkzgcwr\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"jdkwtnhxbnjb\":\"cr\",\"qpjwnzlljfm\":\"ksqrglssai\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobLegalHold\",\"parameters\":{\"zevndhkrwpdappds\":\"abkyqduujitcjcz\",\"snhu\":\"dkvwrwjfe\",\"tmrldhugjzzdatq\":\"je\",\"gphuticndvka\":\"hocdgeab\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"},{\"name\":\"SetBlobTags\",\"parameters\":{\"rokft\":\"hxh\",\"iawxklry\":\"xolniwpwcukjfk\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-11-03T18:10:18Z\"}") - .toObject(StorageTaskProperties.class); - Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("ybb", model.description()); - Assertions.assertEquals("podepoo", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("amiheognarxz", - model.action().ifProperty().operations().get(0).parameters().get("theotusiv")); - 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_LEGAL_HOLD, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("abkyqduujitcjcz", - model.action().elseProperty().operations().get(0).parameters().get("zevndhkrwpdappds")); - 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("ybb") - .withAction( - new StorageTaskAction() - .withIfProperty( - new IfCondition().withCondition("podepoo") - .withOperations( - Arrays - .asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TIER) - .withParameters( - mapOf("theotusiv", "amiheognarxz", "bwjzr", "evcciqihnhun")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("qeof", "pemvtzfkufubljof", "jqul", - "aeqjhqjbasvms", "clxxwrljdo", "gsntnbybkzgcwr")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters( - mapOf("jdkwtnhxbnjb", "cr", "qpjwnzlljfm", "ksqrglssai")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD) - .withParameters(mapOf("zevndhkrwpdappds", "abkyqduujitcjcz", "snhu", "dkvwrwjfe", - "tmrldhugjzzdatq", "je", "gphuticndvka", "hocdgeab")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("rokft", "hxh", "iawxklry", "xolniwpwcukjfk")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK))))); - model = BinaryData.fromObject(model).toObject(StorageTaskProperties.class); - Assertions.assertTrue(model.enabled()); - Assertions.assertEquals("ybb", model.description()); - Assertions.assertEquals("podepoo", model.action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - model.action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("amiheognarxz", - model.action().ifProperty().operations().get(0).parameters().get("theotusiv")); - 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_LEGAL_HOLD, - model.action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("abkyqduujitcjcz", - model.action().elseProperty().operations().get(0).parameters().get("zevndhkrwpdappds")); - 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 379e192c020f..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\":\"puozmyzydag\",\"storageAccountId\":\"axbezyiuo\",\"startTime\":\"twhrdxwzywqsm\",\"finishTime\":\"ureximoryocfs\",\"objectsTargetedCount\":\"s\",\"objectsOperatedOnCount\":\"ddystkiiuxhqy\",\"objectFailedCount\":\"xorrqnb\",\"objectsSucceededCount\":\"czvyifq\",\"runStatusError\":\"kdvjsll\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"d\",\"taskId\":\"atkpnp\",\"taskVersion\":\"exxbczwtr\",\"runResult\":\"Succeeded\"},\"id\":\"zb\",\"name\":\"j\",\"type\":\"sovmyokacspkwl\"}") - .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 870ff01379bf..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\":\"dobpxjmflbvvn\",\"storageAccountId\":\"rkcciwwzjuqk\",\"startTime\":\"sa\",\"finishTime\":\"wkuofoskghsauu\",\"objectsTargetedCount\":\"jmvxie\",\"objectsOperatedOnCount\":\"ugidyjrr\",\"objectFailedCount\":\"y\",\"objectsSucceededCount\":\"svexcsonpclhoco\",\"runStatusError\":\"lkevle\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"buhfmvfaxkffeiit\",\"taskId\":\"vmezy\",\"taskVersion\":\"hxmzsbbzoggig\",\"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 934a8d7d7f11..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\":\"hrc\",\"storageAccountId\":\"nc\",\"startTime\":\"pec\",\"finishTime\":\"m\",\"objectsTargetedCount\":\"oo\",\"objectsOperatedOnCount\":\"xlzevgbmqjqabcy\",\"objectFailedCount\":\"ivkwlzuvccfwnfnb\",\"objectsSucceededCount\":\"fionl\",\"runStatusError\":\"x\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"tzxdpnqbqqwx\",\"taskId\":\"feallnwsu\",\"taskVersion\":\"snjampmng\",\"runResult\":\"Succeeded\"},\"id\":\"xaqwoochcbonqv\",\"name\":\"kvlrxnj\",\"type\":\"ase\"},{\"properties\":{\"taskAssignmentId\":\"eo\",\"storageAccountId\":\"okeyyienj\",\"startTime\":\"lwtgrhpdj\",\"finishTime\":\"umasxazjpq\",\"objectsTargetedCount\":\"gual\",\"objectsOperatedOnCount\":\"xxhejjzzvd\",\"objectFailedCount\":\"gwdslfhotwm\",\"objectsSucceededCount\":\"npwlbjnpg\",\"runStatusError\":\"ftadehxnltyfs\",\"runStatusEnum\":\"InProgress\",\"summaryReportPath\":\"suesnzw\",\"taskId\":\"jbavorxzdm\",\"taskVersion\":\"ctbqvudwx\",\"runResult\":\"Succeeded\"},\"id\":\"vo\",\"name\":\"gujjugwdkcglh\",\"type\":\"lazjdyggdtjixhbk\"},{\"properties\":{\"taskAssignmentId\":\"qweykhmenev\",\"storageAccountId\":\"exfwhy\",\"startTime\":\"i\",\"finishTime\":\"yvdcsitynnaa\",\"objectsTargetedCount\":\"ectehf\",\"objectsOperatedOnCount\":\"scjeypv\",\"objectFailedCount\":\"zrkgqhcjrefovg\",\"objectsSucceededCount\":\"qsl\",\"runStatusError\":\"yvxyqjp\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"tpngjcrcczsqpjh\",\"taskId\":\"daj\",\"taskVersion\":\"ysou\",\"runResult\":\"Succeeded\"},\"id\":\"a\",\"name\":\"oaeupfhyhltrpmo\",\"type\":\"jmcmatuokthfu\"}],\"nextLink\":\"aodsfcpkv\"}") - .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 e933c8910bbc..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTaskUpdateParametersTests.java +++ /dev/null @@ -1,111 +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\":\"71bd8883-c5e5-4d1a-b1e8-f1d378419d28\",\"tenantId\":\"f6d7d70f-98dc-4f6c-9f1a-b551aac1b489\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"erhhbcsglumm\":{\"principalId\":\"e885cb74-89ff-47ac-9db4-0dc1f5e066ec\",\"clientId\":\"2d98c596-1911-4b0a-8b4f-948932f90090\"},\"j\":{\"principalId\":\"3e274b02-07de-4cc3-9a2c-73b907b813ae\",\"clientId\":\"acebea2e-0abf-4893-b271-ffb21be37fff\"}}},\"tags\":{\"jionpimexgstxgc\":\"xobnbdxkqpxok\"},\"properties\":{\"taskVersion\":8018866075965400544,\"enabled\":false,\"description\":\"ajrmvdjwzrlovmc\",\"action\":{\"if\":{\"condition\":\"whijcoejctbza\",\"operations\":[{\"name\":\"SetBlobTags\",\"parameters\":{\"kdkexxp\":\"cbkbfkg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobExpiry\",\"parameters\":{\"dtocj\":\"pg\"},\"onSuccess\":\"continue\",\"onFailure\":\"break\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-01-21T14:33:44Z\"}}") - .toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertFalse(model.properties().enabled()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.properties().description()); - Assertions.assertEquals("whijcoejctbza", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("cbkbfkg", - model.properties().action().ifProperty().operations().get(0).parameters().get("kdkexxp")); - 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_EXPIRY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("pg", - model.properties().action().elseProperty().operations().get(0).parameters().get("dtocj")); - 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.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf("erhhbcsglumm", new UserAssignedIdentity(), "j", new UserAssignedIdentity()))) - .withTags(mapOf("jionpimexgstxgc", "xobnbdxkqpxok")) - .withProperties(new StorageTaskProperties().withEnabled(false) - .withDescription("ajrmvdjwzrlovmc") - .withAction(new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("whijcoejctbza") - .withOperations(Arrays - .asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_TAGS) - .withParameters(mapOf("kdkexxp", "cbkbfkg")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))) - .withElseProperty(new ElseCondition().withOperations( - Arrays.asList(new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY) - .withParameters(mapOf("dtocj", "pg")) - .withOnSuccess(OnSuccess.CONTINUE) - .withOnFailure(OnFailure.BREAK)))))); - model = BinaryData.fromObject(model).toObject(StorageTaskUpdateParameters.class); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, model.identity().type()); - Assertions.assertEquals("xobnbdxkqpxok", model.tags().get("jionpimexgstxgc")); - Assertions.assertFalse(model.properties().enabled()); - Assertions.assertEquals("ajrmvdjwzrlovmc", model.properties().description()); - Assertions.assertEquals("whijcoejctbza", model.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - model.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals("cbkbfkg", - model.properties().action().ifProperty().operations().get(0).parameters().get("kdkexxp")); - 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_EXPIRY, - model.properties().action().elseProperty().operations().get(0).name()); - Assertions.assertEquals("pg", - model.properties().action().elseProperty().operations().get(0).parameters().get("dtocj")); - 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 338056813783..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksCreateMockTests.java +++ /dev/null @@ -1,92 +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.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -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.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 reactor.core.publisher.Mono; - -public final class StorageTasksCreateMockTests { - @Test - public void testCreate() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"d3c993ca-f142-4758-bae7-05eaa56cba5d\",\"tenantId\":\"432f62d1-9cc6-410f-bdf1-cddfa8a156a6\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ilovnot\":{\"principalId\":\"86d0a56a-004a-4b25-bae2-5cab3a014ae5\",\"clientId\":\"cbce2073-9651-4742-87cd-351c616754d5\"}}},\"properties\":{\"taskVersion\":4609095733155720227,\"enabled\":true,\"description\":\"njbkcnxdhbttkph\",\"action\":{\"if\":{\"condition\":\"wpn\",\"operations\":[{\"name\":\"UndeleteBlob\"},{\"name\":\"UndeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"DeleteBlob\"},{\"name\":\"SetBlobExpiry\"}]}},\"provisioningState\":\"Succeeded\",\"creationTimeInUtc\":\"2021-09-12T23:58:43Z\"},\"location\":\"lphox\",\"tags\":{\"epsbjtazqu\":\"rpabg\",\"jidsuyonobglaoc\":\"xywpmueefjzwfqkq\"},\"id\":\"xtccmg\",\"name\":\"udxytlmoyrx\",\"type\":\"wfudwpzntxhdzhl\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - StorageTask response - = manager.storageTasks() - .define("lcuhxwtctyqiklb") - .withRegion("uebbaumnyqup") - .withExistingResourceGroup("fzab") - .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("hvgyuguosvmk", new UserAssignedIdentity(), "xquk", - new UserAssignedIdentity(), "l", new UserAssignedIdentity()))) - .withProperties( - new StorageTaskProperties().withEnabled(true) - .withDescription("nkjzkdeslpvlop") - .withAction( - new StorageTaskAction() - .withIfProperty(new IfCondition().withCondition("i") - .withOperations(Arrays.asList( - new StorageTaskOperation() - .withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY)))) - .withElseProperty(new ElseCondition().withOperations(Arrays.asList( - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_LEGAL_HOLD), - new StorageTaskOperation().withName(StorageTaskOperationName.SET_BLOB_EXPIRY)))))) - .withTags(mapOf("tfhvpesapskrdqmh", "ojnabckhsmtxpsie", "tkncwsc", "jdhtldwkyzxu")) - .create(); - - Assertions.assertEquals("lphox", response.location()); - Assertions.assertEquals("rpabg", response.tags().get("epsbjtazqu")); - Assertions.assertEquals(ManagedServiceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertTrue(response.properties().enabled()); - Assertions.assertEquals("njbkcnxdhbttkph", response.properties().description()); - Assertions.assertEquals("wpn", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.UNDELETE_BLOB, - 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 55b25a72a181..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,50 +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.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -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.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"principalId\":\"62bb9a4f-ff7f-49c6-b927-91707e8694d3\",\"tenantId\":\"a39a096c-3111-465b-ba88-95485319b4e0\",\"type\":\"None\",\"userAssignedIdentities\":{\"noc\":{\"principalId\":\"9fc3542f-dd5a-4e7d-988a-1714f4435d09\",\"clientId\":\"d6718680-f078-4e29-9567-84185c9a988f\"}}},\"properties\":{\"taskVersion\":3525992913673198952,\"enabled\":false,\"description\":\"yaxuconuqszfkb\",\"action\":{\"if\":{\"condition\":\"ypewrmjmwvvjekt\",\"operations\":[{\"name\":\"SetBlobExpiry\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\"},{\"name\":\"SetBlobLegalHold\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-01-30T03:05:29Z\"},\"location\":\"zpwv\",\"tags\":{\"biqylihkaet\":\"q\",\"fcivfsnkym\":\"kt\",\"jf\":\"ctq\",\"fuwutttxf\":\"ebrjcxe\"},\"id\":\"jrbirphxepcyv\",\"name\":\"hfnljkyq\",\"type\":\"j\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - StorageTask response = manager.storageTasks() - .getByResourceGroupWithResponse("cohoq", "nwvlryavwhheunmm", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("zpwv", response.location()); - Assertions.assertEquals("q", response.tags().get("biqylihkaet")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.identity().type()); - Assertions.assertFalse(response.properties().enabled()); - Assertions.assertEquals("yaxuconuqszfkb", response.properties().description()); - Assertions.assertEquals("ypewrmjmwvvjekt", response.properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_EXPIRY, - response.properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TAGS, - 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 d40177e0a590..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListByResourceGroupMockTests.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.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -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.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"bd1754d9-26cb-422b-af72-bd75760c416b\",\"tenantId\":\"fc005937-dac1-470f-90f8-83f9757c4ebe\",\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"pbh\":{\"principalId\":\"0d374747-7a44-4b93-922f-616e50b004d7\",\"clientId\":\"7a7275ec-0c29-460f-a878-c2ad702951b8\"},\"tkcxywnytnrsy\":{\"principalId\":\"fb708931-95f9-4207-bd2d-e47a99818ac6\",\"clientId\":\"09a9467c-10bf-4a94-bf5b-ca868a13d629\"}}},\"properties\":{\"taskVersion\":7976782507588786268,\"enabled\":true,\"description\":\"ybyxc\",\"action\":{\"if\":{\"condition\":\"fclhaaxdbabphlwr\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobTier\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobImmutabilityPolicy\"},{\"name\":\"SetBlobLegalHold\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaEnd\",\"creationTimeInUtc\":\"2021-12-06T09:51:12Z\"},\"location\":\"mnyyazt\",\"tags\":{\"uedck\":\"wwrq\",\"bxu\":\"ywbiexzfeyueax\"},\"id\":\"wbhqwal\",\"name\":\"uzyoxaep\",\"type\":\"kzjancuxrhdwbav\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response - = manager.storageTasks().listByResourceGroup("ttdbhrbnl", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("mnyyazt", response.iterator().next().location()); - Assertions.assertEquals("wwrq", response.iterator().next().tags().get("uedck")); - Assertions.assertEquals(ManagedServiceIdentityType.SYSTEM_ASSIGNED, - response.iterator().next().identity().type()); - Assertions.assertTrue(response.iterator().next().properties().enabled()); - Assertions.assertEquals("ybyxc", response.iterator().next().properties().description()); - Assertions.assertEquals("fclhaaxdbabphlwr", - response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_IMMUTABILITY_POLICY, - 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 f6de7b1f49d7..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksListMockTests.java +++ /dev/null @@ -1,50 +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.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -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.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"principalId\":\"86428182-8c91-44b6-8efa-d39e7f75367f\",\"tenantId\":\"61fefe32-6acc-437c-b38d-9b808fcbd63d\",\"type\":\"None\",\"userAssignedIdentities\":{\"ok\":{\"principalId\":\"53b4df2f-342a-42a7-bbee-7d6efa18c9f9\",\"clientId\":\"f8930408-eab6-4732-9665-a663651805db\"},\"jyoxgvclt\":{\"principalId\":\"a0e81129-d10b-4182-a51e-3fef4fe158a7\",\"clientId\":\"269a2beb-5f59-4c90-84d5-c210c2ef73a1\"},\"ncghkje\":{\"principalId\":\"c6e8aaea-7223-46d4-af27-a55e99b2a0c8\",\"clientId\":\"6cbde63d-fa7b-4d6d-9c07-93ca62642a97\"},\"hbijhtxfvgxb\":{\"principalId\":\"aa35ebb1-57db-41c1-8b35-76dc989fef05\",\"clientId\":\"1687c360-55dc-4cff-914e-0b8d823645a1\"}}},\"properties\":{\"taskVersion\":7678271281177155084,\"enabled\":true,\"description\":\"eh\",\"action\":{\"if\":{\"condition\":\"pvecxgodeb\",\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobLegalHold\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTier\"},{\"name\":\"SetBlobExpiry\"},{\"name\":\"UndeleteBlob\"}]}},\"provisioningState\":\"ValidateSubscriptionQuotaBegin\",\"creationTimeInUtc\":\"2021-10-09T22:24:23Z\"},\"location\":\"flz\",\"tags\":{\"qzahmgkbrp\":\"xzpuzycisp\",\"hibnuqqkpika\":\"y\",\"buynhijggm\":\"rgvtqag\"},\"id\":\"bfs\",\"name\":\"arbu\",\"type\":\"rcvpnazzmhjrunmp\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.storageTasks().list(com.azure.core.util.Context.NONE); - - Assertions.assertEquals("flz", response.iterator().next().location()); - Assertions.assertEquals("xzpuzycisp", response.iterator().next().tags().get("qzahmgkbrp")); - Assertions.assertEquals(ManagedServiceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertTrue(response.iterator().next().properties().enabled()); - Assertions.assertEquals("eh", response.iterator().next().properties().description()); - Assertions.assertEquals("pvecxgodeb", - response.iterator().next().properties().action().ifProperty().condition()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - response.iterator().next().properties().action().ifProperty().operations().get(0).name()); - Assertions.assertEquals(StorageTaskOperationName.SET_BLOB_TIER, - 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 46eeb296d4e3..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\":\"fb2cce0c-5a9f-4d62-bfa6-69cac2771339\",\"tenantId\":\"7343bdd3-6dfa-4609-b46e-894ac3e2b7e8\",\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ojnxqbzvdd\":{\"principalId\":\"bd2d3779-39dd-46cf-a387-62dfa9d171ed\",\"clientId\":\"c9284c2c-88f6-4a2a-83b1-0cd08b9cc856\"}}},\"properties\":{\"taskVersion\":2783260712694826920,\"enabled\":true,\"description\":\"eic\",\"action\":{\"if\":{\"condition\":\"twnpzaoqvuhrhcf\",\"operations\":[{\"name\":\"SetBlobLegalHold\"},{\"name\":\"SetBlobLegalHold\"},{\"name\":\"DeleteBlob\"},{\"name\":\"DeleteBlob\"}]},\"else\":{\"operations\":[{\"name\":\"SetBlobTags\"},{\"name\":\"UndeleteBlob\"},{\"name\":\"DeleteBlob\"}]}},\"provisioningState\":\"Deleting\",\"creationTimeInUtc\":\"2021-09-17T22:07:46Z\"},\"location\":\"yeicxmqciwqvhk\",\"tags\":{\"m\":\"uigdtopbobjog\",\"a\":\"w\",\"hrzayvvtpgvdf\":\"a\"},\"id\":\"iotkftutqxl\",\"name\":\"gxlefgugnxkrxd\",\"type\":\"mi\"}],\"nextLink\":\"thz\"}") - .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 7aa70d418347..000000000000 --- a/sdk/storageactions/azure-resourcemanager-storageactions/src/test/java/com/azure/resourcemanager/storageactions/generated/StorageTasksReportsListMockTests.java +++ /dev/null @@ -1,37 +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.rest.PagedIterable; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.models.AzureCloud; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.storageactions.StorageActionsManager; -import com.azure.resourcemanager.storageactions.models.StorageTaskReportInstance; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class StorageTasksReportsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"taskAssignmentId\":\"mx\",\"storageAccountId\":\"kv\",\"startTime\":\"elmqk\",\"finishTime\":\"ahvljuaha\",\"objectsTargetedCount\":\"hcdhmdual\",\"objectsOperatedOnCount\":\"xqpvfadmw\",\"objectFailedCount\":\"crgvxpvgom\",\"objectsSucceededCount\":\"fmisg\",\"runStatusError\":\"nbbelda\",\"runStatusEnum\":\"Finished\",\"summaryReportPath\":\"ali\",\"taskId\":\"rqhakauha\",\"taskVersion\":\"sfwxosowzxc\",\"runResult\":\"Succeeded\"},\"id\":\"jooxdjebw\",\"name\":\"ucww\",\"type\":\"vo\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - StorageActionsManager manager = StorageActionsManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureCloud.AZURE_PUBLIC_CLOUD)); - - PagedIterable response = manager.storageTasksReports() - .list("fkuwbcrnwbmehhse", "v", 421254098, "srtslhspkdeem", 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 0b6d48e62809..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\":\"5590b291-ed69-4285-85ba-90acb55a2362\",\"clientId\":\"cb120a63-4804-4a10-bec7-74edc941d74a\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -} diff --git a/sdk/storageactions/azure-resourcemanager-storageactions/tsp-location.yaml b/sdk/storageactions/azure-resourcemanager-storageactions/tsp-location.yaml new file mode 100644 index 000000000000..b1c6551ec97e --- /dev/null +++ b/sdk/storageactions/azure-resourcemanager-storageactions/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/storageactions/StorageAction.Management +commit: b3cda8e13ff3d36e63ea936afa4b6d7fa2cd731f +repo: Azure/azure-rest-api-specs +additionalDirectories: