diff --git a/sdk/chaos/azure-resourcemanager-chaos/CHANGELOG.md b/sdk/chaos/azure-resourcemanager-chaos/CHANGELOG.md index b8119aab96d9..43ca0f821e46 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/CHANGELOG.md +++ b/sdk/chaos/azure-resourcemanager-chaos/CHANGELOG.md @@ -1,14 +1,141 @@ # Release History -## 1.3.0-beta.1 (Unreleased) +## 1.0.0-beta.1 (2025-01-26) -### Features Added +- Azure Resource Manager Chaos client library for Java. This package contains Microsoft Azure SDK for Chaos Management SDK. Chaos Management Client. Package tag package-2025-01. 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.ResourceIdentity` was removed + +#### `models.ResourceIdentityType` was removed + +#### `models.OperationStatus` was removed + +#### `models.TargetType` was modified + +* `location()` was removed + +#### `models.ExperimentExecutionDetails` was modified + +* `failureReason()` was removed +* `status()` was removed +* `runInformation()` was removed +* `stoppedAt()` was removed +* `startedAt()` was removed +* `lastActionAt()` was removed + +#### `models.DelayAction` was modified + +* `java.lang.String type()` -> `models.ExperimentActionType type()` + +#### `models.ContinuousAction` was modified + +* `java.lang.String type()` -> `models.ExperimentActionType type()` + +#### `models.CapabilityType` was modified + +* `location()` was removed + +#### `models.Experiment$Definition` was modified + +* `withIdentity(models.ResourceIdentity)` was removed + +#### `models.ChaosExperimentAction` was modified + +* `java.lang.String type()` -> `models.ExperimentActionType type()` + +#### `models.Experiment` was modified + +* `models.ResourceIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.DiscreteAction` was modified + +* `java.lang.String type()` -> `models.ExperimentActionType type()` + +#### `models.ChaosTargetSelector` was modified + +* `additionalProperties()` was removed +* `withAdditionalProperties(java.util.Map)` was removed + +#### `models.ExperimentUpdate` was modified + +* `withIdentity(models.ResourceIdentity)` was removed +* `models.ResourceIdentity identity()` -> `models.ManagedServiceIdentity identity()` + +#### `models.Experiment$Update` was modified + +* `withIdentity(models.ResourceIdentity)` was removed + +#### `models.OperationStatuses` was modified + +* `models.OperationStatus get(java.lang.String,java.lang.String)` -> `models.OperationStatusResult get(java.lang.String,java.lang.String)` + +### Features Added + +* `models.ExperimentActionType` was added + +* `models.ExperimentExecutionDetailsProperties` was added + +* `models.ManagedServiceIdentityType` was added + +* `models.OperationStatusResult` was added + +* `models.ManagedServiceIdentity` was added + +#### `models.TargetListResult` was modified + +* `withValue(java.util.List)` was added +* `withNextLink(java.lang.String)` was added + +#### `models.ExperimentExecutionDetails` was modified + +* `properties()` was added + +#### `models.CapabilityTypeListResult` was modified + +* `withNextLink(java.lang.String)` was added +* `withValue(java.util.List)` was added + +#### `models.ExperimentListResult` was modified + +* `withValue(java.util.List)` was added +* `withNextLink(java.lang.String)` was added + +#### `models.CapabilityType` was modified + +* `requiredAzureRoleDefinitionIds()` was added + +#### `models.ExperimentExecutionListResult` was modified + +* `withNextLink(java.lang.String)` was added +* `withValue(java.util.List)` was added + +#### `models.ExperimentExecution` was modified + +* `systemData()` was added + +#### `models.Experiment$Definition` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.TargetTypeListResult` was modified + +* `withValue(java.util.List)` was added +* `withNextLink(java.lang.String)` was added + +#### `models.CapabilityListResult` was modified + +* `withValue(java.util.List)` was added +* `withNextLink(java.lang.String)` was added + +#### `models.ExperimentUpdate` was modified + +* `withIdentity(models.ManagedServiceIdentity)` was added + +#### `models.Experiment$Update` was modified -### Other Changes +* `withIdentity(models.ManagedServiceIdentity)` was added ## 1.2.0 (2024-12-19) diff --git a/sdk/chaos/azure-resourcemanager-chaos/README.md b/sdk/chaos/azure-resourcemanager-chaos/README.md index a140203fe8be..f4a3cd47e4ee 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/README.md +++ b/sdk/chaos/azure-resourcemanager-chaos/README.md @@ -2,7 +2,7 @@ Azure Resource Manager Chaos client library for Java. -This package contains Microsoft Azure SDK for Chaos Management SDK. Chaos Management Client. Package tag package-2024-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 Chaos Management SDK. Chaos Management Client. Package tag package-2025-01. 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-chaos - 1.2.0 + 1.3.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/chaos/azure-resourcemanager-chaos/SAMPLE.md b/sdk/chaos/azure-resourcemanager-chaos/SAMPLE.md index a66670314ad0..4a9de666e153 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/SAMPLE.md +++ b/sdk/chaos/azure-resourcemanager-chaos/SAMPLE.md @@ -31,6 +31,10 @@ - [Get](#operationstatuses_get) +## Operations + +- [ListAll](#operations_listall) + ## TargetTypes - [Get](#targettypes_get) @@ -53,7 +57,7 @@ import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; public final class CapabilitiesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_CreateOrUpdate.json */ /** * Sample code: Create/update a Capability that extends a virtual machine Target resource. @@ -78,7 +82,7 @@ public final class CapabilitiesCreateOrUpdateSamples { public final class CapabilitiesDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_Delete.json */ /** * Sample code: Delete a Capability that extends a virtual machine Target resource. @@ -103,7 +107,7 @@ public final class CapabilitiesDeleteSamples { public final class CapabilitiesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_Get.json */ /** * Sample code: Get a Capability that extends a virtual machine Target resource. @@ -128,7 +132,7 @@ public final class CapabilitiesGetSamples { public final class CapabilitiesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListCapabilities.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_List.json */ /** * Sample code: List all Capabilities that extend a virtual machine Target resource. @@ -153,7 +157,7 @@ public final class CapabilitiesListSamples { public final class CapabilityTypesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapabilityType.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/CapabilityTypes_Get.json */ /** * Sample code: Get a Capability Type for a virtual machine Target resource on westus2 location. @@ -177,7 +181,7 @@ public final class CapabilityTypesGetSamples { public final class CapabilityTypesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListCapabilityTypes.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/CapabilityTypes_List.json */ /** * Sample code: List all Capability Types for a virtual machine Target resource on westus2 location. @@ -200,7 +204,7 @@ public final class CapabilityTypesListSamples { public final class ExperimentsCancelSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CancelExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Cancel.json */ /** * Sample code: Cancel a running Experiment. @@ -221,12 +225,14 @@ import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; import com.azure.resourcemanager.chaos.models.ChaosTargetListSelector; import com.azure.resourcemanager.chaos.models.ContinuousAction; import com.azure.resourcemanager.chaos.models.KeyValuePair; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentityType; import com.azure.resourcemanager.chaos.models.TargetReference; import com.azure.resourcemanager.chaos.models.TargetReferenceType; import java.time.Duration; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for Experiments CreateOrUpdate. @@ -234,7 +240,7 @@ import java.util.Arrays; public final class ExperimentsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_CreateOrUpdate.json */ /** * Sample code: Create/update a Experiment in a resource group. @@ -259,9 +265,22 @@ public final class ExperimentsCreateOrUpdateSamples { .withTargets(Arrays.asList(new TargetReference().withType(TargetReferenceType.CHAOS_TARGET) .withId( "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"))))) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTags(mapOf("key2138", "fakeTokenPlaceholder", "key7131", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) .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; + } } ``` @@ -274,7 +293,7 @@ public final class ExperimentsCreateOrUpdateSamples { public final class ExperimentsDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Delete.json */ /** * Sample code: Delete a Experiment in a resource group. @@ -296,7 +315,7 @@ public final class ExperimentsDeleteSamples { public final class ExperimentsExecutionDetailsSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DetailsExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ExecutionDetails.json */ /** * Sample code: Get experiment execution details. @@ -320,7 +339,7 @@ public final class ExperimentsExecutionDetailsSamples { public final class ExperimentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Get.json */ /** * Sample code: Get a Experiment in a resource group. @@ -343,7 +362,7 @@ public final class ExperimentsGetByResourceGroupSamples { public final class ExperimentsGetExecutionSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_GetExecution.json */ /** * Sample code: Get the execution of a Experiment. @@ -367,8 +386,7 @@ public final class ExperimentsGetExecutionSamples { public final class ExperimentsListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInASubscription. - * json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ListAll.json */ /** * Sample code: List all Experiments in a subscription. @@ -390,7 +408,8 @@ public final class ExperimentsListSamples { public final class ExperimentsListAllExecutionsSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentExecutions.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ListAllExecutions. + * json */ /** * Sample code: List all executions of an Experiment. @@ -412,8 +431,7 @@ public final class ExperimentsListAllExecutionsSamples { public final class ExperimentsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInAResourceGroup. - * json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_List.json */ /** * Sample code: List all Experiments in a resource group. @@ -435,7 +453,7 @@ public final class ExperimentsListByResourceGroupSamples { public final class ExperimentsStartSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/StartExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Start.json */ /** * Sample code: Start a Experiment. @@ -452,8 +470,8 @@ public final class ExperimentsStartSamples { ```java import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentityType; import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; @@ -464,7 +482,7 @@ import java.util.Map; public final class ExperimentsUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/UpdateExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Update.json */ /** * Sample code: Update an Experiment in a resource group. @@ -477,7 +495,7 @@ public final class ExperimentsUpdateSamples { .getValue(); resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI", new UserAssignedIdentity()))) @@ -507,16 +525,38 @@ public final class ExperimentsUpdateSamples { public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetOperationStatus.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/OperationStatuses_Get.json */ /** - * Sample code: Get specific operation status. + * Sample code: Gets Chaos Studio async operation status. * * @param manager Entry point to ChaosManager. */ - public static void getSpecificOperationStatus(com.azure.resourcemanager.chaos.ChaosManager manager) { + public static void getsChaosStudioAsyncOperationStatus(com.azure.resourcemanager.chaos.ChaosManager manager) { manager.operationStatuses() - .getWithResponse("West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", com.azure.core.util.Context.NONE); + .getWithResponse("westus2", "4bdadd97-207c-4de8-9bba-08339ae099c7", com.azure.core.util.Context.NONE); + } +} +``` + +### Operations_ListAll + +```java +/** + * Samples for Operations ListAll. + */ +public final class OperationsListAllSamples { + /* + * x-ms-original-file: + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Operations_List.json + */ + /** + * Sample code: Lists all Chaos Studio operations. + * + * @param manager Entry point to ChaosManager. + */ + public static void listsAllChaosStudioOperations(com.azure.resourcemanager.chaos.ChaosManager manager) { + manager.operations().listAll(com.azure.core.util.Context.NONE); } } ``` @@ -530,7 +570,7 @@ public final class OperationStatusesGetSamples { public final class TargetTypesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/TargetTypes_Get.json */ /** * Sample code: Get a Target Type for westus2 location. @@ -552,7 +592,7 @@ public final class TargetTypesGetSamples { public final class TargetTypesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListTargetTypes.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/TargetTypes_List.json */ /** * Sample code: List all Target Types for westus2 location. @@ -568,10 +608,7 @@ public final class TargetTypesListSamples { ### Targets_CreateOrUpdate ```java -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -581,22 +618,18 @@ import java.util.Map; public final class TargetsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_CreateOrUpdate.json */ /** * Sample code: Create/update a Target that extends a virtual machine resource. * * @param manager Entry point to ChaosManager. */ - public static void createUpdateATargetThatExtendsAVirtualMachineResource( - com.azure.resourcemanager.chaos.ChaosManager manager) throws IOException { + public static void + createUpdateATargetThatExtendsAVirtualMachineResource(com.azure.resourcemanager.chaos.ChaosManager manager) { manager.targets() .createOrUpdateWithResponse("exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", - "Microsoft-Agent", - new TargetInner().withProperties(mapOf("identities", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[{\"type\":\"CertificateSubjectIssuer\",\"subject\":\"CN=example.subject\"}]", - Object.class, SerializerEncoding.JSON))), + "Microsoft-VirtualMachine", new TargetInner().withProperties(mapOf()), com.azure.core.util.Context.NONE); } @@ -623,7 +656,7 @@ public final class TargetsCreateOrUpdateSamples { public final class TargetsDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_Delete.json */ /** * Sample code: Delete a Target that extends a virtual machine resource. @@ -648,7 +681,7 @@ public final class TargetsDeleteSamples { public final class TargetsGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_Get.json */ /** * Sample code: Get a Target that extends a virtual machine resource. @@ -673,7 +706,7 @@ public final class TargetsGetSamples { public final class TargetsListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListTargets.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_List.json */ /** * Sample code: List all Targets that extend a virtual machine resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/pom.xml b/sdk/chaos/azure-resourcemanager-chaos/pom.xml index ad034488b524..db0fcd7fdba9 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/pom.xml +++ b/sdk/chaos/azure-resourcemanager-chaos/pom.xml @@ -18,7 +18,7 @@ jar Microsoft Azure SDK for Chaos Management - This package contains Microsoft Azure SDK for Chaos Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Chaos Management Client. Package tag package-2024-01. + This package contains Microsoft Azure SDK for Chaos Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Chaos Management Client. Package tag package-2025-01. https://github.com/Azure/azure-sdk-for-java @@ -45,8 +45,8 @@ UTF-8 0 0 - false true + false diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java index 97227acbd3a5..2485a577d0a7 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java @@ -51,20 +51,20 @@ * Chaos Management Client. */ public final class ChaosManager { - private Capabilities capabilities; - - private CapabilityTypes capabilityTypes; + private Operations operations; private Experiments experiments; private OperationStatuses operationStatuses; - private Operations operations; - private TargetTypes targetTypes; + private CapabilityTypes capabilityTypes; + private Targets targets; + private Capabilities capabilities; + private final ChaosManagementClient clientObject; private ChaosManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { @@ -229,7 +229,7 @@ public ChaosManager authenticate(TokenCredential credential, AzureProfile profil .append("-") .append("com.azure.resourcemanager.chaos") .append("/") - .append("1.2.0"); + .append("1.0.0-beta.1"); if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { userAgentBuilder.append(" (") .append(Configuration.getGlobalConfiguration().get("java.version")) @@ -276,27 +276,15 @@ public ChaosManager authenticate(TokenCredential credential, AzureProfile profil } /** - * Gets the resource collection API of Capabilities. - * - * @return Resource collection API of Capabilities. - */ - public Capabilities capabilities() { - if (this.capabilities == null) { - this.capabilities = new CapabilitiesImpl(clientObject.getCapabilities(), this); - } - return capabilities; - } - - /** - * Gets the resource collection API of CapabilityTypes. + * Gets the resource collection API of Operations. * - * @return Resource collection API of CapabilityTypes. + * @return Resource collection API of Operations. */ - public CapabilityTypes capabilityTypes() { - if (this.capabilityTypes == null) { - this.capabilityTypes = new CapabilityTypesImpl(clientObject.getCapabilityTypes(), this); + public Operations operations() { + if (this.operations == null) { + this.operations = new OperationsImpl(clientObject.getOperations(), this); } - return capabilityTypes; + return operations; } /** @@ -323,18 +311,6 @@ public OperationStatuses operationStatuses() { return operationStatuses; } - /** - * Gets the resource collection API of Operations. - * - * @return Resource collection API of Operations. - */ - public Operations operations() { - if (this.operations == null) { - this.operations = new OperationsImpl(clientObject.getOperations(), this); - } - return operations; - } - /** * Gets the resource collection API of TargetTypes. * @@ -347,6 +323,18 @@ public TargetTypes targetTypes() { return targetTypes; } + /** + * Gets the resource collection API of CapabilityTypes. + * + * @return Resource collection API of CapabilityTypes. + */ + public CapabilityTypes capabilityTypes() { + if (this.capabilityTypes == null) { + this.capabilityTypes = new CapabilityTypesImpl(clientObject.getCapabilityTypes(), this); + } + return capabilityTypes; + } + /** * Gets the resource collection API of Targets. * @@ -359,6 +347,18 @@ public Targets targets() { return targets; } + /** + * Gets the resource collection API of Capabilities. + * + * @return Resource collection API of Capabilities. + */ + public Capabilities capabilities() { + if (this.capabilities == null) { + this.capabilities = new CapabilitiesImpl(clientObject.getCapabilities(), this); + } + return capabilities; + } + /** * Gets wrapped service client ChaosManagementClient providing direct access to the underlying auto-generated API * implementation, based on Azure REST API. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java index 711876aab678..a9206b44d00c 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java @@ -16,17 +16,17 @@ */ public interface CapabilitiesClient { /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @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 a list of Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -34,19 +34,19 @@ PagedIterable list(String resourceGroupName, String parentProvi String parentResourceType, String parentResourceName, String targetName); /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 a list of Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -57,10 +57,10 @@ PagedIterable list(String resourceGroupName, String parentProvi /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @param context The context to associate with this operation. @@ -77,10 +77,10 @@ Response getWithResponse(String resourceGroupName, String paren /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -93,79 +93,79 @@ CapabilityInner get(String resourceGroupName, String parentProviderNamespace, St String parentResourceName, String targetName, String capabilityName); /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 Response}. + * @return model that represents a Capability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - Context context); + CapabilityInner resource, Context context); /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 model that represents a Capability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName); + CapabilityInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName, CapabilityInner resource); /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, + Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability, Context context); + Context context); /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName, CapabilityInner capability); + void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java index 723d735439ac..659e98011b2c 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java @@ -18,7 +18,7 @@ public interface CapabilityTypesClient { /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -27,12 +27,12 @@ public interface CapabilityTypesClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String targetTypeName); + PagedIterable list(String location, String targetTypeName); /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. @@ -43,13 +43,13 @@ public interface CapabilityTypesClient { * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String targetTypeName, String continuationToken, + PagedIterable list(String location, String targetTypeName, String continuationToken, Context context); /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @param context The context to associate with this operation. @@ -59,13 +59,13 @@ PagedIterable list(String locationName, String targetTypeNa * @return a Capability Type resource for given Target Type and location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String targetTypeName, String capabilityTypeName, + Response getWithResponse(String location, String targetTypeName, String capabilityTypeName, Context context); /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -74,5 +74,5 @@ Response getWithResponse(String locationName, String target * @return a Capability Type resource for given Target Type and location. */ @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityTypeInner get(String locationName, String targetTypeName, String capabilityTypeName); + CapabilityTypeInner get(String location, String targetTypeName, String capabilityTypeName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java index 0957af884ce8..5bca5dc4c8fd 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java @@ -12,7 +12,7 @@ */ public interface ChaosManagementClient { /** - * Gets GUID that represents an Azure subscription ID. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -47,18 +47,11 @@ public interface ChaosManagementClient { Duration getDefaultPollInterval(); /** - * Gets the CapabilitiesClient object to access its operations. - * - * @return the CapabilitiesClient object. - */ - CapabilitiesClient getCapabilities(); - - /** - * Gets the CapabilityTypesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the CapabilityTypesClient object. + * @return the OperationsClient object. */ - CapabilityTypesClient getCapabilityTypes(); + OperationsClient getOperations(); /** * Gets the ExperimentsClient object to access its operations. @@ -75,18 +68,18 @@ public interface ChaosManagementClient { OperationStatusesClient getOperationStatuses(); /** - * Gets the OperationsClient object to access its operations. + * Gets the TargetTypesClient object to access its operations. * - * @return the OperationsClient object. + * @return the TargetTypesClient object. */ - OperationsClient getOperations(); + TargetTypesClient getTargetTypes(); /** - * Gets the TargetTypesClient object to access its operations. + * Gets the CapabilityTypesClient object to access its operations. * - * @return the TargetTypesClient object. + * @return the CapabilityTypesClient object. */ - TargetTypesClient getTargetTypes(); + CapabilityTypesClient getCapabilityTypes(); /** * Gets the TargetsClient object to access its operations. @@ -94,4 +87,11 @@ public interface ChaosManagementClient { * @return the TargetsClient object. */ TargetsClient getTargets(); + + /** + * Gets the CapabilitiesClient object to access its operations. + * + * @return the CapabilitiesClient object. + */ + CapabilitiesClient getCapabilities(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java index 266e6c4ba7ea..580ab736c901 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java @@ -48,7 +48,7 @@ public interface ExperimentsClient { /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -60,7 +60,7 @@ public interface ExperimentsClient { /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -74,62 +74,10 @@ public interface ExperimentsClient { PagedIterable listByResourceGroup(String resourceGroupName, Boolean running, String continuationToken, Context context); - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName); - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName, Context context); - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String experimentName); - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String experimentName, Context context); - /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -144,7 +92,7 @@ Response getByResourceGroupWithResponse(String resourceGroupNam /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -157,9 +105,9 @@ Response getByResourceGroupWithResponse(String resourceGroupNam /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -167,14 +115,14 @@ Response getByResourceGroupWithResponse(String resourceGroupNam */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName, - String experimentName, ExperimentInner experiment); + String experimentName, ExperimentInner resource); /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -183,28 +131,28 @@ SyncPoller, ExperimentInner> beginCreateOrUpdate(Str */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName, - String experimentName, ExperimentInner experiment, Context context); + String experimentName, ExperimentInner resource, Context context); /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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 model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment); + ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner resource); /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -212,15 +160,15 @@ SyncPoller, ExperimentInner> beginCreateOrUpdate(Str * @return model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment, + ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner resource, Context context); /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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. @@ -228,14 +176,14 @@ ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName, - String experimentName, ExperimentUpdate experiment); + String experimentName, ExperimentUpdate properties); /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -244,28 +192,28 @@ SyncPoller, ExperimentInner> beginUpdate(String reso */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName, - String experimentName, ExperimentUpdate experiment, Context context); + String experimentName, ExperimentUpdate properties, Context context); /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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 model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment); + ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate properties); /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -273,13 +221,13 @@ SyncPoller, ExperimentInner> beginUpdate(String reso * @return model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment, + ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate properties, Context context); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -287,12 +235,12 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName); + SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -301,24 +249,24 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName, Context context); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String experimentName); + void delete(String resourceGroupName, String experimentName); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -326,12 +274,12 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void cancel(String resourceGroupName, String experimentName, Context context); + void delete(String resourceGroupName, String experimentName, Context context); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -339,12 +287,12 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String experimentName); + SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -353,24 +301,24 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginStart(String resourceGroupName, String experimentName, Context context); + SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName, Context context); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String experimentName); + void cancel(String resourceGroupName, String experimentName); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -378,12 +326,12 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - void start(String resourceGroupName, String experimentName, Context context); + void cancel(String resourceGroupName, String experimentName, Context context); /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -396,7 +344,7 @@ ExperimentInner update(String resourceGroupName, String experimentName, Experime /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -411,7 +359,7 @@ PagedIterable listAllExecutions(String resourceGroupNa /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -427,7 +375,7 @@ Response getExecutionWithResponse(String resourceGroup /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -441,7 +389,7 @@ Response getExecutionWithResponse(String resourceGroup /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -457,7 +405,7 @@ Response executionDetailsWithResponse(String re /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -468,4 +416,56 @@ Response executionDetailsWithResponse(String re @ServiceMethod(returns = ReturnType.SINGLE) ExperimentExecutionDetailsInner executionDetails(String resourceGroupName, String experimentName, String executionId); + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String experimentName); + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginStart(String resourceGroupName, String experimentName, Context context); + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String experimentName); + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + void start(String resourceGroupName, String experimentName, Context context); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationStatusesClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationStatusesClient.java index 87083b88e1ee..01de49de494e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationStatusesClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationStatusesClient.java @@ -8,36 +8,36 @@ import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner; /** * An instance of this class provides access to all the operations defined in OperationStatusesClient. */ public interface OperationStatusesClient { /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async operation. * @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 status of a long running azure asynchronous operation along with {@link Response}. + * @return the current status of an async operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String location, String asyncOperationId, Context context); + Response getWithResponse(String location, String operationId, Context context); /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async 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 status of a long running azure asynchronous operation. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - OperationStatusInner get(String location, String asyncOperationId); + OperationStatusResultInner get(String location, String operationId); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java index 6be2ec3d60b2..2989c0dafb7a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java @@ -15,23 +15,25 @@ */ public interface OperationsClient { /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 a list all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAll(); /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 a list all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listAll(Context context); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java index 92e8fb223c8f..01639c997d89 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java @@ -18,19 +18,19 @@ public interface TargetTypesClient { /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @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 a list of Target Type resources for given location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName); + PagedIterable list(String location); /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -39,12 +39,12 @@ public interface TargetTypesClient { * @return a list of Target Type resources for given location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String continuationToken, Context context); + PagedIterable list(String location, String continuationToken, Context context); /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -53,12 +53,12 @@ public interface TargetTypesClient { * @return a Target Type resources for given location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String targetTypeName, Context context); + Response getWithResponse(String location, String targetTypeName, Context context); /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -66,5 +66,5 @@ public interface TargetTypesClient { * @return a Target Type resources for given location. */ @ServiceMethod(returns = ReturnType.SINGLE) - TargetTypeInner get(String locationName, String targetTypeName); + TargetTypeInner get(String location, String targetTypeName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java index 0caf92afda5d..5a2a0c90c7a9 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java @@ -18,10 +18,10 @@ public interface TargetsClient { /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @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. @@ -35,10 +35,10 @@ PagedIterable list(String resourceGroupName, String parentProviderN /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -54,10 +54,10 @@ PagedIterable list(String resourceGroupName, String parentProviderN /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -72,10 +72,10 @@ Response getWithResponse(String resourceGroupName, String parentPro /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -87,73 +87,73 @@ TargetInner get(String resourceGroupName, String parentProviderNamespace, String String parentResourceName, String targetName); /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 Response}. + * @return model that represents a Target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, TargetInner resource, Context context); /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 model that represents a Target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName); + TargetInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, TargetInner resource); /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target, Context context); + Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, Context context); /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - TargetInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, TargetInner target); + void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java index 88dd47d4314f..0440075ed445 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java @@ -18,14 +18,14 @@ @Immutable public final class CapabilityInner extends ProxyResource { /* - * The standard system metadata of a resource type. + * The properties of a capability resource. */ - private SystemData systemData; + private CapabilityProperties innerProperties; /* - * The properties of a capability resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private CapabilityProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -49,21 +49,21 @@ public CapabilityInner() { } /** - * Get the systemData property: The standard system metadata of a resource type. + * Get the innerProperties property: The properties of a capability resource. * - * @return the systemData value. + * @return the innerProperties value. */ - public SystemData systemData() { - return this.systemData; + private CapabilityProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: The properties of a capability resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private CapabilityProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -158,6 +158,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -183,10 +184,10 @@ public static CapabilityInner fromJson(JsonReader jsonReader) throws IOException deserializedCapabilityInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCapabilityInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCapabilityInner.systemData = SystemData.fromJson(reader); } else if ("properties".equals(fieldName)) { deserializedCapabilityInner.innerProperties = CapabilityProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCapabilityInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java index 16d896faffe0..72409082d016 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.chaos.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; @@ -17,22 +17,17 @@ /** * Model that represents a Capability Type resource. */ -@Fluent +@Immutable public final class CapabilityTypeInner extends ProxyResource { /* - * The system metadata properties of the capability type resource. - */ - private SystemData systemData; - - /* - * Location of the Capability Type resource. + * The properties of the capability type resource. */ - private String location; + private CapabilityTypeProperties innerProperties; /* - * The properties of the capability type resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private CapabilityTypeProperties innerProperties; + private SystemData systemData; /* * The type of the resource. @@ -56,41 +51,21 @@ public CapabilityTypeInner() { } /** - * Get the systemData property: The system metadata properties of the capability type resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the location property: Location of the Capability Type resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the Capability Type resource. + * Get the innerProperties property: The properties of the capability type resource. * - * @param location the location value to set. - * @return the CapabilityTypeInner object itself. + * @return the innerProperties value. */ - public CapabilityTypeInner withLocation(String location) { - this.location = location; - return this; + private CapabilityTypeProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: The properties of the capability type resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private CapabilityTypeProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -195,20 +170,6 @@ public List azureRbacActions() { return this.innerProperties() == null ? null : this.innerProperties().azureRbacActions(); } - /** - * Set the azureRbacActions property: Control plane actions necessary to execute capability type. - * - * @param azureRbacActions the azureRbacActions value to set. - * @return the CapabilityTypeInner object itself. - */ - public CapabilityTypeInner withAzureRbacActions(List azureRbacActions) { - if (this.innerProperties() == null) { - this.innerProperties = new CapabilityTypeProperties(); - } - this.innerProperties().withAzureRbacActions(azureRbacActions); - return this; - } - /** * Get the azureRbacDataActions property: Data plane actions necessary to execute capability type. * @@ -219,17 +180,12 @@ public List azureRbacDataActions() { } /** - * Set the azureRbacDataActions property: Data plane actions necessary to execute capability type. + * Get the requiredAzureRoleDefinitionIds property: Required Azure Role Definition Ids to execute capability type. * - * @param azureRbacDataActions the azureRbacDataActions value to set. - * @return the CapabilityTypeInner object itself. + * @return the requiredAzureRoleDefinitionIds value. */ - public CapabilityTypeInner withAzureRbacDataActions(List azureRbacDataActions) { - if (this.innerProperties() == null) { - this.innerProperties = new CapabilityTypeProperties(); - } - this.innerProperties().withAzureRbacDataActions(azureRbacDataActions); - return this; + public List requiredAzureRoleDefinitionIds() { + return this.innerProperties() == null ? null : this.innerProperties().requiredAzureRoleDefinitionIds(); } /** @@ -241,20 +197,6 @@ public CapabilityTypePropertiesRuntimeProperties runtimeProperties() { return this.innerProperties() == null ? null : this.innerProperties().runtimeProperties(); } - /** - * Set the runtimeProperties property: Runtime properties of this Capability Type. - * - * @param runtimeProperties the runtimeProperties value to set. - * @return the CapabilityTypeInner object itself. - */ - public CapabilityTypeInner withRuntimeProperties(CapabilityTypePropertiesRuntimeProperties runtimeProperties) { - if (this.innerProperties() == null) { - this.innerProperties = new CapabilityTypeProperties(); - } - this.innerProperties().withRuntimeProperties(runtimeProperties); - return this; - } - /** * Validates the instance. * @@ -272,7 +214,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -298,12 +240,10 @@ public static CapabilityTypeInner fromJson(JsonReader jsonReader) throws IOExcep deserializedCapabilityTypeInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCapabilityTypeInner.type = reader.getString(); - } else if ("systemData".equals(fieldName)) { - deserializedCapabilityTypeInner.systemData = SystemData.fromJson(reader); - } else if ("location".equals(fieldName)) { - deserializedCapabilityTypeInner.location = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedCapabilityTypeInner.innerProperties = CapabilityTypeProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCapabilityTypeInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java index 1dad8bc5d866..b1713e3245d3 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.chaos.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; @@ -16,7 +16,7 @@ /** * Model that represents the Capability Type properties model. */ -@Fluent +@Immutable public final class CapabilityTypeProperties implements JsonSerializable { /* * String of the Publisher that this Capability Type extends. @@ -63,6 +63,11 @@ public final class CapabilityTypeProperties implements JsonSerializable azureRbacDataActions; + /* + * Required Azure Role Definition Ids to execute capability type. + */ + private List requiredAzureRoleDefinitionIds; + /* * Runtime properties of this Capability Type. */ @@ -146,17 +151,6 @@ public List azureRbacActions() { return this.azureRbacActions; } - /** - * Set the azureRbacActions property: Control plane actions necessary to execute capability type. - * - * @param azureRbacActions the azureRbacActions value to set. - * @return the CapabilityTypeProperties object itself. - */ - public CapabilityTypeProperties withAzureRbacActions(List azureRbacActions) { - this.azureRbacActions = azureRbacActions; - return this; - } - /** * Get the azureRbacDataActions property: Data plane actions necessary to execute capability type. * @@ -167,14 +161,12 @@ public List azureRbacDataActions() { } /** - * Set the azureRbacDataActions property: Data plane actions necessary to execute capability type. + * Get the requiredAzureRoleDefinitionIds property: Required Azure Role Definition Ids to execute capability type. * - * @param azureRbacDataActions the azureRbacDataActions value to set. - * @return the CapabilityTypeProperties object itself. + * @return the requiredAzureRoleDefinitionIds value. */ - public CapabilityTypeProperties withAzureRbacDataActions(List azureRbacDataActions) { - this.azureRbacDataActions = azureRbacDataActions; - return this; + public List requiredAzureRoleDefinitionIds() { + return this.requiredAzureRoleDefinitionIds; } /** @@ -186,17 +178,6 @@ public CapabilityTypePropertiesRuntimeProperties runtimeProperties() { return this.runtimeProperties; } - /** - * Set the runtimeProperties property: Runtime properties of this Capability Type. - * - * @param runtimeProperties the runtimeProperties value to set. - * @return the CapabilityTypeProperties object itself. - */ - public CapabilityTypeProperties withRuntimeProperties(CapabilityTypePropertiesRuntimeProperties runtimeProperties) { - this.runtimeProperties = runtimeProperties; - return this; - } - /** * Validates the instance. * @@ -214,11 +195,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeArrayField("azureRbacActions", this.azureRbacActions, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeArrayField("azureRbacDataActions", this.azureRbacDataActions, - (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("runtimeProperties", this.runtimeProperties); return jsonWriter.writeEndObject(); } @@ -257,6 +233,10 @@ public static CapabilityTypeProperties fromJson(JsonReader jsonReader) throws IO } else if ("azureRbacDataActions".equals(fieldName)) { List azureRbacDataActions = reader.readArray(reader1 -> reader1.getString()); deserializedCapabilityTypeProperties.azureRbacDataActions = azureRbacDataActions; + } else if ("requiredAzureRoleDefinitionIds".equals(fieldName)) { + List requiredAzureRoleDefinitionIds = reader.readArray(reader1 -> reader1.getString()); + deserializedCapabilityTypeProperties.requiredAzureRoleDefinitionIds + = requiredAzureRoleDefinitionIds; } else if ("runtimeProperties".equals(fieldName)) { deserializedCapabilityTypeProperties.runtimeProperties = CapabilityTypePropertiesRuntimeProperties.fromJson(reader); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java index ce9678995479..a7f261d5c42d 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java @@ -9,9 +9,8 @@ import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; +import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsProperties; import java.io.IOException; -import java.time.OffsetDateTime; /** * Model that represents the execution details of an Experiment. @@ -36,7 +35,7 @@ public final class ExperimentExecutionDetailsInner implements JsonSerializable { +public final class ExperimentExecutionInner extends ProxyResource { /* - * String of the resource type. + * The properties of experiment execution status. */ - private String type; + private ExperimentExecutionProperties innerProperties; /* - * String of the fully qualified resource ID. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String id; + private SystemData systemData; /* - * String of the resource name. + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. */ private String name; /* - * The properties of experiment execution status. + * Fully qualified resource Id for the resource. */ - private ExperimentExecutionProperties innerProperties; + private String id; /** * Creates an instance of ExperimentExecutionInner class. @@ -44,39 +50,51 @@ public ExperimentExecutionInner() { } /** - * Get the type property: String of the resource type. + * Get the innerProperties property: The properties of experiment execution status. * - * @return the type value. + * @return the innerProperties value. */ - public String type() { - return this.type; + private ExperimentExecutionProperties innerProperties() { + return this.innerProperties; } /** - * Get the id property: String of the fully qualified resource ID. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the id value. + * @return the systemData value. */ - public String id() { - return this.id; + public SystemData systemData() { + return this.systemData; } /** - * Get the name property: String of the resource name. + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. * * @return the name value. */ + @Override public String name() { return this.name; } /** - * Get the innerProperties property: The properties of experiment execution status. + * Get the id property: Fully qualified resource Id for the resource. * - * @return the innerProperties value. + * @return the id value. */ - private ExperimentExecutionProperties innerProperties() { - return this.innerProperties; + @Override + public String id() { + return this.id; } /** @@ -133,6 +151,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExperimentExecutionInner 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 ExperimentExecutionInner. */ public static ExperimentExecutionInner fromJson(JsonReader jsonReader) throws IOException { @@ -142,15 +161,17 @@ public static ExperimentExecutionInner fromJson(JsonReader jsonReader) throws IO String fieldName = reader.getFieldName(); reader.nextToken(); - if ("type".equals(fieldName)) { - deserializedExperimentExecutionInner.type = reader.getString(); - } else if ("id".equals(fieldName)) { + if ("id".equals(fieldName)) { deserializedExperimentExecutionInner.id = reader.getString(); } else if ("name".equals(fieldName)) { deserializedExperimentExecutionInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedExperimentExecutionInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedExperimentExecutionInner.innerProperties = ExperimentExecutionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedExperimentExecutionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionProperties.java index 338aa56c85a7..dee02d8b6c32 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionProperties.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionProperties.java @@ -17,7 +17,7 @@ * Model that represents the execution properties of an Experiment. */ @Immutable -public class ExperimentExecutionProperties implements JsonSerializable { +public final class ExperimentExecutionProperties implements JsonSerializable { /* * The status of the execution. */ @@ -48,17 +48,6 @@ public String status() { return this.status; } - /** - * Set the status property: The status of the execution. - * - * @param status the status value to set. - * @return the ExperimentExecutionProperties object itself. - */ - ExperimentExecutionProperties withStatus(String status) { - this.status = status; - return this; - } - /** * Get the startedAt property: String that represents the start date time. * @@ -68,17 +57,6 @@ public OffsetDateTime startedAt() { return this.startedAt; } - /** - * Set the startedAt property: String that represents the start date time. - * - * @param startedAt the startedAt value to set. - * @return the ExperimentExecutionProperties object itself. - */ - ExperimentExecutionProperties withStartedAt(OffsetDateTime startedAt) { - this.startedAt = startedAt; - return this; - } - /** * Get the stoppedAt property: String that represents the stop date time. * @@ -88,17 +66,6 @@ public OffsetDateTime stoppedAt() { return this.stoppedAt; } - /** - * Set the stoppedAt property: String that represents the stop date time. - * - * @param stoppedAt the stoppedAt value to set. - * @return the ExperimentExecutionProperties object itself. - */ - ExperimentExecutionProperties withStoppedAt(OffsetDateTime stoppedAt) { - this.stoppedAt = stoppedAt; - return this; - } - /** * Validates the instance. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java index b034403833ae..20911b6c5fd2 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java @@ -13,8 +13,8 @@ import com.azure.json.JsonWriter; import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; import com.azure.resourcemanager.chaos.models.ProvisioningState; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; import java.io.IOException; import java.util.List; import java.util.Map; @@ -25,19 +25,19 @@ @Fluent public final class ExperimentInner extends Resource { /* - * The system metadata of the experiment resource. + * The managed service identities assigned to this resource. */ - private SystemData systemData; + private ManagedServiceIdentity identity; /* - * The identity of the experiment resource. + * The properties of the experiment resource. */ - private ResourceIdentity identity; + private ExperimentProperties innerProperties = new ExperimentProperties(); /* - * The properties of the experiment resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private ExperimentProperties innerProperties = new ExperimentProperties(); + private SystemData systemData; /* * The type of the resource. @@ -61,30 +61,21 @@ public ExperimentInner() { } /** - * Get the systemData property: The system metadata of the experiment resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the identity property: The identity of the experiment resource. + * Get the identity property: The managed service identities assigned to this resource. * * @return the identity value. */ - public ResourceIdentity identity() { + public ManagedServiceIdentity identity() { return this.identity; } /** - * Set the identity property: The identity of the experiment resource. + * Set the identity property: The managed service identities assigned to this resource. * * @param identity the identity value to set. * @return the ExperimentInner object itself. */ - public ExperimentInner withIdentity(ResourceIdentity identity) { + public ExperimentInner withIdentity(ManagedServiceIdentity identity) { this.identity = identity; return this; } @@ -98,6 +89,15 @@ private ExperimentProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -263,10 +263,10 @@ public static ExperimentInner fromJson(JsonReader jsonReader) throws IOException deserializedExperimentInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedExperimentInner.innerProperties = ExperimentProperties.fromJson(reader); + } else if ("identity".equals(fieldName)) { + deserializedExperimentInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedExperimentInner.systemData = SystemData.fromJson(reader); - } else if ("identity".equals(fieldName)) { - deserializedExperimentInner.identity = ResourceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java deleted file mode 100644 index bfcf9bb40f92..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusInner.java +++ /dev/null @@ -1,214 +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.chaos.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.management.exception.ManagementError; -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 java.io.IOException; -import java.time.OffsetDateTime; - -/** - * The status of operation. - */ -@Fluent -public final class OperationStatusInner implements JsonSerializable { - /* - * The operation Id. - */ - private String id; - - /* - * The operation name. - */ - private String name; - - /* - * The start time of the operation. - */ - private OffsetDateTime startTime; - - /* - * The end time of the operation. - */ - private OffsetDateTime endTime; - - /* - * The status of the operation. - */ - private String status; - - /* - * The error object. - */ - private ManagementError error; - - /** - * Creates an instance of OperationStatusInner class. - */ - public OperationStatusInner() { - } - - /** - * Get the id property: The operation Id. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: The operation Id. - * - * @param id the id value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withId(String id) { - this.id = id; - return this; - } - - /** - * Get the name property: The operation name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: The operation name. - * - * @param name the name value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withName(String name) { - this.name = name; - return this; - } - - /** - * Get the startTime property: The start time of the operation. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: The end time of the operation. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the status property: The status of the operation. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Set the status property: The status of the operation. - * - * @param status the status value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withStatus(String status) { - this.status = status; - return this; - } - - /** - * Get the error property: The error object. - * - * @return the error value. - */ - public ManagementError error() { - return this.error; - } - - /** - * Set the error property: The error object. - * - * @param error the error value to set. - * @return the OperationStatusInner object itself. - */ - public OperationStatusInner withError(ManagementError error) { - this.error = error; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - jsonWriter.writeStringField("id", this.id); - jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("status", this.status); - jsonWriter.writeJsonField("error", this.error); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of OperationStatusInner from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of OperationStatusInner 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 OperationStatusInner. - */ - public static OperationStatusInner fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - OperationStatusInner deserializedOperationStatusInner = new OperationStatusInner(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("id".equals(fieldName)) { - deserializedOperationStatusInner.id = reader.getString(); - } else if ("name".equals(fieldName)) { - deserializedOperationStatusInner.name = reader.getString(); - } else if ("startTime".equals(fieldName)) { - deserializedOperationStatusInner.startTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("endTime".equals(fieldName)) { - deserializedOperationStatusInner.endTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("status".equals(fieldName)) { - deserializedOperationStatusInner.status = reader.getString(); - } else if ("error".equals(fieldName)) { - deserializedOperationStatusInner.error = ManagementError.fromJson(reader); - } else { - reader.skipChildren(); - } - } - - return deserializedOperationStatusInner; - }); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusResultInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusResultInner.java new file mode 100644 index 000000000000..6cfdebb3e1b9 --- /dev/null +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationStatusResultInner.java @@ -0,0 +1,329 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.chaos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; +import java.time.format.DateTimeFormatter; +import java.util.List; + +/** + * The current status of an async operation. + */ +@Fluent +public final class OperationStatusResultInner implements JsonSerializable { + /* + * Fully qualified ID for the async operation. + */ + private String id; + + /* + * Fully qualified ID of the resource against which the original async operation was started. + */ + private String resourceId; + + /* + * Name of the async operation. + */ + private String name; + + /* + * Operation status. + */ + private String status; + + /* + * Percent of the operation that is complete. + */ + private Float percentComplete; + + /* + * The start time of the operation. + */ + private OffsetDateTime startTime; + + /* + * The end time of the operation. + */ + private OffsetDateTime endTime; + + /* + * The operations list. + */ + private List operations; + + /* + * If present, details of the operation error. + */ + private ManagementError error; + + /** + * Creates an instance of OperationStatusResultInner class. + */ + public OperationStatusResultInner() { + } + + /** + * Get the id property: Fully qualified ID for the async operation. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Fully qualified ID for the async operation. + * + * @param id the id value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withId(String id) { + this.id = id; + return this; + } + + /** + * Get the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + public String resourceId() { + return this.resourceId; + } + + /** + * Get the name property: Name of the async operation. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Set the name property: Name of the async operation. + * + * @param name the name value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withName(String name) { + this.name = name; + return this; + } + + /** + * Get the status property: Operation status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Set the status property: Operation status. + * + * @param status the status value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStatus(String status) { + this.status = status; + return this; + } + + /** + * Get the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + public Float percentComplete() { + return this.percentComplete; + } + + /** + * Set the percentComplete property: Percent of the operation that is complete. + * + * @param percentComplete the percentComplete value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withPercentComplete(Float percentComplete) { + this.percentComplete = percentComplete; + return this; + } + + /** + * Get the startTime property: The start time of the operation. + * + * @return the startTime value. + */ + public OffsetDateTime startTime() { + return this.startTime; + } + + /** + * Set the startTime property: The start time of the operation. + * + * @param startTime the startTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withStartTime(OffsetDateTime startTime) { + this.startTime = startTime; + return this; + } + + /** + * Get the endTime property: The end time of the operation. + * + * @return the endTime value. + */ + public OffsetDateTime endTime() { + return this.endTime; + } + + /** + * Set the endTime property: The end time of the operation. + * + * @param endTime the endTime value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withEndTime(OffsetDateTime endTime) { + this.endTime = endTime; + return this; + } + + /** + * Get the operations property: The operations list. + * + * @return the operations value. + */ + public List operations() { + return this.operations; + } + + /** + * Set the operations property: The operations list. + * + * @param operations the operations value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withOperations(List operations) { + this.operations = operations; + return this; + } + + /** + * Get the error property: If present, details of the operation error. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Set the error property: If present, details of the operation error. + * + * @param error the error value to set. + * @return the OperationStatusResultInner object itself. + */ + public OperationStatusResultInner withError(ManagementError error) { + this.error = error; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (status() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property status in model OperationStatusResultInner")); + } + if (operations() != null) { + operations().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(OperationStatusResultInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("status", this.status); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("percentComplete", this.percentComplete); + jsonWriter.writeStringField("startTime", + this.startTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.startTime)); + jsonWriter.writeStringField("endTime", + this.endTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.endTime)); + jsonWriter.writeArrayField("operations", this.operations, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("error", this.error); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of OperationStatusResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of OperationStatusResultInner 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 OperationStatusResultInner. + */ + public static OperationStatusResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + OperationStatusResultInner deserializedOperationStatusResultInner = new OperationStatusResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("status".equals(fieldName)) { + deserializedOperationStatusResultInner.status = reader.getString(); + } else if ("id".equals(fieldName)) { + deserializedOperationStatusResultInner.id = reader.getString(); + } else if ("resourceId".equals(fieldName)) { + deserializedOperationStatusResultInner.resourceId = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedOperationStatusResultInner.name = reader.getString(); + } else if ("percentComplete".equals(fieldName)) { + deserializedOperationStatusResultInner.percentComplete = reader.getNullable(JsonReader::getFloat); + } else if ("startTime".equals(fieldName)) { + deserializedOperationStatusResultInner.startTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("endTime".equals(fieldName)) { + deserializedOperationStatusResultInner.endTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("operations".equals(fieldName)) { + List operations + = reader.readArray(reader1 -> OperationStatusResultInner.fromJson(reader1)); + deserializedOperationStatusResultInner.operations = operations; + } else if ("error".equals(fieldName)) { + deserializedOperationStatusResultInner.error = ManagementError.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedOperationStatusResultInner; + }); + } +} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java index 9c7156ae10fc..5ec238584ae2 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java @@ -7,7 +7,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -20,19 +19,19 @@ @Fluent public final class TargetInner extends ProxyResource { /* - * The system metadata of the target resource. + * The properties of the target resource. */ - private SystemData systemData; + private Map properties; /* - * Location of the target resource. + * Azure resource location. */ private String location; /* - * The properties of the target resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private Map properties; + private SystemData systemData; /* * The type of the resource. @@ -56,16 +55,27 @@ public TargetInner() { } /** - * Get the systemData property: The system metadata of the target resource. + * Get the properties property: The properties of the target resource. * - * @return the systemData value. + * @return the properties value. */ - public SystemData systemData() { - return this.systemData; + public Map properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of the target resource. + * + * @param properties the properties value to set. + * @return the TargetInner object itself. + */ + public TargetInner withProperties(Map properties) { + this.properties = properties; + return this; } /** - * Get the location property: Location of the target resource. + * Get the location property: Azure resource location. * * @return the location value. */ @@ -74,7 +84,7 @@ public String location() { } /** - * Set the location property: Location of the target resource. + * Set the location property: Azure resource location. * * @param location the location value to set. * @return the TargetInner object itself. @@ -85,23 +95,12 @@ public TargetInner withLocation(String location) { } /** - * Get the properties property: The properties of the target resource. - * - * @return the properties value. - */ - public Map properties() { - return this.properties; - } - - /** - * Set the properties property: The properties of the target resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param properties the properties value to set. - * @return the TargetInner object itself. + * @return the systemData value. */ - public TargetInner withProperties(Map properties) { - this.properties = properties; - return this; + public SystemData systemData() { + return this.systemData; } /** @@ -140,14 +139,8 @@ public String id() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (properties() == null) { - throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property properties in model TargetInner")); - } } - private static final ClientLogger LOGGER = new ClientLogger(TargetInner.class); - /** * {@inheritDoc} */ @@ -184,10 +177,10 @@ public static TargetInner fromJson(JsonReader jsonReader) throws IOException { } else if ("properties".equals(fieldName)) { Map properties = reader.readMap(reader1 -> reader1.readUntyped()); deserializedTargetInner.properties = properties; - } else if ("systemData".equals(fieldName)) { - deserializedTargetInner.systemData = SystemData.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedTargetInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedTargetInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java index 0f944a6e9ac3..a00babf2945a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java @@ -4,7 +4,7 @@ package com.azure.resourcemanager.chaos.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.core.util.logging.ClientLogger; @@ -17,22 +17,17 @@ /** * Model that represents a Target Type resource. */ -@Fluent +@Immutable public final class TargetTypeInner extends ProxyResource { /* - * The system metadata properties of the target type resource. - */ - private SystemData systemData; - - /* - * Location of the Target Type resource. + * The properties of the target type resource. */ - private String location; + private TargetTypeProperties innerProperties = new TargetTypeProperties(); /* - * The properties of the target type resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private TargetTypeProperties innerProperties = new TargetTypeProperties(); + private SystemData systemData; /* * The type of the resource. @@ -56,41 +51,21 @@ public TargetTypeInner() { } /** - * Get the systemData property: The system metadata properties of the target type resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the location property: Location of the Target Type resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the Target Type resource. + * Get the innerProperties property: The properties of the target type resource. * - * @param location the location value to set. - * @return the TargetTypeInner object itself. + * @return the innerProperties value. */ - public TargetTypeInner withLocation(String location) { - this.location = location; - return this; + private TargetTypeProperties innerProperties() { + return this.innerProperties; } /** - * Get the innerProperties property: The properties of the target type resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the innerProperties value. + * @return the systemData value. */ - private TargetTypeProperties innerProperties() { - return this.innerProperties; + public SystemData systemData() { + return this.systemData; } /** @@ -183,7 +158,6 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeJsonField("properties", this.innerProperties); - jsonWriter.writeStringField("location", this.location); return jsonWriter.writeEndObject(); } @@ -213,8 +187,6 @@ public static TargetTypeInner fromJson(JsonReader jsonReader) throws IOException deserializedTargetTypeInner.innerProperties = TargetTypeProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedTargetTypeInner.systemData = SystemData.fromJson(reader); - } else if ("location".equals(fieldName)) { - deserializedTargetTypeInner.location = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java index 4a986b0ee909..ee2cee6fe7a7 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java @@ -74,9 +74,9 @@ Mono> list(@HostParam("$host") String endpoint, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("parentProviderNamespace") String parentProviderNamespace, @PathParam("parentResourceType") String parentResourceType, - @PathParam("parentResourceName") String parentResourceName, @PathParam("targetName") String targetName, - @QueryParam("continuationToken") String continuationToken, @HeaderParam("Accept") String accept, - Context context); + @PathParam("parentResourceName") String parentResourceName, + @QueryParam("continuationToken") String continuationToken, @PathParam("targetName") String targetName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") @@ -91,30 +91,29 @@ Mono> get(@HostParam("$host") String endpoint, @PathParam("capabilityName") String capabilityName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("parentProviderNamespace") String parentProviderNamespace, @PathParam("parentResourceType") String parentResourceType, @PathParam("parentResourceName") String parentResourceName, @PathParam("targetName") String targetName, - @PathParam("capabilityName") String capabilityName, @HeaderParam("Accept") String accept, Context context); + @PathParam("capabilityName") String capabilityName, @BodyParam("application/json") CapabilityInner resource, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("parentProviderNamespace") String parentProviderNamespace, @PathParam("parentResourceType") String parentResourceType, @PathParam("parentResourceName") String parentResourceName, @PathParam("targetName") String targetName, - @PathParam("capabilityName") String capabilityName, - @BodyParam("application/json") CapabilityInner capability, @HeaderParam("Accept") String accept, - Context context); + @PathParam("capabilityName") String capabilityName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -125,18 +124,18 @@ Mono> listNext(@PathParam(value = "nextLink", enc } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 Capability resources that extend a Target resource. along with {@link PagedResponse} on + * @return a list of Capability resources that extend a Target resource along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -174,26 +173,26 @@ private Mono> listSinglePageAsync(String resource return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, continuationToken, accept, context)) + parentResourceName, continuationToken, targetName, 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 a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 Capability resources that extend a Target resource. along with {@link PagedResponse} on + * @return a list of Capability resources that extend a Target resource along with {@link PagedResponse} on * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) @@ -231,25 +230,25 @@ private Mono> listSinglePageAsync(String resource context = this.client.mergeContext(context); return service .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, - continuationToken, accept, context) + resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken, + targetName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -260,17 +259,17 @@ private PagedFlux listAsync(String resourceGroupName, String pa } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @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 Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -282,19 +281,19 @@ private PagedFlux listAsync(String resourceGroupName, String pa } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -308,17 +307,17 @@ private PagedFlux listAsync(String resourceGroupName, String pa } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @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 Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -330,19 +329,19 @@ public PagedIterable list(String resourceGroupName, String pare } /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) @@ -356,10 +355,10 @@ public PagedIterable list(String resourceGroupName, String pare /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -413,10 +412,10 @@ private Mono> getWithResponseAsync(String resourceGrou /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @param context The context to associate with this operation. @@ -470,10 +469,10 @@ private Mono> getWithResponseAsync(String resourceGrou /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -491,10 +490,10 @@ private Mono getAsync(String resourceGroupName, String parentPr /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @param context The context to associate with this operation. @@ -514,10 +513,10 @@ public Response getWithResponse(String resourceGroupName, Strin /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -533,22 +532,25 @@ public CapabilityInner get(String resourceGroupName, String parentProviderNamesp } /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, + String capabilityName, CapabilityInner resource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -579,33 +581,40 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (capabilityName == null) { return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, accept, context)) + parentResourceName, targetName, capabilityName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName, - Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, + String capabilityName, CapabilityInner resource, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -636,97 +645,105 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (capabilityName == null) { return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, - capabilityName, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName, resource, accept, context); } /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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. + * @return model that represents a Capability resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName) { - return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName).flatMap(ignored -> Mono.empty()); + private Mono createOrUpdateAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName, + CapabilityInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName, resource).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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}. + * @return model that represents a Capability resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName, - Context context) { - return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, + String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, + String capabilityName, CapabilityInner resource, Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName, resource, context).block(); } /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 model that represents a Capability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName) { - deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, capabilityName, Context.NONE); + public CapabilityInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName, + CapabilityInner resource) { + return createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName, resource, Context.NONE).getValue(); } /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, - String capabilityName, CapabilityInner capability) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -757,40 +774,33 @@ private Mono> createOrUpdateWithResponseAsync(String r if (capabilityName == null) { return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); } - if (capability == null) { - return Mono.error(new IllegalArgumentException("Parameter capability is required and cannot be null.")); - } else { - capability.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability, accept, context)) + parentResourceName, targetName, capabilityName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, - String capabilityName, CapabilityInner capability, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -821,87 +831,75 @@ private Mono> createOrUpdateWithResponseAsync(String r if (capabilityName == null) { return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); } - if (capability == null) { - return Mono.error(new IllegalArgumentException("Parameter capability is required and cannot be null.")); - } else { - capability.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, + capabilityName, accept, context); } /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability) { - return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName) { + return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName).flatMap(ignored -> Mono.empty()); } /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, - String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, - String capabilityName, CapabilityInner capability, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability, context).block(); + public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName, + Context context) { + return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, capabilityName, context).block(); } /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability) { - return createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability, Context.NONE).getValue(); + public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName) { + deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, + targetName, capabilityName, Context.NONE); } /** diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java index b3eff31ef35e..d63976d37605 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java @@ -69,27 +69,12 @@ public Capability get(String resourceGroupName, String parentProviderNamespace, } } - public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, String capabilityName, - Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, capabilityName, context); - } - - public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName) { - this.serviceClient() - .delete(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, - capabilityName); - } - public Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability, Context context) { + CapabilityInner resource, Context context) { Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, capabilityName, capability, context); + parentResourceName, targetName, capabilityName, resource, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CapabilityImpl(inner.getValue(), this.manager())); @@ -100,10 +85,10 @@ public Response createOrUpdateWithResponse(String resourceGroupName, public Capability createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability) { + CapabilityInner resource) { CapabilityInner inner = this.serviceClient() .createOrUpdate(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, capabilityName, capability); + targetName, capabilityName, resource); if (inner != null) { return new CapabilityImpl(inner, this.manager()); } else { @@ -111,6 +96,21 @@ public Capability createOrUpdate(String resourceGroupName, String parentProvider } } + public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, String capabilityName, + Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, + targetName, capabilityName, context); + } + + public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName) { + this.serviceClient() + .delete(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, + capabilityName); + } + private CapabilitiesClient serviceClient() { return this.innerClient; } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java index c6076205a25a..96abb179ab57 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java @@ -37,10 +37,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public String location() { - return this.innerModel().location(); - } - public String publisher() { return this.innerModel().publisher(); } @@ -87,6 +83,15 @@ public List azureRbacDataActions() { } } + public List requiredAzureRoleDefinitionIds() { + List inner = this.innerModel().requiredAzureRoleDefinitionIds(); + if (inner != null) { + return Collections.unmodifiableList(inner); + } else { + return Collections.emptyList(); + } + } + public CapabilityTypePropertiesRuntimeProperties runtimeProperties() { return this.innerModel().runtimeProperties(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java index f9a5e16e973c..4c5c047b972b 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java @@ -63,22 +63,22 @@ public final class CapabilityTypesClientImpl implements CapabilityTypesClient { @ServiceInterface(name = "ChaosManagementClien") public interface CapabilityTypesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @PathParam("targetTypeName") String targetTypeName, + @PathParam("location") String location, @PathParam("targetTypeName") String targetTypeName, @QueryParam("continuationToken") String continuationToken, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}/capabilityTypes/{capabilityTypeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @PathParam("targetTypeName") String targetTypeName, + @PathParam("location") String location, @PathParam("targetTypeName") String targetTypeName, @PathParam("capabilityTypeName") String capabilityTypeName, @HeaderParam("Accept") String accept, Context context); @@ -94,7 +94,7 @@ Mono> listNext( /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -104,7 +104,7 @@ Mono> listNext( * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, String targetTypeName, + private Mono> listSinglePageAsync(String location, String targetTypeName, String continuationToken) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -114,8 +114,8 @@ private Mono> listSinglePageAsync(String loca return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -123,7 +123,7 @@ private Mono> listSinglePageAsync(String loca final String accept = "application/json"; return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, targetTypeName, continuationToken, accept, context)) + this.client.getSubscriptionId(), location, targetTypeName, continuationToken, 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())); @@ -132,7 +132,7 @@ private Mono> listSinglePageAsync(String loca /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. @@ -143,7 +143,7 @@ private Mono> listSinglePageAsync(String loca * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, String targetTypeName, + private Mono> listSinglePageAsync(String location, String targetTypeName, String continuationToken, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -153,8 +153,8 @@ private Mono> listSinglePageAsync(String loca return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -162,7 +162,7 @@ private Mono> listSinglePageAsync(String loca final String accept = "application/json"; context = this.client.mergeContext(context); return service - .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), locationName, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, targetTypeName, continuationToken, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -171,7 +171,7 @@ private Mono> listSinglePageAsync(String loca /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -181,16 +181,15 @@ private Mono> listSinglePageAsync(String loca * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String targetTypeName, - String continuationToken) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, targetTypeName, continuationToken), + private PagedFlux listAsync(String location, String targetTypeName, String continuationToken) { + return new PagedFlux<>(() -> listSinglePageAsync(location, targetTypeName, continuationToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -199,16 +198,16 @@ private PagedFlux listAsync(String locationName, String tar * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String targetTypeName) { + private PagedFlux listAsync(String location, String targetTypeName) { final String continuationToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(locationName, targetTypeName, continuationToken), + return new PagedFlux<>(() -> listSinglePageAsync(location, targetTypeName, continuationToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. @@ -219,16 +218,16 @@ private PagedFlux listAsync(String locationName, String tar * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String targetTypeName, - String continuationToken, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, targetTypeName, continuationToken, context), + private PagedFlux listAsync(String location, String targetTypeName, String continuationToken, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, targetTypeName, continuationToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -237,15 +236,15 @@ private PagedFlux listAsync(String locationName, String tar * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String targetTypeName) { + public PagedIterable list(String location, String targetTypeName) { final String continuationToken = null; - return new PagedIterable<>(listAsync(locationName, targetTypeName, continuationToken)); + return new PagedIterable<>(listAsync(location, targetTypeName, continuationToken)); } /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. @@ -256,15 +255,15 @@ public PagedIterable list(String locationName, String targe * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String targetTypeName, String continuationToken, + public PagedIterable list(String location, String targetTypeName, String continuationToken, Context context) { - return new PagedIterable<>(listAsync(locationName, targetTypeName, continuationToken, context)); + return new PagedIterable<>(listAsync(location, targetTypeName, continuationToken, context)); } /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -274,7 +273,7 @@ public PagedIterable list(String locationName, String targe * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String targetTypeName, + private Mono> getWithResponseAsync(String location, String targetTypeName, String capabilityTypeName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -284,8 +283,8 @@ private Mono> getWithResponseAsync(String location return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -297,14 +296,14 @@ private Mono> getWithResponseAsync(String location final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, targetTypeName, capabilityTypeName, accept, context)) + this.client.getSubscriptionId(), location, targetTypeName, capabilityTypeName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @param context The context to associate with this operation. @@ -315,7 +314,7 @@ private Mono> getWithResponseAsync(String location * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String targetTypeName, + private Mono> getWithResponseAsync(String location, String targetTypeName, String capabilityTypeName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -325,8 +324,8 @@ private Mono> getWithResponseAsync(String location return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -338,13 +337,13 @@ private Mono> getWithResponseAsync(String location final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - locationName, targetTypeName, capabilityTypeName, accept, context); + location, targetTypeName, capabilityTypeName, accept, context); } /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -353,15 +352,15 @@ private Mono> getWithResponseAsync(String location * @return a Capability Type resource for given Target Type and location on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String targetTypeName, String capabilityTypeName) { - return getWithResponseAsync(locationName, targetTypeName, capabilityTypeName) + private Mono getAsync(String location, String targetTypeName, String capabilityTypeName) { + return getWithResponseAsync(location, targetTypeName, capabilityTypeName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @param context The context to associate with this operation. @@ -371,15 +370,15 @@ private Mono getAsync(String locationName, String targetTyp * @return a Capability Type resource for given Target Type and location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String targetTypeName, + public Response getWithResponse(String location, String targetTypeName, String capabilityTypeName, Context context) { - return getWithResponseAsync(locationName, targetTypeName, capabilityTypeName, context).block(); + return getWithResponseAsync(location, targetTypeName, capabilityTypeName, context).block(); } /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -388,8 +387,8 @@ public Response getWithResponse(String locationName, String * @return a Capability Type resource for given Target Type and location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityTypeInner get(String locationName, String targetTypeName, String capabilityTypeName) { - return getWithResponse(locationName, targetTypeName, capabilityTypeName, Context.NONE).getValue(); + public CapabilityTypeInner get(String location, String targetTypeName, String capabilityTypeName) { + return getWithResponse(location, targetTypeName, capabilityTypeName, Context.NONE).getValue(); } /** diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java index 6a206147b558..8d31c9d59a33 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java @@ -27,22 +27,22 @@ public CapabilityTypesImpl(CapabilityTypesClient innerClient, this.serviceManager = serviceManager; } - public PagedIterable list(String locationName, String targetTypeName) { - PagedIterable inner = this.serviceClient().list(locationName, targetTypeName); + public PagedIterable list(String location, String targetTypeName) { + PagedIterable inner = this.serviceClient().list(location, targetTypeName); return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityTypeImpl(inner1, this.manager())); } - public PagedIterable list(String locationName, String targetTypeName, String continuationToken, + public PagedIterable list(String location, String targetTypeName, String continuationToken, Context context) { PagedIterable inner - = this.serviceClient().list(locationName, targetTypeName, continuationToken, context); + = this.serviceClient().list(location, targetTypeName, continuationToken, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new CapabilityTypeImpl(inner1, this.manager())); } - public Response getWithResponse(String locationName, String targetTypeName, - String capabilityTypeName, Context context) { + public Response getWithResponse(String location, String targetTypeName, String capabilityTypeName, + Context context) { Response inner - = this.serviceClient().getWithResponse(locationName, targetTypeName, capabilityTypeName, context); + = this.serviceClient().getWithResponse(location, targetTypeName, capabilityTypeName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new CapabilityTypeImpl(inner.getValue(), this.manager())); @@ -51,8 +51,8 @@ public Response getWithResponse(String locationName, String targ } } - public CapabilityType get(String locationName, String targetTypeName, String capabilityTypeName) { - CapabilityTypeInner inner = this.serviceClient().get(locationName, targetTypeName, capabilityTypeName); + public CapabilityType get(String location, String targetTypeName, String capabilityTypeName) { + CapabilityTypeInner inner = this.serviceClient().get(location, targetTypeName, capabilityTypeName); if (inner != null) { return new CapabilityTypeImpl(inner, this.manager()); } else { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java index c892e3f2aaca..4d3d5ef4d500 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java @@ -20,12 +20,12 @@ @ServiceClientBuilder(serviceClients = { ChaosManagementClientImpl.class }) public final class ChaosManagementClientBuilder { /* - * GUID that represents an Azure subscription ID. + * The ID of the target subscription. The value must be an UUID. */ private String subscriptionId; /** - * Sets GUID that represents an Azure subscription ID. + * Sets The ID of the target subscription. The value must be an UUID. * * @param subscriptionId the subscriptionId value. * @return the ChaosManagementClientBuilder. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java index 27d1a8b81b6f..e2c632df760e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java @@ -46,12 +46,12 @@ @ServiceClient(builder = ChaosManagementClientBuilder.class) public final class ChaosManagementClientImpl implements ChaosManagementClient { /** - * GUID that represents an Azure subscription ID. + * The ID of the target subscription. The value must be an UUID. */ private final String subscriptionId; /** - * Gets GUID that represents an Azure subscription ID. + * Gets The ID of the target subscription. The value must be an UUID. * * @return the subscriptionId value. */ @@ -130,31 +130,17 @@ public Duration getDefaultPollInterval() { } /** - * The CapabilitiesClient object to access its operations. - */ - private final CapabilitiesClient capabilities; - - /** - * Gets the CapabilitiesClient object to access its operations. - * - * @return the CapabilitiesClient object. - */ - public CapabilitiesClient getCapabilities() { - return this.capabilities; - } - - /** - * The CapabilityTypesClient object to access its operations. + * The OperationsClient object to access its operations. */ - private final CapabilityTypesClient capabilityTypes; + private final OperationsClient operations; /** - * Gets the CapabilityTypesClient object to access its operations. + * Gets the OperationsClient object to access its operations. * - * @return the CapabilityTypesClient object. + * @return the OperationsClient object. */ - public CapabilityTypesClient getCapabilityTypes() { - return this.capabilityTypes; + public OperationsClient getOperations() { + return this.operations; } /** @@ -186,31 +172,31 @@ public OperationStatusesClient getOperationStatuses() { } /** - * The OperationsClient object to access its operations. + * The TargetTypesClient object to access its operations. */ - private final OperationsClient operations; + private final TargetTypesClient targetTypes; /** - * Gets the OperationsClient object to access its operations. + * Gets the TargetTypesClient object to access its operations. * - * @return the OperationsClient object. + * @return the TargetTypesClient object. */ - public OperationsClient getOperations() { - return this.operations; + public TargetTypesClient getTargetTypes() { + return this.targetTypes; } /** - * The TargetTypesClient object to access its operations. + * The CapabilityTypesClient object to access its operations. */ - private final TargetTypesClient targetTypes; + private final CapabilityTypesClient capabilityTypes; /** - * Gets the TargetTypesClient object to access its operations. + * Gets the CapabilityTypesClient object to access its operations. * - * @return the TargetTypesClient object. + * @return the CapabilityTypesClient object. */ - public TargetTypesClient getTargetTypes() { - return this.targetTypes; + public CapabilityTypesClient getCapabilityTypes() { + return this.capabilityTypes; } /** @@ -227,6 +213,20 @@ public TargetsClient getTargets() { return this.targets; } + /** + * The CapabilitiesClient object to access its operations. + */ + private final CapabilitiesClient capabilities; + + /** + * Gets the CapabilitiesClient object to access its operations. + * + * @return the CapabilitiesClient object. + */ + public CapabilitiesClient getCapabilities() { + return this.capabilities; + } + /** * Initializes an instance of ChaosManagementClient client. * @@ -234,7 +234,7 @@ public TargetsClient getTargets() { * @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 subscriptionId GUID that represents an Azure subscription ID. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. * @param endpoint server parameter. */ ChaosManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, @@ -244,14 +244,14 @@ public TargetsClient getTargets() { this.defaultPollInterval = defaultPollInterval; this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2024-01-01"; - this.capabilities = new CapabilitiesClientImpl(this); - this.capabilityTypes = new CapabilityTypesClientImpl(this); + this.apiVersion = "2025-01-01"; + this.operations = new OperationsClientImpl(this); this.experiments = new ExperimentsClientImpl(this); this.operationStatuses = new OperationStatusesClientImpl(this); - this.operations = new OperationsClientImpl(this); this.targetTypes = new TargetTypesClientImpl(this); + this.capabilityTypes = new CapabilityTypesClientImpl(this); this.targets = new TargetsClientImpl(this); + this.capabilities = new CapabilitiesClientImpl(this); } /** diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java index f8574189f064..c45c88d31ae4 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java @@ -6,8 +6,7 @@ import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; -import java.time.OffsetDateTime; +import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsProperties; public final class ExperimentExecutionDetailsImpl implements ExperimentExecutionDetails { private ExperimentExecutionDetailsInner innerObject; @@ -32,28 +31,8 @@ public String name() { return this.innerModel().name(); } - public String failureReason() { - return this.innerModel().failureReason(); - } - - public OffsetDateTime lastActionAt() { - return this.innerModel().lastActionAt(); - } - - public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { - return this.innerModel().runInformation(); - } - - public String status() { - return this.innerModel().status(); - } - - public OffsetDateTime startedAt() { - return this.innerModel().startedAt(); - } - - public OffsetDateTime stoppedAt() { - return this.innerModel().stoppedAt(); + public ExperimentExecutionDetailsProperties properties() { + return this.innerModel().properties(); } public ExperimentExecutionDetailsInner innerModel() { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java index 5e188019d810..11689da61e1e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionImpl.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.chaos.implementation; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner; import com.azure.resourcemanager.chaos.models.ExperimentExecution; import java.time.OffsetDateTime; @@ -19,10 +20,6 @@ public final class ExperimentExecutionImpl implements ExperimentExecution { this.serviceManager = serviceManager; } - public String type() { - return this.innerModel().type(); - } - public String id() { return this.innerModel().id(); } @@ -31,6 +28,14 @@ public String name() { return this.innerModel().name(); } + public String type() { + return this.innerModel().type(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public String status() { return this.innerModel().status(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java index 105b47e7f110..6cfacf131262 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java @@ -12,8 +12,8 @@ import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; import com.azure.resourcemanager.chaos.models.Experiment; import com.azure.resourcemanager.chaos.models.ExperimentUpdate; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; import com.azure.resourcemanager.chaos.models.ProvisioningState; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; import java.util.Collections; import java.util.List; import java.util.Map; @@ -48,12 +48,12 @@ public Map tags() { } } - public SystemData systemData() { - return this.innerModel().systemData(); + public ManagedServiceIdentity identity() { + return this.innerModel().identity(); } - public ResourceIdentity identity() { - return this.innerModel().identity(); + public SystemData systemData() { + return this.innerModel().systemData(); } public ProvisioningState provisioningState() { @@ -102,7 +102,7 @@ private com.azure.resourcemanager.chaos.ChaosManager manager() { private String experimentName; - private ExperimentUpdate updateExperiment; + private ExperimentUpdate updateProperties; public ExperimentImpl withExistingResourceGroup(String resourceGroupName) { this.resourceGroupName = resourceGroupName; @@ -130,21 +130,21 @@ public Experiment create(Context context) { } public ExperimentImpl update() { - this.updateExperiment = new ExperimentUpdate(); + this.updateProperties = new ExperimentUpdate(); return this; } public Experiment apply() { this.innerObject = serviceManager.serviceClient() .getExperiments() - .update(resourceGroupName, experimentName, updateExperiment, Context.NONE); + .update(resourceGroupName, experimentName, updateProperties, Context.NONE); return this; } public Experiment apply(Context context) { this.innerObject = serviceManager.serviceClient() .getExperiments() - .update(resourceGroupName, experimentName, updateExperiment, context); + .update(resourceGroupName, experimentName, updateProperties, context); return this; } @@ -212,17 +212,17 @@ public ExperimentImpl withTags(Map tags) { this.innerModel().withTags(tags); return this; } else { - this.updateExperiment.withTags(tags); + this.updateProperties.withTags(tags); return this; } } - public ExperimentImpl withIdentity(ResourceIdentity identity) { + public ExperimentImpl withIdentity(ManagedServiceIdentity identity) { if (isInCreateMode()) { this.innerModel().withIdentity(identity); return this; } else { - this.updateExperiment.withIdentity(identity); + this.updateProperties.withIdentity(identity); return this; } } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java index b76583e4324e..705706263db4 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java @@ -95,15 +95,6 @@ Mono> listByResourceGroup(@HostParam("$host") Str @QueryParam("continuationToken") String continuationToken, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") - @ExpectedResponses({ 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") @ExpectedResponses({ 200 }) @@ -120,35 +111,34 @@ Mono> getByResourceGroup(@HostParam("$host") String en Mono>> createOrUpdate(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("experimentName") String experimentName, - @BodyParam("application/json") ExperimentInner experiment, @HeaderParam("Accept") String accept, - Context context); + @PathParam("experimentName") String experimentName, @BodyParam("application/json") ExperimentInner resource, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") - @ExpectedResponses({ 202 }) + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono>> update(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("experimentName") String experimentName, - @BodyParam("application/json") ExperimentUpdate experiment, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ExperimentUpdate properties, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel") - @ExpectedResponses({ 202 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> cancel(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, + Mono>> cancel(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context); @@ -182,6 +172,15 @@ Mono> executionDetails(@HostParam("$ho @PathParam("experimentName") String experimentName, @PathParam("executionId") String executionId, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/start") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> start(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("experimentName") String experimentName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @@ -353,7 +352,7 @@ public PagedIterable list(Boolean running, String continuationT /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -390,7 +389,7 @@ private Mono> listByResourceGroupSinglePageAsync( /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -428,7 +427,7 @@ private Mono> listByResourceGroupSinglePageAsync( /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -447,7 +446,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure 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. @@ -464,7 +463,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -485,7 +484,7 @@ private PagedFlux listByResourceGroupAsync(String resourceGroup /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure 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. @@ -501,7 +500,7 @@ public PagedIterable listByResourceGroup(String resourceGroupNa /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -517,210 +516,10 @@ public PagedIterable listByResourceGroup(String resourceGroupNa return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, running, continuationToken, context)); } - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName) { - 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 (experimentName == null) { - return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName, - Context context) { - 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 (experimentName == null) { - return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, experimentName, accept, context); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 experimentName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 experimentName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName) { - return this.beginDeleteAsync(resourceGroupName, experimentName).getSyncPoller(); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, experimentName, context).getSyncPoller(); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 experimentName) { - return beginDeleteAsync(resourceGroupName, experimentName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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 experimentName, Context context) { - return beginDeleteAsync(resourceGroupName, experimentName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String experimentName) { - deleteAsync(resourceGroupName, experimentName).block(); - } - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String experimentName, Context context) { - deleteAsync(resourceGroupName, experimentName, context).block(); - } - /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -755,7 +554,7 @@ private Mono> getByResourceGroupWithResponseAsync(Stri /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -790,7 +589,7 @@ private Mono> getByResourceGroupWithResponseAsync(Stri /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -806,7 +605,7 @@ private Mono getByResourceGroupAsync(String resourceGroupName, /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -823,7 +622,7 @@ public Response getByResourceGroupWithResponse(String resourceG /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -838,9 +637,9 @@ public ExperimentInner getByResourceGroup(String resourceGroupName, String exper /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -849,7 +648,7 @@ public ExperimentInner getByResourceGroup(String resourceGroupName, String exper */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String experimentName, ExperimentInner experiment) { + String experimentName, ExperimentInner resource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -865,24 +664,24 @@ private Mono>> createOrUpdateWithResponseAsync(String if (experimentName == null) { return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { - experiment.validate(); + resource.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, experimentName, experiment, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, experimentName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -892,7 +691,7 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String experimentName, ExperimentInner experiment, Context context) { + String experimentName, ExperimentInner resource, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -908,23 +707,23 @@ private Mono>> createOrUpdateWithResponseAsync(String if (experimentName == null) { return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); } else { - experiment.validate(); + resource.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, experimentName, experiment, accept, context); + this.client.getSubscriptionId(), resourceGroupName, experimentName, resource, accept, context); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -932,9 +731,9 @@ private Mono>> createOrUpdateWithResponseAsync(String */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(String resourceGroupName, - String experimentName, ExperimentInner experiment) { + String experimentName, ExperimentInner resource) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment); + = createOrUpdateWithResponseAsync(resourceGroupName, experimentName, resource); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, this.client.getContext()); } @@ -942,9 +741,9 @@ private PollerFlux, ExperimentInner> beginCreateOrUp /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -953,10 +752,10 @@ private PollerFlux, ExperimentInner> beginCreateOrUp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExperimentInner> beginCreateOrUpdateAsync(String resourceGroupName, - String experimentName, ExperimentInner experiment, Context context) { + String experimentName, ExperimentInner resource, Context context) { context = this.client.mergeContext(context); Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context); + = createOrUpdateWithResponseAsync(resourceGroupName, experimentName, resource, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context); } @@ -964,9 +763,9 @@ private PollerFlux, ExperimentInner> beginCreateOrUp /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -974,16 +773,16 @@ private PollerFlux, ExperimentInner> beginCreateOrUp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName, - String experimentName, ExperimentInner experiment) { - return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller(); + String experimentName, ExperimentInner resource) { + return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, resource).getSyncPoller(); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -992,16 +791,16 @@ public SyncPoller, ExperimentInner> beginCreateOrUpd */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExperimentInner> beginCreateOrUpdate(String resourceGroupName, - String experimentName, ExperimentInner experiment, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller(); + String experimentName, ExperimentInner resource, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, experimentName, resource, context).getSyncPoller(); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -1009,17 +808,17 @@ public SyncPoller, ExperimentInner> beginCreateOrUpd */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String experimentName, - ExperimentInner experiment) { - return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment).last() + ExperimentInner resource) { + return beginCreateOrUpdateAsync(resourceGroupName, experimentName, resource).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -1028,33 +827,33 @@ private Mono createOrUpdateAsync(String resourceGroupName, Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono createOrUpdateAsync(String resourceGroupName, String experimentName, - ExperimentInner experiment, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, experimentName, experiment, context).last() + ExperimentInner resource, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, experimentName, resource, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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 model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment) { - return createOrUpdateAsync(resourceGroupName, experimentName, experiment).block(); + public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner resource) { + return createOrUpdateAsync(resourceGroupName, experimentName, resource).block(); } /** * Create or update a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Experiment resource to be created or updated. + * @param resource Experiment resource to be created or updated. * @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. @@ -1062,17 +861,17 @@ public ExperimentInner createOrUpdate(String resourceGroupName, String experimen * @return model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner experiment, + public ExperimentInner createOrUpdate(String resourceGroupName, String experimentName, ExperimentInner resource, Context context) { - return createOrUpdateAsync(resourceGroupName, experimentName, experiment, context).block(); + return createOrUpdateAsync(resourceGroupName, experimentName, resource, context).block(); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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. @@ -1081,7 +880,7 @@ public ExperimentInner createOrUpdate(String resourceGroupName, String experimen */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String experimentName, - ExperimentUpdate experiment) { + ExperimentUpdate properties) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1097,24 +896,24 @@ private Mono>> updateWithResponseAsync(String resource if (experimentName == null) { return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - experiment.validate(); + properties.validate(); } final String accept = "application/json"; return FluxUtil .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, experimentName, experiment, accept, context)) + this.client.getSubscriptionId(), resourceGroupName, experimentName, properties, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -1124,7 +923,7 @@ private Mono>> updateWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> updateWithResponseAsync(String resourceGroupName, String experimentName, - ExperimentUpdate experiment, Context context) { + ExperimentUpdate properties, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1140,23 +939,23 @@ private Mono>> updateWithResponseAsync(String resource if (experimentName == null) { return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); + if (properties == null) { + return Mono.error(new IllegalArgumentException("Parameter properties is required and cannot be null.")); } else { - experiment.validate(); + properties.validate(); } final String accept = "application/json"; context = this.client.mergeContext(context); return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, experimentName, experiment, accept, context); + resourceGroupName, experimentName, properties, accept, context); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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. @@ -1164,8 +963,8 @@ private Mono>> updateWithResponseAsync(String resource */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExperimentInner> beginUpdateAsync(String resourceGroupName, - String experimentName, ExperimentUpdate experiment) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, experimentName, experiment); + String experimentName, ExperimentUpdate properties) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, experimentName, properties); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, this.client.getContext()); } @@ -1173,9 +972,9 @@ private PollerFlux, ExperimentInner> beginUpdateAsyn /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -1184,10 +983,10 @@ private PollerFlux, ExperimentInner> beginUpdateAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ExperimentInner> beginUpdateAsync(String resourceGroupName, - String experimentName, ExperimentUpdate experiment, Context context) { + String experimentName, ExperimentUpdate properties, Context context) { context = this.client.mergeContext(context); Mono>> mono - = updateWithResponseAsync(resourceGroupName, experimentName, experiment, context); + = updateWithResponseAsync(resourceGroupName, experimentName, properties, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ExperimentInner.class, ExperimentInner.class, context); } @@ -1195,9 +994,9 @@ private PollerFlux, ExperimentInner> beginUpdateAsyn /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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. @@ -1205,16 +1004,16 @@ private PollerFlux, ExperimentInner> beginUpdateAsyn */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName, - String experimentName, ExperimentUpdate experiment) { - return this.beginUpdateAsync(resourceGroupName, experimentName, experiment).getSyncPoller(); + String experimentName, ExperimentUpdate properties) { + return this.beginUpdateAsync(resourceGroupName, experimentName, properties).getSyncPoller(); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -1223,16 +1022,16 @@ public SyncPoller, ExperimentInner> beginUpdate(Stri */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ExperimentInner> beginUpdate(String resourceGroupName, - String experimentName, ExperimentUpdate experiment, Context context) { - return this.beginUpdateAsync(resourceGroupName, experimentName, experiment, context).getSyncPoller(); + String experimentName, ExperimentUpdate properties, Context context) { + return this.beginUpdateAsync(resourceGroupName, experimentName, properties, context).getSyncPoller(); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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. @@ -1240,17 +1039,17 @@ public SyncPoller, ExperimentInner> beginUpdate(Stri */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String experimentName, - ExperimentUpdate experiment) { - return beginUpdateAsync(resourceGroupName, experimentName, experiment).last() + ExperimentUpdate properties) { + return beginUpdateAsync(resourceGroupName, experimentName, properties).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -1259,33 +1058,33 @@ private Mono updateAsync(String resourceGroupName, String exper */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono updateAsync(String resourceGroupName, String experimentName, - ExperimentUpdate experiment, Context context) { - return beginUpdateAsync(resourceGroupName, experimentName, experiment, context).last() + ExperimentUpdate properties, Context context) { + return beginUpdateAsync(resourceGroupName, experimentName, properties, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment 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 model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment) { - return updateAsync(resourceGroupName, experimentName, experiment).block(); + public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate properties) { + return updateAsync(resourceGroupName, experimentName, properties).block(); } /** * The operation to update an experiment. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. - * @param experiment Parameters supplied to the Update experiment operation. + * @param properties Parameters supplied to the Update experiment operation. * @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. @@ -1293,15 +1092,15 @@ public ExperimentInner update(String resourceGroupName, String experimentName, E * @return model that represents a Experiment resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate experiment, + public ExperimentInner update(String resourceGroupName, String experimentName, ExperimentUpdate properties, Context context) { - return updateAsync(resourceGroupName, experimentName, experiment, context).block(); + return updateAsync(resourceGroupName, experimentName, properties, context).block(); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1309,7 +1108,7 @@ public ExperimentInner update(String resourceGroupName, String experimentName, E * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1327,15 +1126,15 @@ private Mono>> cancelWithResponseAsync(String resource } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1344,7 +1143,7 @@ private Mono>> cancelWithResponseAsync(String resource * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName, + private Mono>> deleteWithResponseAsync(String resourceGroupName, String experimentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1363,14 +1162,14 @@ private Mono>> cancelWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1378,16 +1177,16 @@ private Mono>> cancelWithResponseAsync(String resource * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName) { - Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName); + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String experimentName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1396,18 +1195,18 @@ private PollerFlux, Void> beginCancelAsync(String resourceGroup * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName, + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String experimentName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName, context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, experimentName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1415,14 +1214,14 @@ private PollerFlux, Void> beginCancelAsync(String resourceGroup * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName) { - return this.beginCancelAsync(resourceGroupName, experimentName).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName) { + return this.beginDeleteAsync(resourceGroupName, experimentName).getSyncPoller(); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1431,15 +1230,15 @@ public SyncPoller, Void> beginCancel(String resourceGroupName, * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName, + public SyncPoller, Void> beginDelete(String resourceGroupName, String experimentName, Context context) { - return this.beginCancelAsync(resourceGroupName, experimentName, context).getSyncPoller(); + return this.beginDeleteAsync(resourceGroupName, experimentName, context).getSyncPoller(); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1447,15 +1246,15 @@ public SyncPoller, Void> beginCancel(String resourceGroupName, * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String resourceGroupName, String experimentName) { - return beginCancelAsync(resourceGroupName, experimentName).last() + private Mono deleteAsync(String resourceGroupName, String experimentName) { + return beginDeleteAsync(resourceGroupName, experimentName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1464,29 +1263,29 @@ private Mono cancelAsync(String resourceGroupName, String experimentName) * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String resourceGroupName, String experimentName, Context context) { - return beginCancelAsync(resourceGroupName, experimentName, context).last() + private Mono deleteAsync(String resourceGroupName, String experimentName, Context context) { + return beginDeleteAsync(resourceGroupName, experimentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String experimentName) { - cancelAsync(resourceGroupName, experimentName).block(); + public void delete(String resourceGroupName, String experimentName) { + deleteAsync(resourceGroupName, experimentName).block(); } /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1494,14 +1293,14 @@ public void cancel(String resourceGroupName, String experimentName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void cancel(String resourceGroupName, String experimentName, Context context) { - cancelAsync(resourceGroupName, experimentName, context).block(); + public void delete(String resourceGroupName, String experimentName, Context context) { + deleteAsync(resourceGroupName, experimentName, context).block(); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1509,7 +1308,7 @@ public void cancel(String resourceGroupName, String experimentName, Context cont * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName) { + private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1527,15 +1326,15 @@ private Mono>> startWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1544,7 +1343,7 @@ private Mono>> startWithResponseAsync(String resourceG * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName, + private Mono>> cancelWithResponseAsync(String resourceGroupName, String experimentName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1563,14 +1362,14 @@ private Mono>> startWithResponseAsync(String resourceG } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1578,16 +1377,16 @@ private Mono>> startWithResponseAsync(String resourceG * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String experimentName) { - Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName); + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName) { + Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1596,18 +1395,18 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginStartAsync(String resourceGroupName, String experimentName, + private PollerFlux, Void> beginCancelAsync(String resourceGroupName, String experimentName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName, context); + Mono>> mono = cancelWithResponseAsync(resourceGroupName, experimentName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1615,14 +1414,14 @@ private PollerFlux, Void> beginStartAsync(String resourceGroupN * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName) { - return this.beginStartAsync(resourceGroupName, experimentName).getSyncPoller(); + public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName) { + return this.beginCancelAsync(resourceGroupName, experimentName).getSyncPoller(); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1631,15 +1430,15 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName, + public SyncPoller, Void> beginCancel(String resourceGroupName, String experimentName, Context context) { - return this.beginStartAsync(resourceGroupName, experimentName, context).getSyncPoller(); + return this.beginCancelAsync(resourceGroupName, experimentName, context).getSyncPoller(); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1647,14 +1446,15 @@ public SyncPoller, Void> beginStart(String resourceGroupName, S * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String experimentName) { - return beginStartAsync(resourceGroupName, experimentName).last().flatMap(this.client::getLroFinalResultOrError); + private Mono cancelAsync(String resourceGroupName, String experimentName) { + return beginCancelAsync(resourceGroupName, experimentName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1663,29 +1463,29 @@ private Mono startAsync(String resourceGroupName, String experimentName) { * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String experimentName, Context context) { - return beginStartAsync(resourceGroupName, experimentName, context).last() + private Mono cancelAsync(String resourceGroupName, String experimentName, Context context) { + return beginCancelAsync(resourceGroupName, experimentName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String experimentName) { - startAsync(resourceGroupName, experimentName).block(); + public void cancel(String resourceGroupName, String experimentName) { + cancelAsync(resourceGroupName, experimentName).block(); } /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1693,14 +1493,14 @@ public void start(String resourceGroupName, String experimentName) { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void start(String resourceGroupName, String experimentName, Context context) { - startAsync(resourceGroupName, experimentName, context).block(); + public void cancel(String resourceGroupName, String experimentName, Context context) { + cancelAsync(resourceGroupName, experimentName, context).block(); } /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1738,7 +1538,7 @@ private Mono> listAllExecutionsSinglePag /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1777,7 +1577,7 @@ private Mono> listAllExecutionsSinglePag /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1794,7 +1594,7 @@ private PagedFlux listAllExecutionsAsync(String resour /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1812,7 +1612,7 @@ private PagedFlux listAllExecutionsAsync(String resour /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -1827,7 +1627,7 @@ public PagedIterable listAllExecutions(String resource /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1844,7 +1644,7 @@ public PagedIterable listAllExecutions(String resource /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1884,7 +1684,7 @@ private Mono> getExecutionWithResponseAsync(S /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -1924,7 +1724,7 @@ private Mono> getExecutionWithResponseAsync(S /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1942,7 +1742,7 @@ private Mono getExecutionAsync(String resourceGroupNam /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -1960,7 +1760,7 @@ public Response getExecutionWithResponse(String resour /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1976,7 +1776,7 @@ public ExperimentExecutionInner getExecution(String resourceGroupName, String ex /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2016,7 +1816,7 @@ private Mono> executionDetailsWithResp /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -2056,7 +1856,7 @@ private Mono> executionDetailsWithResp /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2074,7 +1874,7 @@ private Mono executionDetailsAsync(String resou /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -2092,7 +1892,7 @@ public Response executionDetailsWithResponse(St /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -2106,6 +1906,205 @@ public ExperimentExecutionDetailsInner executionDetails(String resourceGroupName return executionDetailsWithResponse(resourceGroupName, experimentName, executionId, Context.NONE).getValue(); } + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, experimentName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> startWithResponseAsync(String resourceGroupName, String experimentName, + Context context) { + 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 (experimentName == null) { + return Mono.error(new IllegalArgumentException("Parameter experimentName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, experimentName, accept, context); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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> beginStartAsync(String resourceGroupName, String experimentName) { + Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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> beginStartAsync(String resourceGroupName, String experimentName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = startWithResponseAsync(resourceGroupName, experimentName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName) { + return this.beginStartAsync(resourceGroupName, experimentName).getSyncPoller(); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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 long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginStart(String resourceGroupName, String experimentName, + Context context) { + return this.beginStartAsync(resourceGroupName, experimentName, context).getSyncPoller(); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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 startAsync(String resourceGroupName, String experimentName) { + return beginStartAsync(resourceGroupName, experimentName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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 startAsync(String resourceGroupName, String experimentName, Context context) { + return beginStartAsync(resourceGroupName, experimentName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String experimentName) { + startAsync(resourceGroupName, experimentName).block(); + } + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void start(String resourceGroupName, String experimentName, Context context) { + startAsync(resourceGroupName, experimentName, context).block(); + } + /** * Get the next page of items. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java index 86e0c55e9caf..0f8a706188de 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java @@ -52,14 +52,6 @@ public PagedIterable listByResourceGroup(String resourceGroupName, B return ResourceManagerUtils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); } - public void deleteByResourceGroup(String resourceGroupName, String experimentName) { - this.serviceClient().delete(resourceGroupName, experimentName); - } - - public void delete(String resourceGroupName, String experimentName, Context context) { - this.serviceClient().delete(resourceGroupName, experimentName, context); - } - public Response getByResourceGroupWithResponse(String resourceGroupName, String experimentName, Context context) { Response inner @@ -81,20 +73,20 @@ public Experiment getByResourceGroup(String resourceGroupName, String experiment } } - public void cancel(String resourceGroupName, String experimentName) { - this.serviceClient().cancel(resourceGroupName, experimentName); + public void deleteByResourceGroup(String resourceGroupName, String experimentName) { + this.serviceClient().delete(resourceGroupName, experimentName); } - public void cancel(String resourceGroupName, String experimentName, Context context) { - this.serviceClient().cancel(resourceGroupName, experimentName, context); + public void delete(String resourceGroupName, String experimentName, Context context) { + this.serviceClient().delete(resourceGroupName, experimentName, context); } - public void start(String resourceGroupName, String experimentName) { - this.serviceClient().start(resourceGroupName, experimentName); + public void cancel(String resourceGroupName, String experimentName) { + this.serviceClient().cancel(resourceGroupName, experimentName); } - public void start(String resourceGroupName, String experimentName, Context context) { - this.serviceClient().start(resourceGroupName, experimentName, context); + public void cancel(String resourceGroupName, String experimentName, Context context) { + this.serviceClient().cancel(resourceGroupName, experimentName, context); } public PagedIterable listAllExecutions(String resourceGroupName, String experimentName) { @@ -155,6 +147,14 @@ public ExperimentExecutionDetails executionDetails(String resourceGroupName, Str } } + public void start(String resourceGroupName, String experimentName) { + this.serviceClient().start(resourceGroupName, experimentName); + } + + public void start(String resourceGroupName, String experimentName, Context context) { + this.serviceClient().start(resourceGroupName, experimentName, context); + } + public Experiment getById(String id) { String resourceGroupName = ResourceManagerUtils.getValueFromIdByName(id, "resourceGroups"); if (resourceGroupName == null) { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusResultImpl.java similarity index 51% rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusResultImpl.java index fee127f5b564..68b0f117dda6 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusResultImpl.java @@ -5,16 +5,20 @@ package com.azure.resourcemanager.chaos.implementation; import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.chaos.models.OperationStatus; +import com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.chaos.models.OperationStatusResult; import java.time.OffsetDateTime; +import java.util.Collections; +import java.util.List; +import java.util.stream.Collectors; -public final class OperationStatusImpl implements OperationStatus { - private OperationStatusInner innerObject; +public final class OperationStatusResultImpl implements OperationStatusResult { + private OperationStatusResultInner innerObject; private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - OperationStatusImpl(OperationStatusInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { + OperationStatusResultImpl(OperationStatusResultInner innerObject, + com.azure.resourcemanager.chaos.ChaosManager serviceManager) { this.innerObject = innerObject; this.serviceManager = serviceManager; } @@ -23,10 +27,22 @@ public String id() { return this.innerModel().id(); } + public String resourceId() { + return this.innerModel().resourceId(); + } + public String name() { return this.innerModel().name(); } + public String status() { + return this.innerModel().status(); + } + + public Float percentComplete() { + return this.innerModel().percentComplete(); + } + public OffsetDateTime startTime() { return this.innerModel().startTime(); } @@ -35,15 +51,22 @@ public OffsetDateTime endTime() { return this.innerModel().endTime(); } - public String status() { - return this.innerModel().status(); + public List operations() { + List inner = this.innerModel().operations(); + if (inner != null) { + return Collections.unmodifiableList(inner.stream() + .map(inner1 -> new OperationStatusResultImpl(inner1, this.manager())) + .collect(Collectors.toList())); + } else { + return Collections.emptyList(); + } } public ManagementError error() { return this.innerModel().error(); } - public OperationStatusInner innerModel() { + public OperationStatusResultInner innerModel() { return this.innerObject; } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java index a163e34ece0f..ed5eacdee50b 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesClientImpl.java @@ -22,7 +22,7 @@ import com.azure.core.util.Context; import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient; -import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner; import reactor.core.publisher.Mono; /** @@ -58,129 +58,127 @@ public final class OperationStatusesClientImpl implements OperationStatusesClien @ServiceInterface(name = "ChaosManagementClien") public interface OperationStatusesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationStatuses/{asyncOperationId}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/operationStatuses/{operationId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("location") String location, @PathParam("asyncOperationId") String asyncOperationId, + Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("operationId") String operationId, @HeaderParam("Accept") String accept, Context context); } /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async 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 status of a long running azure asynchronous operation along with {@link Response} on successful - * completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String asyncOperationId) { + private Mono> getWithResponseAsync(String location, String operationId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), location, asyncOperationId, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, operationId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async operation. * @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 status of a long running azure asynchronous operation along with {@link Response} on successful - * completion of {@link Mono}. + * @return the current status of an async operation along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, String asyncOperationId, + private Mono> getWithResponseAsync(String location, String operationId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (asyncOperationId == null) { - return Mono - .error(new IllegalArgumentException("Parameter asyncOperationId 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 (operationId == null) { + return Mono.error(new IllegalArgumentException("Parameter operationId is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), location, asyncOperationId, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, operationId, accept, context); } /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async 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 status of a long running azure asynchronous operation on successful completion of {@link Mono}. + * @return the current status of an async operation on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String location, String asyncOperationId) { - return getWithResponseAsync(location, asyncOperationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String location, String operationId) { + return getWithResponseAsync(location, operationId).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async operation. * @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 status of a long running azure asynchronous operation along with {@link Response}. + * @return the current status of an async operation along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, String asyncOperationId, Context context) { - return getWithResponseAsync(location, asyncOperationId, context).block(); + public Response getWithResponse(String location, String operationId, Context context) { + return getWithResponseAsync(location, operationId, context).block(); } /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async 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 status of a long running azure asynchronous operation. + * @return the current status of an async operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public OperationStatusInner get(String location, String asyncOperationId) { - return getWithResponse(location, asyncOperationId, Context.NONE).getValue(); + public OperationStatusResultInner get(String location, String operationId) { + return getWithResponse(location, operationId, Context.NONE).getValue(); } } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java index af94c1a0556e..8ccb63287be7 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationStatusesImpl.java @@ -9,8 +9,8 @@ import com.azure.core.util.Context; import com.azure.core.util.logging.ClientLogger; import com.azure.resourcemanager.chaos.fluent.OperationStatusesClient; -import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner; -import com.azure.resourcemanager.chaos.models.OperationStatus; +import com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner; +import com.azure.resourcemanager.chaos.models.OperationStatusResult; import com.azure.resourcemanager.chaos.models.OperationStatuses; public final class OperationStatusesImpl implements OperationStatuses { @@ -26,21 +26,21 @@ public OperationStatusesImpl(OperationStatusesClient innerClient, this.serviceManager = serviceManager; } - public Response getWithResponse(String location, String asyncOperationId, Context context) { - Response inner - = this.serviceClient().getWithResponse(location, asyncOperationId, context); + public Response getWithResponse(String location, String operationId, Context context) { + Response inner + = this.serviceClient().getWithResponse(location, operationId, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), - new OperationStatusImpl(inner.getValue(), this.manager())); + new OperationStatusResultImpl(inner.getValue(), this.manager())); } else { return null; } } - public OperationStatus get(String location, String asyncOperationId) { - OperationStatusInner inner = this.serviceClient().get(location, asyncOperationId); + public OperationStatusResult get(String location, String operationId) { + OperationStatusResultInner inner = this.serviceClient().get(location, operationId); if (inner != null) { - return new OperationStatusImpl(inner, this.manager()); + return new OperationStatusResultImpl(inner, this.manager()); } else { return null; } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java index 7c36795820d2..f50c2bd4ee06 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java @@ -78,12 +78,12 @@ Mono> listAllNext(@PathParam(value = "nextLink", e } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations 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} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAllSinglePageAsync() { @@ -101,14 +101,14 @@ private Mono> listAllSinglePageAsync() { } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations 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} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listAllSinglePageAsync(Context context) { @@ -124,11 +124,12 @@ private Mono> listAllSinglePageAsync(Context conte } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAllAsync() { @@ -136,13 +137,14 @@ private PagedFlux listAllAsync() { } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations as paginated response with {@link PagedFlux}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAllAsync(Context context) { @@ -151,11 +153,12 @@ private PagedFlux listAllAsync(Context context) { } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAll() { @@ -163,13 +166,14 @@ public PagedIterable listAll() { } /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedIterable listAll(Context context) { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java index ef8433375132..0dd0f86a71d6 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java @@ -32,14 +32,6 @@ public String type() { return this.innerModel().type(); } - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String location() { - return this.innerModel().location(); - } - public Map properties() { Map inner = this.innerModel().properties(); if (inner != null) { @@ -49,6 +41,14 @@ public Map properties() { } } + public String location() { + return this.innerModel().location(); + } + + public SystemData systemData() { + return this.innerModel().systemData(); + } + public TargetInner innerModel() { return this.innerObject; } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java index 4d823d32c2b8..39ad90d83be4 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java @@ -36,10 +36,6 @@ public SystemData systemData() { return this.innerModel().systemData(); } - public String location() { - return this.innerModel().location(); - } - public String displayName() { return this.innerModel().displayName(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java index 3cf50d14e622..e00a1effa9ad 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java @@ -63,21 +63,21 @@ public final class TargetTypesClientImpl implements TargetTypesClient { @ServiceInterface(name = "ChaosManagementClien") public interface TargetTypesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> list(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @QueryParam("continuationToken") String continuationToken, + @PathParam("location") String location, @QueryParam("continuationToken") String continuationToken, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/targetTypes/{targetTypeName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{location}/targetTypes/{targetTypeName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> get(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("locationName") String locationName, @PathParam("targetTypeName") String targetTypeName, + @PathParam("location") String location, @PathParam("targetTypeName") String targetTypeName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -91,7 +91,7 @@ Mono> listNext(@PathParam(value = "nextLink", enc /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -100,7 +100,7 @@ Mono> listNext(@PathParam(value = "nextLink", enc * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, String continuationToken) { + private Mono> listSinglePageAsync(String location, String continuationToken) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -109,13 +109,13 @@ private Mono> listSinglePageAsync(String location return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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(), locationName, continuationToken, accept, context)) + this.client.getSubscriptionId(), location, continuationToken, 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())); @@ -124,7 +124,7 @@ private Mono> listSinglePageAsync(String location /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -134,7 +134,7 @@ private Mono> listSinglePageAsync(String location * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, String continuationToken, + private Mono> listSinglePageAsync(String location, String continuationToken, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -144,13 +144,13 @@ private Mono> listSinglePageAsync(String location return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location 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(), locationName, + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, continuationToken, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); @@ -159,7 +159,7 @@ private Mono> listSinglePageAsync(String location /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -167,31 +167,31 @@ private Mono> listSinglePageAsync(String location * @return a list of Target Type resources for given location as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String continuationToken) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, continuationToken), + private PagedFlux listAsync(String location, String continuationToken) { + return new PagedFlux<>(() -> listSinglePageAsync(location, continuationToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @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 Target Type resources for given location as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { + private PagedFlux listAsync(String location) { final String continuationToken = null; - return new PagedFlux<>(() -> listSinglePageAsync(locationName, continuationToken), + return new PagedFlux<>(() -> listSinglePageAsync(location, continuationToken), nextLink -> listNextSinglePageAsync(nextLink)); } /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -200,30 +200,30 @@ private PagedFlux listAsync(String locationName) { * @return a list of Target Type resources for given location as paginated response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String continuationToken, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(locationName, continuationToken, context), + private PagedFlux listAsync(String location, String continuationToken, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(location, continuationToken, context), nextLink -> listNextSinglePageAsync(nextLink, context)); } /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @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 Target Type resources for given location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { + public PagedIterable list(String location) { final String continuationToken = null; - return new PagedIterable<>(listAsync(locationName, continuationToken)); + return new PagedIterable<>(listAsync(location, continuationToken)); } /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -232,14 +232,14 @@ public PagedIterable list(String locationName) { * @return a list of Target Type resources for given location as paginated response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String continuationToken, Context context) { - return new PagedIterable<>(listAsync(locationName, continuationToken, context)); + public PagedIterable list(String location, String continuationToken, Context context) { + return new PagedIterable<>(listAsync(location, continuationToken, context)); } /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -248,7 +248,7 @@ public PagedIterable list(String locationName, String continuat * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String targetTypeName) { + private Mono> getWithResponseAsync(String location, String targetTypeName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -257,8 +257,8 @@ private Mono> getWithResponseAsync(String locationName return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -266,14 +266,14 @@ private Mono> getWithResponseAsync(String locationName final String accept = "application/json"; return FluxUtil .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), locationName, targetTypeName, accept, context)) + this.client.getSubscriptionId(), location, targetTypeName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -283,7 +283,7 @@ private Mono> getWithResponseAsync(String locationName * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String targetTypeName, + private Mono> getWithResponseAsync(String location, String targetTypeName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -293,8 +293,8 @@ private Mono> getWithResponseAsync(String locationName return Mono.error(new IllegalArgumentException( "Parameter this.client.getSubscriptionId() is required and cannot be null.")); } - if (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } if (targetTypeName == null) { return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); @@ -302,13 +302,13 @@ private Mono> getWithResponseAsync(String locationName final String accept = "application/json"; context = this.client.mergeContext(context); return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - locationName, targetTypeName, accept, context); + location, targetTypeName, accept, context); } /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -316,14 +316,14 @@ private Mono> getWithResponseAsync(String locationName * @return a Target Type resources for given location on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync(String locationName, String targetTypeName) { - return getWithResponseAsync(locationName, targetTypeName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono getAsync(String location, String targetTypeName) { + return getWithResponseAsync(location, targetTypeName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -332,14 +332,14 @@ private Mono getAsync(String locationName, String targetTypeNam * @return a Target Type resources for given location along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String locationName, String targetTypeName, Context context) { - return getWithResponseAsync(locationName, targetTypeName, context).block(); + public Response getWithResponse(String location, String targetTypeName, Context context) { + return getWithResponseAsync(location, targetTypeName, context).block(); } /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -347,8 +347,8 @@ public Response getWithResponse(String locationName, String tar * @return a Target Type resources for given location. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TargetTypeInner get(String locationName, String targetTypeName) { - return getWithResponse(locationName, targetTypeName, Context.NONE).getValue(); + public TargetTypeInner get(String location, String targetTypeName) { + return getWithResponse(location, targetTypeName, Context.NONE).getValue(); } /** diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java index 81dc5edb1906..bcaa9c037da3 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java @@ -26,18 +26,18 @@ public TargetTypesImpl(TargetTypesClient innerClient, com.azure.resourcemanager. this.serviceManager = serviceManager; } - public PagedIterable list(String locationName) { - PagedIterable inner = this.serviceClient().list(locationName); + public PagedIterable list(String location) { + PagedIterable inner = this.serviceClient().list(location); return ResourceManagerUtils.mapPage(inner, inner1 -> new TargetTypeImpl(inner1, this.manager())); } - public PagedIterable list(String locationName, String continuationToken, Context context) { - PagedIterable inner = this.serviceClient().list(locationName, continuationToken, context); + public PagedIterable list(String location, String continuationToken, Context context) { + PagedIterable inner = this.serviceClient().list(location, continuationToken, context); return ResourceManagerUtils.mapPage(inner, inner1 -> new TargetTypeImpl(inner1, this.manager())); } - public Response getWithResponse(String locationName, String targetTypeName, Context context) { - Response inner = this.serviceClient().getWithResponse(locationName, targetTypeName, context); + public Response getWithResponse(String location, String targetTypeName, Context context) { + Response inner = this.serviceClient().getWithResponse(location, targetTypeName, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new TargetTypeImpl(inner.getValue(), this.manager())); @@ -46,8 +46,8 @@ public Response getWithResponse(String locationName, String targetTy } } - public TargetType get(String locationName, String targetTypeName) { - TargetTypeInner inner = this.serviceClient().get(locationName, targetTypeName); + public TargetType get(String location, String targetTypeName) { + TargetTypeInner inner = this.serviceClient().get(location, targetTypeName); if (inner != null) { return new TargetTypeImpl(inner, this.manager()); } else { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java index 9a34d4473745..376fc244589e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java @@ -90,28 +90,28 @@ Mono> get(@HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}") - @ExpectedResponses({ 200, 204 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}") + @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, + Mono> createOrUpdate(@HostParam("$host") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("parentProviderNamespace") String parentProviderNamespace, @PathParam("parentResourceType") String parentResourceType, @PathParam("parentResourceName") String parentResourceName, @PathParam("targetName") String targetName, - @HeaderParam("Accept") String accept, Context context); + @BodyParam("application/json") TargetInner resource, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}") - @ExpectedResponses({ 200 }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}") + @ExpectedResponses({ 200, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> createOrUpdate(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + Mono> delete(@HostParam("$host") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("parentProviderNamespace") String parentProviderNamespace, @PathParam("parentResourceType") String parentResourceType, @PathParam("parentResourceName") String parentResourceName, @PathParam("targetName") String targetName, - @BodyParam("application/json") TargetInner target, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @@ -124,10 +124,10 @@ Mono> listNext(@PathParam(value = "nextLink", encoded /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -176,10 +176,10 @@ private Mono> listSinglePageAsync(String resourceGrou /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -229,10 +229,10 @@ private Mono> listSinglePageAsync(String resourceGrou /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -250,10 +250,10 @@ private PagedFlux listAsync(String resourceGroupName, String parent /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @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. @@ -271,10 +271,10 @@ private PagedFlux listAsync(String resourceGroupName, String parent /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -295,10 +295,10 @@ private PagedFlux listAsync(String resourceGroupName, String parent /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @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. @@ -316,10 +316,10 @@ public PagedIterable list(String resourceGroupName, String parentPr /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -338,10 +338,10 @@ public PagedIterable list(String resourceGroupName, String parentPr /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -390,10 +390,10 @@ private Mono> getWithResponseAsync(String resourceGroupNam /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -442,10 +442,10 @@ private Mono> getWithResponseAsync(String resourceGroupNam /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -462,10 +462,10 @@ private Mono getAsync(String resourceGroupName, String parentProvid /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -483,10 +483,10 @@ public Response getWithResponse(String resourceGroupName, String pa /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ManagementException thrown if the request is rejected by server. @@ -501,21 +501,24 @@ public TargetInner get(String resourceGroupName, String parentProviderNamespace, } /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, + TargetInner resource) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -543,31 +546,39 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (targetName == null) { return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, accept, context)) + parentResourceName, targetName, resource, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, Context context) { + private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, + String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, + TargetInner resource, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -595,92 +606,99 @@ private Mono> deleteWithResponseAsync(String resourceGroupName, S if (targetName == null) { return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); } + if (resource == null) { + return Mono.error(new IllegalArgumentException("Parameter resource is required and cannot be null.")); + } else { + resource.validate(); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, resource, accept, context); } /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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. + * @return model that represents a Target resource on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName) { - return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName).flatMap(ignored -> Mono.empty()); + private Mono createOrUpdateAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, TargetInner resource) { + return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, resource).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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}. + * @return model that represents a Target resource along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, Context context) { - return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, context).block(); + public Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, TargetInner resource, + Context context) { + return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, resource, context).block(); } /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 model that represents a Target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName) { - deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, Context.NONE); + public TargetInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, TargetInner resource) { + return createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, resource, Context.NONE).getValue(); } /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, - TargetInner target) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -708,39 +726,31 @@ private Mono> createOrUpdateWithResponseAsync(String resou if (targetName == null) { return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); } - if (target == null) { - return Mono.error(new IllegalArgumentException("Parameter target is required and cannot be null.")); - } else { - target.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target, accept, context)) + parentResourceName, targetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response} on successful completion of - * {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync(String resourceGroupName, - String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, - TargetInner target, Context context) { + private Mono> deleteWithResponseAsync(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -768,80 +778,71 @@ private Mono> createOrUpdateWithResponseAsync(String resou if (targetName == null) { return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); } - if (target == null) { - return Mono.error(new IllegalArgumentException("Parameter target is required and cannot be null.")); - } else { - target.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, accept, + context); } /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target) { - return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono deleteAsync(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName) { + return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName).flatMap(ignored -> Mono.empty()); } /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response}. + * @return the {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target, context).block(); + public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, Context context) { + return deleteWithResponseAsync(resourceGroupName, parentProviderNamespace, parentResourceType, + parentResourceName, targetName, context).block(); } /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TargetInner createOrUpdate(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target) { - return createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target, Context.NONE).getValue(); + public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName) { + deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, + targetName, Context.NONE); } /** diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java index 2e1f21532081..b8ce2abb0ed7 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java @@ -65,24 +65,12 @@ public Target get(String resourceGroupName, String parentProviderNamespace, Stri } } - public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, Context context) { - return this.serviceClient() - .deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, context); - } - - public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName) { - this.serviceClient() - .delete(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); - } - public Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target, Context context) { + String parentResourceType, String parentResourceName, String targetName, TargetInner resource, + Context context) { Response inner = this.serviceClient() .createOrUpdateWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, - parentResourceName, targetName, target, context); + parentResourceName, targetName, resource, context); if (inner != null) { return new SimpleResponse<>(inner.getRequest(), inner.getStatusCode(), inner.getHeaders(), new TargetImpl(inner.getValue(), this.manager())); @@ -92,10 +80,10 @@ public Response createOrUpdateWithResponse(String resourceGroupName, Str } public Target createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, TargetInner target) { + String parentResourceName, String targetName, TargetInner resource) { TargetInner inner = this.serviceClient() .createOrUpdate(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, - targetName, target); + targetName, resource); if (inner != null) { return new TargetImpl(inner, this.manager()); } else { @@ -103,6 +91,19 @@ public Target createOrUpdate(String resourceGroupName, String parentProviderName } } + public Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, Context context) { + return this.serviceClient() + .deleteWithResponse(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, + targetName, context); + } + + public void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName) { + this.serviceClient() + .delete(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); + } + private TargetsClient serviceClient() { return this.innerClient; } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java index 86ae2c843c9e..4df5be9484ef 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java @@ -14,36 +14,36 @@ */ public interface Capabilities { /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @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 a list of Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName); /** - * Get a list of Capability resources that extend a Target resource.. + * Get a list of Capability resources that extend a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param continuationToken String that sets the continuation token. * @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 a list of Capability resources that extend a Target resource. as paginated response with + * @return a list of Capability resources that extend a Target resource as paginated response with * {@link PagedIterable}. */ PagedIterable list(String resourceGroupName, String parentProviderNamespace, String parentResourceType, @@ -52,10 +52,10 @@ PagedIterable list(String resourceGroupName, String parentProviderNa /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @param context The context to associate with this operation. @@ -71,10 +71,10 @@ Response getWithResponse(String resourceGroupName, String parentProv /** * Get a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -86,75 +86,75 @@ Capability get(String resourceGroupName, String parentProviderNamespace, String String parentResourceName, String targetName, String capabilityName); /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 Response}. + * @return model that represents a Capability resource along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - Context context); + CapabilityInner resource, Context context); /** - * Delete a Capability that extends a Target resource. + * Create or update a Capability resource that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. + * @param resource Capability resource to be created or updated. * @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 model that represents a Capability resource. */ - void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName); + Capability createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName, CapabilityInner resource); /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource along with {@link Response}. + * @return the {@link Response}. */ - Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, + Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName, String targetName, String capabilityName, - CapabilityInner capability, Context context); + Context context); /** - * Create or update a Capability resource that extends a Target resource. + * Delete a Capability that extends a Target resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param capabilityName String that represents a Capability resource name. - * @param capability Capability resource to be created or updated. * @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 model that represents a Capability resource. */ - Capability createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, String capabilityName, CapabilityInner capability); + void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, String capabilityName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java index c5e258f3cbdb..6aef00f48d05 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java @@ -33,7 +33,7 @@ public interface Capability { String type(); /** - * Gets the systemData property: The standard system metadata of a resource type. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java index 9aa574ce758b..b2501b5f337c 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Capability resources and a link for pagination. */ -@Immutable +@Fluent public final class CapabilityListResult implements JsonSerializable { /* - * List of Capability resources. + * The Capability items on this page */ private List value; /* - * URL to retrieve the next page of Capability resources. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public CapabilityListResult() { } /** - * Get the value property: List of Capability resources. + * Get the value property: The Capability items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Capability resources. + * Set the value property: The Capability items on this page. + * + * @param value the value value to set. + * @return the CapabilityListResult object itself. + */ + public CapabilityListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,41 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CapabilityListResult object itself. + */ + public CapabilityListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CapabilityListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(CapabilityListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CapabilityListResult 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 CapabilityListResult. */ public static CapabilityListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java index cc8626daf529..eb3846c7a830 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java @@ -34,19 +34,12 @@ public interface CapabilityType { String type(); /** - * Gets the systemData property: The system metadata properties of the capability type resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); - /** - * Gets the location property: Location of the Capability Type resource. - * - * @return the location value. - */ - String location(); - /** * Gets the publisher property: String of the Publisher that this Capability Type extends. * @@ -110,6 +103,13 @@ public interface CapabilityType { */ List azureRbacDataActions(); + /** + * Gets the requiredAzureRoleDefinitionIds property: Required Azure Role Definition Ids to execute capability type. + * + * @return the requiredAzureRoleDefinitionIds value. + */ + List requiredAzureRoleDefinitionIds(); + /** * Gets the runtimeProperties property: Runtime properties of this Capability Type. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java index 791e7c926f1e..8fd9f593b7e0 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Capability Type resources and a link for pagination. */ -@Immutable +@Fluent public final class CapabilityTypeListResult implements JsonSerializable { /* - * List of Capability Type resources. + * The CapabilityType items on this page */ private List value; /* - * URL to retrieve the next page of Capability Type resources. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public CapabilityTypeListResult() { } /** - * Get the value property: List of Capability Type resources. + * Get the value property: The CapabilityType items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Capability Type resources. + * Set the value property: The CapabilityType items on this page. + * + * @param value the value value to set. + * @return the CapabilityTypeListResult object itself. + */ + public CapabilityTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,41 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the CapabilityTypeListResult object itself. + */ + public CapabilityTypeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CapabilityTypeListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(CapabilityTypeListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of CapabilityTypeListResult 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 CapabilityTypeListResult. */ public static CapabilityTypeListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java index f6625900b008..7a005f4efcbe 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java @@ -15,7 +15,7 @@ public interface CapabilityTypes { /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -23,12 +23,12 @@ public interface CapabilityTypes { * @return a list of Capability Type resources for given Target Type and location as paginated response with * {@link PagedIterable}. */ - PagedIterable list(String locationName, String targetTypeName); + PagedIterable list(String location, String targetTypeName); /** * Get a list of Capability Type resources for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. @@ -38,13 +38,13 @@ public interface CapabilityTypes { * @return a list of Capability Type resources for given Target Type and location as paginated response with * {@link PagedIterable}. */ - PagedIterable list(String locationName, String targetTypeName, String continuationToken, + PagedIterable list(String location, String targetTypeName, String continuationToken, Context context); /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @param context The context to associate with this operation. @@ -53,13 +53,13 @@ PagedIterable list(String locationName, String targetTypeName, S * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Capability Type resource for given Target Type and location along with {@link Response}. */ - Response getWithResponse(String locationName, String targetTypeName, String capabilityTypeName, + Response getWithResponse(String location, String targetTypeName, String capabilityTypeName, Context context); /** * Get a Capability Type resource for given Target Type and location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param capabilityTypeName String that represents a Capability Type resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,5 +67,5 @@ Response getWithResponse(String locationName, String targetTypeN * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Capability Type resource for given Target Type and location. */ - CapabilityType get(String locationName, String targetTypeName, String capabilityTypeName); + CapabilityType get(String location, String targetTypeName, String capabilityTypeName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java index 2ed9ea354644..f78a258d73fe 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosExperimentAction.java @@ -18,9 +18,9 @@ @Fluent public class ChaosExperimentAction implements JsonSerializable { /* - * Enum that discriminates between action models. + * Chaos experiment action discriminator type */ - private String type = "ChaosExperimentAction"; + private ExperimentActionType type = ExperimentActionType.fromString("ChaosExperimentAction"); /* * String that represents a Capability URN. @@ -34,11 +34,11 @@ public ChaosExperimentAction() { } /** - * Get the type property: Enum that discriminates between action models. + * Get the type property: Chaos experiment action discriminator type. * * @return the type value. */ - public String type() { + public ExperimentActionType type() { return this.type; } @@ -83,7 +83,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", this.name); - jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -112,12 +112,12 @@ public static ChaosExperimentAction fromJson(JsonReader jsonReader) throws IOExc } } // Use the discriminator value to determine which subtype should be deserialized. - if ("delay".equals(discriminatorValue)) { + if ("continuous".equals(discriminatorValue)) { + return ContinuousAction.fromJson(readerToUse.reset()); + } else if ("delay".equals(discriminatorValue)) { return DelayAction.fromJson(readerToUse.reset()); } else if ("discrete".equals(discriminatorValue)) { return DiscreteAction.fromJson(readerToUse.reset()); - } else if ("continuous".equals(discriminatorValue)) { - return ContinuousAction.fromJson(readerToUse.reset()); } else { return fromJsonKnownDiscriminator(readerToUse.reset()); } @@ -135,7 +135,7 @@ static ChaosExperimentAction fromJsonKnownDiscriminator(JsonReader jsonReader) t if ("name".equals(fieldName)) { deserializedChaosExperimentAction.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedChaosExperimentAction.type = reader.getString(); + deserializedChaosExperimentAction.type = ExperimentActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java index dac752e529ce..22de7c247955 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetFilter.java @@ -17,7 +17,7 @@ @Immutable public class ChaosTargetFilter implements JsonSerializable { /* - * Enum that discriminates between filter types. Currently only `Simple` type is supported. + * Chaos target filter discriminator type */ private FilterType type = FilterType.fromString("ChaosTargetFilter"); @@ -28,7 +28,7 @@ public ChaosTargetFilter() { } /** - * Get the type property: Enum that discriminates between filter types. Currently only `Simple` type is supported. + * Get the type property: Chaos target filter discriminator type. * * @return the type value. */ diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java index b71a4ff8ec24..27c0865a832d 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetListSelector.java @@ -10,9 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; /** * Model that represents a list selector. @@ -20,7 +18,7 @@ @Fluent public final class ChaosTargetListSelector extends ChaosTargetSelector { /* - * Enum of the selector type. + * Chaos target selector discriminator type */ private SelectorType type = SelectorType.LIST; @@ -36,7 +34,7 @@ public ChaosTargetListSelector() { } /** - * Get the type property: Enum of the selector type. + * Get the type property: Chaos target selector discriminator type. * * @return the type value. */ @@ -118,11 +116,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeJsonField("filter", filter()); jsonWriter.writeArrayField("targets", this.targets, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } return jsonWriter.writeEndObject(); } @@ -138,7 +131,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static ChaosTargetListSelector fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { ChaosTargetListSelector deserializedChaosTargetListSelector = new ChaosTargetListSelector(); - Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -153,14 +145,9 @@ public static ChaosTargetListSelector fromJson(JsonReader jsonReader) throws IOE } else if ("type".equals(fieldName)) { deserializedChaosTargetListSelector.type = SelectorType.fromString(reader.getString()); } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); + reader.skipChildren(); } } - deserializedChaosTargetListSelector.withAdditionalProperties(additionalProperties); return deserializedChaosTargetListSelector; }); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java index bef50b389be5..de10493420c8 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetQuerySelector.java @@ -10,9 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.LinkedHashMap; import java.util.List; -import java.util.Map; /** * Model that represents a query selector. @@ -20,7 +18,7 @@ @Fluent public final class ChaosTargetQuerySelector extends ChaosTargetSelector { /* - * Enum of the selector type. + * Chaos target selector discriminator type */ private SelectorType type = SelectorType.QUERY; @@ -41,7 +39,7 @@ public ChaosTargetQuerySelector() { } /** - * Get the type property: Enum of the selector type. + * Get the type property: Chaos target selector discriminator type. * * @return the type value. */ @@ -148,11 +146,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeArrayField("subscriptionIds", this.subscriptionIds, (writer, element) -> writer.writeString(element)); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); - if (additionalProperties() != null) { - for (Map.Entry additionalProperty : additionalProperties().entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } return jsonWriter.writeEndObject(); } @@ -168,7 +161,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { public static ChaosTargetQuerySelector fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { ChaosTargetQuerySelector deserializedChaosTargetQuerySelector = new ChaosTargetQuerySelector(); - Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -185,14 +177,9 @@ public static ChaosTargetQuerySelector fromJson(JsonReader jsonReader) throws IO } else if ("type".equals(fieldName)) { deserializedChaosTargetQuerySelector.type = SelectorType.fromString(reader.getString()); } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); + reader.skipChildren(); } } - deserializedChaosTargetQuerySelector.withAdditionalProperties(additionalProperties); return deserializedChaosTargetQuerySelector; }); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java index 6a973a32224a..c91570d331fd 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSelector.java @@ -11,8 +11,6 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; -import java.util.LinkedHashMap; -import java.util.Map; /** * Model that represents a selector in the Experiment resource. @@ -20,7 +18,7 @@ @Fluent public class ChaosTargetSelector implements JsonSerializable { /* - * Enum of the selector type. + * Chaos target selector discriminator type */ private SelectorType type = SelectorType.fromString("ChaosTargetSelector"); @@ -34,11 +32,6 @@ public class ChaosTargetSelector implements JsonSerializable additionalProperties; - /** * Creates an instance of ChaosTargetSelector class. */ @@ -46,7 +39,7 @@ public ChaosTargetSelector() { } /** - * Get the type property: Enum of the selector type. + * Get the type property: Chaos target selector discriminator type. * * @return the type value. */ @@ -94,26 +87,6 @@ public ChaosTargetSelector withFilter(ChaosTargetFilter filter) { return this; } - /** - * Get the additionalProperties property: Model that represents a selector in the Experiment resource. - * - * @return the additionalProperties value. - */ - public Map additionalProperties() { - return this.additionalProperties; - } - - /** - * Set the additionalProperties property: Model that represents a selector in the Experiment resource. - * - * @param additionalProperties the additionalProperties value to set. - * @return the ChaosTargetSelector object itself. - */ - public ChaosTargetSelector withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - /** * Validates the instance. * @@ -140,11 +113,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("id", this.id); jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); jsonWriter.writeJsonField("filter", this.filter); - if (additionalProperties != null) { - for (Map.Entry additionalProperty : additionalProperties.entrySet()) { - jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue()); - } - } return jsonWriter.writeEndObject(); } @@ -187,7 +155,6 @@ public static ChaosTargetSelector fromJson(JsonReader jsonReader) throws IOExcep static ChaosTargetSelector fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { ChaosTargetSelector deserializedChaosTargetSelector = new ChaosTargetSelector(); - Map additionalProperties = null; while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); @@ -199,14 +166,9 @@ static ChaosTargetSelector fromJsonKnownDiscriminator(JsonReader jsonReader) thr } else if ("filter".equals(fieldName)) { deserializedChaosTargetSelector.filter = ChaosTargetFilter.fromJson(reader); } else { - if (additionalProperties == null) { - additionalProperties = new LinkedHashMap<>(); - } - - additionalProperties.put(fieldName, reader.readUntyped()); + reader.skipChildren(); } } - deserializedChaosTargetSelector.additionalProperties = additionalProperties; return deserializedChaosTargetSelector; }); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java index 33640442c7b1..af63279d9251 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ChaosTargetSimpleFilter.java @@ -16,7 +16,7 @@ @Fluent public final class ChaosTargetSimpleFilter extends ChaosTargetFilter { /* - * Enum that discriminates between filter types. Currently only `Simple` type is supported. + * Chaos target filter discriminator type */ private FilterType type = FilterType.SIMPLE; @@ -32,7 +32,7 @@ public ChaosTargetSimpleFilter() { } /** - * Get the type property: Enum that discriminates between filter types. Currently only `Simple` type is supported. + * Get the type property: Chaos target filter discriminator type. * * @return the type value. */ diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java index 98ae7bc88471..913a22867456 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java @@ -20,9 +20,9 @@ @Fluent public final class ContinuousAction extends ChaosExperimentAction { /* - * Enum that discriminates between action models. + * Chaos experiment action discriminator type */ - private String type = "continuous"; + private ExperimentActionType type = ExperimentActionType.CONTINUOUS; /* * ISO8601 formatted string that represents a duration. @@ -46,12 +46,12 @@ public ContinuousAction() { } /** - * Get the type property: Enum that discriminates between action models. + * Get the type property: Chaos experiment action discriminator type. * * @return the type value. */ @Override - public String type() { + public ExperimentActionType type() { return this.type; } @@ -163,7 +163,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("selectorId", this.selectorId); - jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -194,7 +194,7 @@ public static ContinuousAction fromJson(JsonReader jsonReader) throws IOExceptio } else if ("selectorId".equals(fieldName)) { deserializedContinuousAction.selectorId = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedContinuousAction.type = reader.getString(); + deserializedContinuousAction.type = ExperimentActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java index 5b36dad81973..4357df5dce9c 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java @@ -19,9 +19,9 @@ @Fluent public final class DelayAction extends ChaosExperimentAction { /* - * Enum that discriminates between action models. + * Chaos experiment action discriminator type */ - private String type = "delay"; + private ExperimentActionType type = ExperimentActionType.DELAY; /* * ISO8601 formatted string that represents a duration. @@ -35,12 +35,12 @@ public DelayAction() { } /** - * Get the type property: Enum that discriminates between action models. + * Get the type property: Chaos experiment action discriminator type. * * @return the type value. */ @Override - public String type() { + public ExperimentActionType type() { return this.type; } @@ -100,7 +100,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("name", name()); jsonWriter.writeStringField("duration", CoreUtils.durationToStringWithDays(this.duration)); - jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -126,7 +126,7 @@ public static DelayAction fromJson(JsonReader jsonReader) throws IOException { deserializedDelayAction.duration = reader.getNullable(nonNullReader -> Duration.parse(nonNullReader.getString())); } else if ("type".equals(fieldName)) { - deserializedDelayAction.type = reader.getString(); + deserializedDelayAction.type = ExperimentActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java index 3812406669d4..e143cff74b0c 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java @@ -18,9 +18,9 @@ @Fluent public final class DiscreteAction extends ChaosExperimentAction { /* - * Enum that discriminates between action models. + * Chaos experiment action discriminator type */ - private String type = "discrete"; + private ExperimentActionType type = ExperimentActionType.DISCRETE; /* * List of key value pairs. @@ -39,12 +39,12 @@ public DiscreteAction() { } /** - * Get the type property: Enum that discriminates between action models. + * Get the type property: Chaos experiment action discriminator type. * * @return the type value. */ @Override - public String type() { + public ExperimentActionType type() { return this.type; } @@ -131,7 +131,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("name", name()); jsonWriter.writeArrayField("parameters", this.parameters, (writer, element) -> writer.writeJson(element)); jsonWriter.writeStringField("selectorId", this.selectorId); - jsonWriter.writeStringField("type", this.type); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); return jsonWriter.writeEndObject(); } @@ -159,7 +159,7 @@ public static DiscreteAction fromJson(JsonReader jsonReader) throws IOException } else if ("selectorId".equals(fieldName)) { deserializedDiscreteAction.selectorId = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedDiscreteAction.type = reader.getString(); + deserializedDiscreteAction.type = ExperimentActionType.fromString(reader.getString()); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java index 31e719c87678..21965244a6e4 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java @@ -51,18 +51,18 @@ public interface Experiment { Map tags(); /** - * Gets the systemData property: The system metadata of the experiment resource. + * Gets the identity property: The managed service identities assigned to this resource. * - * @return the systemData value. + * @return the identity value. */ - SystemData systemData(); + ManagedServiceIdentity identity(); /** - * Gets the identity property: The identity of the experiment resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the identity value. + * @return the systemData value. */ - ResourceIdentity identity(); + SystemData systemData(); /** * Gets the provisioningState property: Most recent provisioning state for the given experiment resource. @@ -159,7 +159,7 @@ interface WithResourceGroup { /** * Specifies resourceGroupName. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @return the next definition stage. */ WithSteps withExistingResourceGroup(String resourceGroupName); @@ -230,12 +230,12 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: The identity of the experiment resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity The identity of the experiment resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - WithCreate withIdentity(ResourceIdentity identity); + WithCreate withIdentity(ManagedServiceIdentity identity); } } @@ -275,9 +275,9 @@ interface UpdateStages { */ interface WithTags { /** - * Specifies the tags property: The tags of the experiment resource.. + * Specifies the tags property: Resource tags.. * - * @param tags The tags of the experiment resource. + * @param tags Resource tags. * @return the next definition stage. */ Update withTags(Map tags); @@ -288,12 +288,12 @@ interface WithTags { */ interface WithIdentity { /** - * Specifies the identity property: The identity of the experiment resource.. + * Specifies the identity property: The managed service identities assigned to this resource.. * - * @param identity The identity of the experiment resource. + * @param identity The managed service identities assigned to this resource. * @return the next definition stage. */ - Update withIdentity(ResourceIdentity identity); + Update withIdentity(ManagedServiceIdentity identity); } } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentActionType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentActionType.java new file mode 100644 index 000000000000..0cd2fc5986ef --- /dev/null +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentActionType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.chaos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Enum union of Chaos experiment action types. + */ +public final class ExperimentActionType extends ExpandableStringEnum { + /** + * Static value delay for ExperimentActionType. + */ + public static final ExperimentActionType DELAY = fromString("delay"); + + /** + * Static value discrete for ExperimentActionType. + */ + public static final ExperimentActionType DISCRETE = fromString("discrete"); + + /** + * Static value continuous for ExperimentActionType. + */ + public static final ExperimentActionType CONTINUOUS = fromString("continuous"); + + /** + * Creates a new instance of ExperimentActionType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ExperimentActionType() { + } + + /** + * Creates or finds a ExperimentActionType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ExperimentActionType. + */ + public static ExperimentActionType fromString(String name) { + return fromString(name, ExperimentActionType.class); + } + + /** + * Gets known ExperimentActionType values. + * + * @return known ExperimentActionType values. + */ + public static Collection values() { + return values(ExperimentActionType.class); + } +} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecution.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecution.java index 84c51ef155c6..9058d70efb1f 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecution.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecution.java @@ -4,6 +4,7 @@ package com.azure.resourcemanager.chaos.models; +import com.azure.core.management.SystemData; import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner; import java.time.OffsetDateTime; @@ -12,26 +13,33 @@ */ public interface ExperimentExecution { /** - * Gets the type property: String of the resource type. - * - * @return the type value. - */ - String type(); - - /** - * Gets the id property: String of the fully qualified resource ID. + * Gets the id property: Fully qualified resource Id for the resource. * * @return the id value. */ String id(); /** - * Gets the name property: String of the resource name. + * Gets the name property: The name of the resource. * * @return the name value. */ String name(); + /** + * Gets the type property: The type of the resource. + * + * @return the type value. + */ + String type(); + + /** + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + SystemData systemData(); + /** * Gets the status property: The status of the execution. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java index a3389a3da090..a49e9ebb3a19 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java @@ -5,7 +5,6 @@ package com.azure.resourcemanager.chaos.models; import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import java.time.OffsetDateTime; /** * An immutable client-side representation of ExperimentExecutionDetails. @@ -33,46 +32,11 @@ public interface ExperimentExecutionDetails { String name(); /** - * Gets the failureReason property: The reason why the execution failed. + * Gets the properties property: The properties of the experiment execution details. * - * @return the failureReason value. + * @return the properties value. */ - String failureReason(); - - /** - * Gets the lastActionAt property: String that represents the last action date time. - * - * @return the lastActionAt value. - */ - OffsetDateTime lastActionAt(); - - /** - * Gets the runInformation property: The information of the experiment run. - * - * @return the runInformation value. - */ - ExperimentExecutionDetailsPropertiesRunInformation runInformation(); - - /** - * Gets the status property: The status of the execution. - * - * @return the status value. - */ - String status(); - - /** - * Gets the startedAt property: String that represents the start date time. - * - * @return the startedAt value. - */ - OffsetDateTime startedAt(); - - /** - * Gets the stoppedAt property: String that represents the stop date time. - * - * @return the stoppedAt value. - */ - OffsetDateTime stoppedAt(); + ExperimentExecutionDetailsProperties properties(); /** * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner object. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsProperties.java similarity index 94% rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsProperties.java rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsProperties.java index cc3245583b43..ef1585041f3a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsProperties.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsProperties.java @@ -2,14 +2,14 @@ // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. -package com.azure.resourcemanager.chaos.fluent.models; +package com.azure.resourcemanager.chaos.models; import com.azure.core.annotation.Immutable; 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.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; import java.io.IOException; import java.time.OffsetDateTime; @@ -17,36 +17,37 @@ * Model that represents the extended properties of an experiment execution. */ @Immutable -public final class ExperimentExecutionDetailsProperties extends ExperimentExecutionProperties { +public final class ExperimentExecutionDetailsProperties + implements JsonSerializable { /* - * The reason why the execution failed. + * The status of the execution. */ - private String failureReason; + private String status; /* - * String that represents the last action date time. + * String that represents the start date time. */ - private OffsetDateTime lastActionAt; + private OffsetDateTime startedAt; /* - * The information of the experiment run. + * String that represents the stop date time. */ - private ExperimentExecutionDetailsPropertiesRunInformation runInformation; + private OffsetDateTime stoppedAt; /* - * String that represents the stop date time. + * The reason why the execution failed. */ - private OffsetDateTime stoppedAt; + private String failureReason; /* - * String that represents the start date time. + * String that represents the last action date time. */ - private OffsetDateTime startedAt; + private OffsetDateTime lastActionAt; /* - * The status of the execution. + * The information of the experiment run. */ - private String status; + private ExperimentExecutionDetailsPropertiesRunInformation runInformation; /** * Creates an instance of ExperimentExecutionDetailsProperties class. @@ -55,60 +56,57 @@ public ExperimentExecutionDetailsProperties() { } /** - * Get the failureReason property: The reason why the execution failed. + * Get the status property: The status of the execution. * - * @return the failureReason value. + * @return the status value. */ - public String failureReason() { - return this.failureReason; + public String status() { + return this.status; } /** - * Get the lastActionAt property: String that represents the last action date time. + * Get the startedAt property: String that represents the start date time. * - * @return the lastActionAt value. + * @return the startedAt value. */ - public OffsetDateTime lastActionAt() { - return this.lastActionAt; + public OffsetDateTime startedAt() { + return this.startedAt; } /** - * Get the runInformation property: The information of the experiment run. + * Get the stoppedAt property: String that represents the stop date time. * - * @return the runInformation value. + * @return the stoppedAt value. */ - public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { - return this.runInformation; + public OffsetDateTime stoppedAt() { + return this.stoppedAt; } /** - * Get the stoppedAt property: String that represents the stop date time. + * Get the failureReason property: The reason why the execution failed. * - * @return the stoppedAt value. + * @return the failureReason value. */ - @Override - public OffsetDateTime stoppedAt() { - return this.stoppedAt; + public String failureReason() { + return this.failureReason; } /** - * Get the startedAt property: String that represents the start date time. + * Get the lastActionAt property: String that represents the last action date time. * - * @return the startedAt value. + * @return the lastActionAt value. */ - @Override - public OffsetDateTime startedAt() { - return this.startedAt; + public OffsetDateTime lastActionAt() { + return this.lastActionAt; } /** - * Get the status property: The status of the execution. + * Get the runInformation property: The information of the experiment run. * - * @return the status value. + * @return the runInformation value. */ - @Override - public String status() { - return this.status; + public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { + return this.runInformation; } /** @@ -116,7 +114,6 @@ public String status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (runInformation() != null) { runInformation().validate(); diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionListResult.java index 660d83bb613f..b94305dc98c0 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Experiment executions and a link for pagination. */ -@Immutable +@Fluent public final class ExperimentExecutionListResult implements JsonSerializable { /* - * List of Experiment executions. + * The ExperimentExecution items on this page */ private List value; /* - * URL to retrieve the next page of Experiment executions. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public ExperimentExecutionListResult() { } /** - * Get the value property: List of Experiment executions. + * Get the value property: The ExperimentExecution items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Experiment executions. + * Set the value property: The ExperimentExecution items on this page. + * + * @param value the value value to set. + * @return the ExperimentExecutionListResult object itself. + */ + public ExperimentExecutionListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,42 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ExperimentExecutionListResult object itself. + */ + public ExperimentExecutionListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ExperimentExecutionListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ExperimentExecutionListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +109,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExperimentExecutionListResult 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 ExperimentExecutionListResult. */ public static ExperimentExecutionListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java index 8e27107020d0..09a2479e1059 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Experiment resources and a link for pagination. */ -@Immutable +@Fluent public final class ExperimentListResult implements JsonSerializable { /* - * List of Experiment resources. + * The Experiment items on this page */ private List value; /* - * URL to retrieve the next page of Experiment resources. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public ExperimentListResult() { } /** - * Get the value property: List of Experiment resources. + * Get the value property: The Experiment items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Experiment resources. + * Set the value property: The Experiment items on this page. + * + * @param value the value value to set. + * @return the ExperimentListResult object itself. + */ + public ExperimentListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,41 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the ExperimentListResult object itself. + */ + public ExperimentListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ExperimentListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(ExperimentListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ExperimentListResult 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 ExperimentListResult. */ public static ExperimentListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java index 6bcdfca6a62d..a7ab01384fdb 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java @@ -18,14 +18,14 @@ @Fluent public final class ExperimentUpdate implements JsonSerializable { /* - * The identity of the experiment resource. + * Resource tags. */ - private ResourceIdentity identity; + private Map tags; /* - * The tags of the experiment resource. + * The managed service identities assigned to this resource. */ - private Map tags; + private ManagedServiceIdentity identity; /** * Creates an instance of ExperimentUpdate class. @@ -34,42 +34,42 @@ public ExperimentUpdate() { } /** - * Get the identity property: The identity of the experiment resource. + * Get the tags property: Resource tags. * - * @return the identity value. + * @return the tags value. */ - public ResourceIdentity identity() { - return this.identity; + public Map tags() { + return this.tags; } /** - * Set the identity property: The identity of the experiment resource. + * Set the tags property: Resource tags. * - * @param identity the identity value to set. + * @param tags the tags value to set. * @return the ExperimentUpdate object itself. */ - public ExperimentUpdate withIdentity(ResourceIdentity identity) { - this.identity = identity; + public ExperimentUpdate withTags(Map tags) { + this.tags = tags; return this; } /** - * Get the tags property: The tags of the experiment resource. + * Get the identity property: The managed service identities assigned to this resource. * - * @return the tags value. + * @return the identity value. */ - public Map tags() { - return this.tags; + public ManagedServiceIdentity identity() { + return this.identity; } /** - * Set the tags property: The tags of the experiment resource. + * Set the identity property: The managed service identities assigned to this resource. * - * @param tags the tags value to set. + * @param identity the identity value to set. * @return the ExperimentUpdate object itself. */ - public ExperimentUpdate withTags(Map tags) { - this.tags = tags; + public ExperimentUpdate withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; return this; } @@ -90,8 +90,8 @@ public void validate() { @Override 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("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -110,11 +110,11 @@ public static ExperimentUpdate fromJson(JsonReader jsonReader) throws IOExceptio String fieldName = reader.getFieldName(); reader.nextToken(); - if ("identity".equals(fieldName)) { - deserializedExperimentUpdate.identity = ResourceIdentity.fromJson(reader); - } else if ("tags".equals(fieldName)) { + if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedExperimentUpdate.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedExperimentUpdate.identity = ManagedServiceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java index 60f1f3768861..579ed6bd7d02 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java @@ -38,7 +38,7 @@ public interface Experiments { /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @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. @@ -49,7 +49,7 @@ public interface Experiments { /** * Get a list of Experiment resources in a resource group. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param running Optional value that indicates whether to filter results based on if the Experiment is currently * running. If null, then the results will not be filtered. * @param continuationToken String that sets the continuation token. @@ -62,33 +62,10 @@ public interface Experiments { PagedIterable listByResourceGroup(String resourceGroupName, Boolean running, String continuationToken, Context context); - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - void deleteByResourceGroup(String resourceGroupName, String experimentName); - - /** - * Delete a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @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. - */ - void delete(String resourceGroupName, String experimentName, Context context); - /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -102,7 +79,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, St /** * Get a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -112,55 +89,55 @@ Response getByResourceGroupWithResponse(String resourceGroupName, St Experiment getByResourceGroup(String resourceGroupName, String experimentName); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ - void cancel(String resourceGroupName, String experimentName); + void deleteByResourceGroup(String resourceGroupName, String experimentName); /** - * Cancel a running Experiment resource. + * Delete a Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ - void cancel(String resourceGroupName, String experimentName, Context context); + void delete(String resourceGroupName, String experimentName, Context context); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ - void start(String resourceGroupName, String experimentName); + void cancel(String resourceGroupName, String experimentName); /** - * Start a Experiment resource. + * Cancel a running Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @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. */ - void start(String resourceGroupName, String experimentName, Context context); + void cancel(String resourceGroupName, String experimentName, Context context); /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -172,7 +149,7 @@ Response getByResourceGroupWithResponse(String resourceGroupName, St /** * Get a list of executions of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -186,7 +163,7 @@ PagedIterable listAllExecutions(String resourceGroupName, S /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -201,7 +178,7 @@ Response getExecutionWithResponse(String resourceGroupName, /** * Get an execution of an Experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -214,7 +191,7 @@ Response getExecutionWithResponse(String resourceGroupName, /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @param context The context to associate with this operation. @@ -229,7 +206,7 @@ Response executionDetailsWithResponse(String resourc /** * Execution details of an experiment resource. * - * @param resourceGroupName String that represents an Azure resource group. + * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param experimentName String that represents a Experiment resource name. * @param executionId GUID that represents a Experiment execution detail. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -239,6 +216,29 @@ Response executionDetailsWithResponse(String resourc */ ExperimentExecutionDetails executionDetails(String resourceGroupName, String experimentName, String executionId); + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + void start(String resourceGroupName, String experimentName); + + /** + * Start a Experiment resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param experimentName String that represents a Experiment resource name. + * @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. + */ + void start(String resourceGroupName, String experimentName, Context context); + /** * Get a Experiment resource. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentity.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentity.java similarity index 50% rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentity.java rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentity.java index 03a2b50fa792..84c7526e5221 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentity.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentity.java @@ -12,101 +12,110 @@ import com.azure.json.JsonWriter; import java.io.IOException; import java.util.Map; +import java.util.UUID; /** - * The identity of a resource. + * Managed service identity (system assigned and/or user assigned identities). */ @Fluent -public final class ResourceIdentity implements JsonSerializable { +public final class ManagedServiceIdentity implements JsonSerializable { /* - * String of the resource identity type. + * The service principal ID of the system assigned identity. This property will only be provided for a system + * assigned identity. */ - private ResourceIdentityType type; + private UUID principalId; /* - * The list of user identities associated with the Experiment. The user identity dictionary key references will be - * ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/ - * userAssignedIdentities/{identityName}'. + * The tenant ID of the system assigned identity. This property will only be provided for a system assigned + * identity. */ - private Map userAssignedIdentities; + private UUID tenantId; /* - * GUID that represents the principal ID of this resource identity. + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). */ - private String principalId; + private ManagedServiceIdentityType type; /* - * GUID that represents the tenant ID of this resource identity. + * 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. */ - private String tenantId; + private Map userAssignedIdentities; /** - * Creates an instance of ResourceIdentity class. + * Creates an instance of ManagedServiceIdentity class. */ - public ResourceIdentity() { + public ManagedServiceIdentity() { } /** - * Get the type property: String of the resource identity type. + * Get the principalId property: The service principal ID of the system assigned identity. This property will only + * be provided for a system assigned identity. * - * @return the type value. + * @return the principalId value. */ - public ResourceIdentityType type() { - return this.type; + public UUID principalId() { + return this.principalId; } /** - * Set the type property: String of the resource identity type. + * Get the tenantId property: The tenant ID of the system assigned identity. This property will only be provided for + * a system assigned identity. * - * @param type the type value to set. - * @return the ResourceIdentity object itself. + * @return the tenantId value. */ - public ResourceIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; + public UUID tenantId() { + return this.tenantId; } /** - * Get the userAssignedIdentities property: The list of user identities associated with the Experiment. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * Get the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). * - * @return the userAssignedIdentities value. + * @return the type value. */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; + public ManagedServiceIdentityType type() { + return this.type; } /** - * Set the userAssignedIdentities property: The list of user identities associated with the Experiment. The user - * identity dictionary key references will be ARM resource ids in the form: - * '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + * Set the type property: Type of managed service identity (where both SystemAssigned and UserAssigned types are + * allowed). * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ResourceIdentity object itself. + * @param type the type value to set. + * @return the ManagedServiceIdentity object itself. */ - public ResourceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; + public ManagedServiceIdentity withType(ManagedServiceIdentityType type) { + this.type = type; return this; } /** - * Get the principalId property: GUID that represents the principal ID of this resource identity. + * 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. * - * @return the principalId value. + * @return the userAssignedIdentities value. */ - public String principalId() { - return this.principalId; + public Map userAssignedIdentities() { + return this.userAssignedIdentities; } /** - * Get the tenantId property: GUID that represents the tenant ID of this resource identity. + * 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. * - * @return the tenantId value. + * @param userAssignedIdentities the userAssignedIdentities value to set. + * @return the ManagedServiceIdentity object itself. */ - public String tenantId() { - return this.tenantId; + public ManagedServiceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { + this.userAssignedIdentities = userAssignedIdentities; + return this; } /** @@ -117,7 +126,7 @@ public String tenantId() { public void validate() { if (type() == null) { throw LOGGER.atError() - .log(new IllegalArgumentException("Missing required property type in model ResourceIdentity")); + .log(new IllegalArgumentException("Missing required property type in model ManagedServiceIdentity")); } if (userAssignedIdentities() != null) { userAssignedIdentities().values().forEach(e -> { @@ -128,7 +137,7 @@ public void validate() { } } - private static final ClientLogger LOGGER = new ClientLogger(ResourceIdentity.class); + private static final ClientLogger LOGGER = new ClientLogger(ManagedServiceIdentity.class); /** * {@inheritDoc} @@ -143,37 +152,39 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { } /** - * Reads an instance of ResourceIdentity from the JsonReader. + * Reads an instance of ManagedServiceIdentity from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ResourceIdentity if the JsonReader was pointing to an instance of it, or null if it was - * pointing to JSON null. + * @return An instance of ManagedServiceIdentity 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 ResourceIdentity. + * @throws IOException If an error occurs while reading the ManagedServiceIdentity. */ - public static ResourceIdentity fromJson(JsonReader jsonReader) throws IOException { + public static ManagedServiceIdentity fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ResourceIdentity deserializedResourceIdentity = new ResourceIdentity(); + ManagedServiceIdentity deserializedManagedServiceIdentity = new ManagedServiceIdentity(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("type".equals(fieldName)) { - deserializedResourceIdentity.type = ResourceIdentityType.fromString(reader.getString()); + deserializedManagedServiceIdentity.type = ManagedServiceIdentityType.fromString(reader.getString()); + } else if ("principalId".equals(fieldName)) { + deserializedManagedServiceIdentity.principalId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); + } else if ("tenantId".equals(fieldName)) { + deserializedManagedServiceIdentity.tenantId + = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString())); } else if ("userAssignedIdentities".equals(fieldName)) { Map userAssignedIdentities = reader.readMap(reader1 -> UserAssignedIdentity.fromJson(reader1)); - deserializedResourceIdentity.userAssignedIdentities = userAssignedIdentities; - } else if ("principalId".equals(fieldName)) { - deserializedResourceIdentity.principalId = reader.getString(); - } else if ("tenantId".equals(fieldName)) { - deserializedResourceIdentity.tenantId = reader.getString(); + deserializedManagedServiceIdentity.userAssignedIdentities = userAssignedIdentities; } else { reader.skipChildren(); } } - return deserializedResourceIdentity; + return deserializedManagedServiceIdentity; }); } } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentityType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentityType.java new file mode 100644 index 000000000000..63dfbda4f1e7 --- /dev/null +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ManagedServiceIdentityType.java @@ -0,0 +1,62 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.chaos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of managed service identity (where both SystemAssigned and UserAssigned types are allowed). + */ +public final class ManagedServiceIdentityType extends ExpandableStringEnum { + /** + * Static value None for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType NONE = fromString("None"); + + /** + * Static value SystemAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED = fromString("SystemAssigned"); + + /** + * Static value UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType USER_ASSIGNED = fromString("UserAssigned"); + + /** + * Static value SystemAssigned,UserAssigned for ManagedServiceIdentityType. + */ + public static final ManagedServiceIdentityType SYSTEM_ASSIGNED_USER_ASSIGNED + = fromString("SystemAssigned,UserAssigned"); + + /** + * Creates a new instance of ManagedServiceIdentityType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ManagedServiceIdentityType() { + } + + /** + * Creates or finds a ManagedServiceIdentityType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ManagedServiceIdentityType. + */ + public static ManagedServiceIdentityType fromString(String name) { + return fromString(name, ManagedServiceIdentityType.class); + } + + /** + * Gets known ManagedServiceIdentityType values. + * + * @return known ManagedServiceIdentityType values. + */ + public static Collection values() { + return values(ManagedServiceIdentityType.class); + } +} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatus.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatusResult.java similarity index 51% rename from sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatus.java rename to sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatusResult.java index e5269e5cbc2b..597fc21c6f4e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatus.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatusResult.java @@ -5,27 +5,50 @@ package com.azure.resourcemanager.chaos.models; import com.azure.core.management.exception.ManagementError; -import com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner; +import com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner; import java.time.OffsetDateTime; +import java.util.List; /** - * An immutable client-side representation of OperationStatus. + * An immutable client-side representation of OperationStatusResult. */ -public interface OperationStatus { +public interface OperationStatusResult { /** - * Gets the id property: The operation Id. + * Gets the id property: Fully qualified ID for the async operation. * * @return the id value. */ String id(); /** - * Gets the name property: The operation name. + * Gets the resourceId property: Fully qualified ID of the resource against which the original async operation was + * started. + * + * @return the resourceId value. + */ + String resourceId(); + + /** + * Gets the name property: Name of the async operation. * * @return the name value. */ String name(); + /** + * Gets the status property: Operation status. + * + * @return the status value. + */ + String status(); + + /** + * Gets the percentComplete property: Percent of the operation that is complete. + * + * @return the percentComplete value. + */ + Float percentComplete(); + /** * Gets the startTime property: The start time of the operation. * @@ -41,23 +64,23 @@ public interface OperationStatus { OffsetDateTime endTime(); /** - * Gets the status property: The status of the operation. + * Gets the operations property: The operations list. * - * @return the status value. + * @return the operations value. */ - String status(); + List operations(); /** - * Gets the error property: The error object. + * Gets the error property: If present, details of the operation error. * * @return the error value. */ ManagementError error(); /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner object. + * Gets the inner com.azure.resourcemanager.chaos.fluent.models.OperationStatusResultInner object. * * @return the inner object. */ - OperationStatusInner innerModel(); + OperationStatusResultInner innerModel(); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatuses.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatuses.java index 54ddb12e295a..d6a36508e34d 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatuses.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationStatuses.java @@ -12,27 +12,27 @@ */ public interface OperationStatuses { /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async operation. * @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 status of a long running azure asynchronous operation along with {@link Response}. + * @return the current status of an async operation along with {@link Response}. */ - Response getWithResponse(String location, String asyncOperationId, Context context); + Response getWithResponse(String location, String operationId, Context context); /** - * Get the status of a long running azure asynchronous operation. + * Returns the current status of an async operation. * * @param location The name of the Azure region. - * @param asyncOperationId The operation Id. + * @param operationId The ID of an ongoing async 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 status of a long running azure asynchronous operation. + * @return the current status of an async operation. */ - OperationStatus get(String location, String asyncOperationId); + OperationStatusResult get(String location, String operationId); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java index 31ed96d56468..d1b8dedc9e72 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java @@ -12,22 +12,24 @@ */ public interface Operations { /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 a list all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable listAll(); /** - * Get a list all available Operations. + * List the operations for the provider. * * @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 a list all available Operations as paginated response with {@link PagedIterable}. + * @return a list of REST API operations supported by an Azure Resource Provider as paginated response with + * {@link PagedIterable}. */ PagedIterable listAll(Context context); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentityType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentityType.java deleted file mode 100644 index 18904e0c93a4..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentityType.java +++ /dev/null @@ -1,61 +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.chaos.models; - -/** - * String of the resource identity type. - */ -public enum ResourceIdentityType { - /** - * Enum value None. - */ - NONE("None"), - - /** - * Enum value SystemAssigned. - */ - SYSTEM_ASSIGNED("SystemAssigned"), - - /** - * Enum value UserAssigned. - */ - USER_ASSIGNED("UserAssigned"); - - /** - * The actual serialized value for a ResourceIdentityType instance. - */ - private final String value; - - ResourceIdentityType(String value) { - this.value = value; - } - - /** - * Parses a serialized value to a ResourceIdentityType instance. - * - * @param value the serialized value to parse. - * @return the parsed ResourceIdentityType object, or null if unable to parse. - */ - public static ResourceIdentityType fromString(String value) { - if (value == null) { - return null; - } - ResourceIdentityType[] items = ResourceIdentityType.values(); - for (ResourceIdentityType item : items) { - if (item.toString().equalsIgnoreCase(value)) { - return item; - } - } - return null; - } - - /** - * {@inheritDoc} - */ - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.java index a4ada3a72e4c..3317df15cc52 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.java @@ -34,25 +34,25 @@ public interface Target { String type(); /** - * Gets the systemData property: The system metadata of the target resource. + * Gets the properties property: The properties of the target resource. * - * @return the systemData value. + * @return the properties value. */ - SystemData systemData(); + Map properties(); /** - * Gets the location property: Location of the target resource. + * Gets the location property: Azure resource location. * * @return the location value. */ String location(); /** - * Gets the properties property: The properties of the target resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the properties value. + * @return the systemData value. */ - Map properties(); + SystemData systemData(); /** * Gets the inner com.azure.resourcemanager.chaos.fluent.models.TargetInner object. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java index 86686d0a2d92..9b2e2df4b53a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Target resources and a link for pagination. */ -@Immutable +@Fluent public final class TargetListResult implements JsonSerializable { /* - * List of Target resources. + * The Target items on this page */ private List value; /* - * URL to retrieve the next page of Target resources. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public TargetListResult() { } /** - * Get the value property: List of Target resources. + * Get the value property: The Target items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Target resources. + * Set the value property: The Target items on this page. + * + * @param value the value value to set. + * @return the TargetListResult object itself. + */ + public TargetListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,41 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the TargetListResult object itself. + */ + public TargetListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TargetListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(TargetListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of TargetListResult 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 TargetListResult. */ public static TargetListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java index f464af6c8f3c..3ca1ab9f2aeb 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java @@ -34,19 +34,12 @@ public interface TargetType { String type(); /** - * Gets the systemData property: The system metadata properties of the target type resource. + * Gets the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * * @return the systemData value. */ SystemData systemData(); - /** - * Gets the location property: Location of the Target Type resource. - * - * @return the location value. - */ - String location(); - /** * Gets the displayName property: Localized string of the display name. * diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java index 6ecb5da31c97..54cba9e13508 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java @@ -4,7 +4,8 @@ package com.azure.resourcemanager.chaos.models; -import com.azure.core.annotation.Immutable; +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,15 +17,15 @@ /** * Model that represents a list of Target Type resources and a link for pagination. */ -@Immutable +@Fluent public final class TargetTypeListResult implements JsonSerializable { /* - * List of Target Type resources. + * The TargetType items on this page */ private List value; /* - * URL to retrieve the next page of Target Type resources. + * The link to the next page of items */ private String nextLink; @@ -35,7 +36,7 @@ public TargetTypeListResult() { } /** - * Get the value property: List of Target Type resources. + * Get the value property: The TargetType items on this page. * * @return the value value. */ @@ -44,7 +45,18 @@ public List value() { } /** - * Get the nextLink property: URL to retrieve the next page of Target Type resources. + * Set the value property: The TargetType items on this page. + * + * @param value the value value to set. + * @return the TargetTypeListResult object itself. + */ + public TargetTypeListResult withValue(List value) { + this.value = value; + return this; + } + + /** + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -52,23 +64,41 @@ public String nextLink() { return this.nextLink; } + /** + * Set the nextLink property: The link to the next page of items. + * + * @param nextLink the nextLink value to set. + * @return the TargetTypeListResult object itself. + */ + public TargetTypeListResult withNextLink(String nextLink) { + this.nextLink = nextLink; + return this; + } + /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model TargetTypeListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(TargetTypeListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +108,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of TargetTypeListResult 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 TargetTypeListResult. */ public static TargetTypeListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.java index 15b8a3960242..1f9ab8896318 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.java @@ -15,18 +15,18 @@ public interface TargetTypes { /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @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 a list of Target Type resources for given location as paginated response with {@link PagedIterable}. */ - PagedIterable list(String locationName); + PagedIterable list(String location); /** * Get a list of Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -34,12 +34,12 @@ public interface TargetTypes { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a list of Target Type resources for given location as paginated response with {@link PagedIterable}. */ - PagedIterable list(String locationName, String continuationToken, Context context); + PagedIterable list(String location, String continuationToken, Context context); /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -47,17 +47,17 @@ public interface TargetTypes { * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return a Target Type resources for given location along with {@link Response}. */ - Response getWithResponse(String locationName, String targetTypeName, Context context); + Response getWithResponse(String location, String targetTypeName, Context context); /** * Get a Target Type resources for given location. * - * @param locationName String that represents a Location resource name. + * @param location The name of the Azure region. * @param targetTypeName String that represents a Target Type resource name. * @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 a Target Type resources for given location. */ - TargetType get(String locationName, String targetTypeName); + TargetType get(String location, String targetTypeName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java index 12dc0dcad5a5..9c699daeb4a8 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java @@ -16,10 +16,10 @@ public interface Targets { /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @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. @@ -32,10 +32,10 @@ PagedIterable list(String resourceGroupName, String parentProviderNamesp /** * Get a list of Target resources that extend a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param continuationToken String that sets the continuation token. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -50,10 +50,10 @@ PagedIterable list(String resourceGroupName, String parentProviderNamesp /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -67,10 +67,10 @@ Response getWithResponse(String resourceGroupName, String parentProvider /** * Get a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -81,69 +81,69 @@ Target get(String resourceGroupName, String parentProviderNamespace, String pare String parentResourceName, String targetName); /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 Response}. + * @return model that represents a Target resource along with {@link Response}. */ - Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, Context context); + Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, TargetInner resource, Context context); /** - * Delete a Target resource that extends a tracked regional resource. + * Create or update a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. + * @param resource Target resource to be created or updated. * @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 model that represents a Target resource. */ - void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName); + Target createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName, TargetInner resource); /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource along with {@link Response}. + * @return the {@link Response}. */ - Response createOrUpdateWithResponse(String resourceGroupName, String parentProviderNamespace, - String parentResourceType, String parentResourceName, String targetName, TargetInner target, Context context); + Response deleteWithResponse(String resourceGroupName, String parentProviderNamespace, + String parentResourceType, String parentResourceName, String targetName, Context context); /** - * Create or update a Target resource that extends a tracked regional resource. + * Delete a Target resource that extends a tracked regional resource. * - * @param resourceGroupName String that represents an Azure resource group. - * @param parentProviderNamespace String that represents a resource provider namespace. - * @param parentResourceType String that represents a resource type. - * @param parentResourceName String that represents a resource name. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param parentProviderNamespace The parent resource provider namespace. + * @param parentResourceType The parent resource type. + * @param parentResourceName The parent resource name. * @param targetName String that represents a Target resource name. - * @param target Target resource to be created or updated. * @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 model that represents a Target resource. */ - Target createOrUpdate(String resourceGroupName, String parentProviderNamespace, String parentResourceType, - String parentResourceName, String targetName, TargetInner target); + void delete(String resourceGroupName, String parentProviderNamespace, String parentResourceType, + String parentResourceName, String targetName); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-chaos/reflect-config.json b/sdk/chaos/azure-resourcemanager-chaos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-chaos/reflect-config.json index 0faaad5435f3..0637a088a01e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-chaos/reflect-config.json +++ b/sdk/chaos/azure-resourcemanager-chaos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-chaos/reflect-config.json @@ -1 +1 @@ -[{"name":"com.azure.resourcemanager.chaos.fluent.models.OperationStatusInner","allDeclaredConstructors":true,"allDeclaredFields":true,"allDeclaredMethods":true}] \ No newline at end of file +[] \ No newline at end of file diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.java index 87a7b26706b1..12faba3cce1f 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.java @@ -12,7 +12,7 @@ public final class CapabilitiesCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_CreateOrUpdate.json */ /** * Sample code: Create/update a Capability that extends a virtual machine Target resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java index 31a365a1f845..d1f84d9eee2a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java @@ -10,7 +10,7 @@ public final class CapabilitiesDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_Delete.json */ /** * Sample code: Delete a Capability that extends a virtual machine Target resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java index b9b578205f4a..1aa1348476c8 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java @@ -10,7 +10,7 @@ public final class CapabilitiesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapability.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_Get.json */ /** * Sample code: Get a Capability that extends a virtual machine Target resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java index 28e882bf01fc..b82686f0c52e 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java @@ -10,7 +10,7 @@ public final class CapabilitiesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListCapabilities.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Capabilities_List.json */ /** * Sample code: List all Capabilities that extend a virtual machine Target resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.java index d072c0f49085..e26c04b4c9f1 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.java @@ -10,7 +10,7 @@ public final class CapabilityTypesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetCapabilityType.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/CapabilityTypes_Get.json */ /** * Sample code: Get a Capability Type for a virtual machine Target resource on westus2 location. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java index 41d3af07ff14..b99b37a755e9 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java @@ -10,7 +10,7 @@ public final class CapabilityTypesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListCapabilityTypes.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/CapabilityTypes_List.json */ /** * Sample code: List all Capability Types for a virtual machine Target resource on westus2 location. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java index 990b2f16fdb8..f78f3f7d2534 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsCancelSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CancelExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Cancel.json */ /** * Sample code: Cancel a running Experiment. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java index 448044593356..ed16b12f3867 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java @@ -9,12 +9,14 @@ import com.azure.resourcemanager.chaos.models.ChaosTargetListSelector; import com.azure.resourcemanager.chaos.models.ContinuousAction; import com.azure.resourcemanager.chaos.models.KeyValuePair; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentityType; import com.azure.resourcemanager.chaos.models.TargetReference; import com.azure.resourcemanager.chaos.models.TargetReferenceType; import java.time.Duration; import java.util.Arrays; +import java.util.HashMap; +import java.util.Map; /** * Samples for Experiments CreateOrUpdate. @@ -22,7 +24,7 @@ public final class ExperimentsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_CreateOrUpdate.json */ /** * Sample code: Create/update a Experiment in a resource group. @@ -47,7 +49,20 @@ public static void createUpdateAExperimentInAResourceGroup(com.azure.resourceman .withTargets(Arrays.asList(new TargetReference().withType(TargetReferenceType.CHAOS_TARGET) .withId( "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.Compute/virtualMachines/exampleVM/providers/Microsoft.Chaos/targets/Microsoft-VirtualMachine"))))) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.SYSTEM_ASSIGNED)) + .withTags(mapOf("key2138", "fakeTokenPlaceholder", "key7131", "fakeTokenPlaceholder")) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.SYSTEM_ASSIGNED)) .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/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.java index d71ed6f1c2f9..05e86d77252b 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Delete.json */ /** * Sample code: Delete a Experiment in a resource group. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsSamples.java index a0d783801868..19b6277d579a 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsExecutionDetailsSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DetailsExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ExecutionDetails.json */ /** * Sample code: Get experiment execution details. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.java index a0d0fb37d8e4..b14327daffbf 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsGetByResourceGroupSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Get.json */ /** * Sample code: Get a Experiment in a resource group. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionSamples.java index 71e551a48ee2..9369753e148d 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsGetExecutionSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetExperimentExecution.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_GetExecution.json */ /** * Sample code: Get the execution of a Experiment. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsSamples.java index 27038b5ac78d..75222fdd9c76 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsSamples.java @@ -10,7 +10,8 @@ public final class ExperimentsListAllExecutionsSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentExecutions.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ListAllExecutions. + * json */ /** * Sample code: List all executions of an Experiment. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java index 15eebd7e5b8c..242f90493ec5 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java @@ -10,8 +10,7 @@ public final class ExperimentsListByResourceGroupSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInAResourceGroup. - * json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_List.json */ /** * Sample code: List all Experiments in a resource group. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java index d9367565bfb4..2b12b2fa25dc 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java @@ -10,8 +10,7 @@ public final class ExperimentsListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListExperimentsInASubscription. - * json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_ListAll.json */ /** * Sample code: List all Experiments in a subscription. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java index e032207008d2..aa7387b2dce6 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java @@ -10,7 +10,7 @@ public final class ExperimentsStartSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/StartExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Start.json */ /** * Sample code: Start a Experiment. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java index b0aa4a901a14..69faa71fd439 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java @@ -5,8 +5,8 @@ package com.azure.resourcemanager.chaos.generated; import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.chaos.models.ManagedServiceIdentityType; import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; import java.util.HashMap; import java.util.Map; @@ -17,7 +17,7 @@ public final class ExperimentsUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/UpdateExperiment.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Experiments_Update.json */ /** * Sample code: Update an Experiment in a resource group. @@ -30,7 +30,7 @@ public static void updateAnExperimentInAResourceGroup(com.azure.resourcemanager. .getValue(); resource.update() .withTags(mapOf("key1", "fakeTokenPlaceholder", "key2", "fakeTokenPlaceholder")) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) + .withIdentity(new ManagedServiceIdentity().withType(ManagedServiceIdentityType.USER_ASSIGNED) .withUserAssignedIdentities(mapOf( "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI", new UserAssignedIdentity()))) diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationStatusesGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationStatusesGetSamples.java index 2a4c7bf04480..68dae1531c5d 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationStatusesGetSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationStatusesGetSamples.java @@ -10,15 +10,15 @@ public final class OperationStatusesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetOperationStatus.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/OperationStatuses_Get.json */ /** - * Sample code: Get specific operation status. + * Sample code: Gets Chaos Studio async operation status. * * @param manager Entry point to ChaosManager. */ - public static void getSpecificOperationStatus(com.azure.resourcemanager.chaos.ChaosManager manager) { + public static void getsChaosStudioAsyncOperationStatus(com.azure.resourcemanager.chaos.ChaosManager manager) { manager.operationStatuses() - .getWithResponse("West US", "713192d7-503f-477a-9cfe-4efc3ee2bd11", com.azure.core.util.Context.NONE); + .getWithResponse("westus2", "4bdadd97-207c-4de8-9bba-08339ae099c7", com.azure.core.util.Context.NONE); } } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationsListAllSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationsListAllSamples.java new file mode 100644 index 000000000000..fbc9e4b5c6fd --- /dev/null +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/OperationsListAllSamples.java @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) AutoRest Code Generator. + +package com.azure.resourcemanager.chaos.generated; + +/** + * Samples for Operations ListAll. + */ +public final class OperationsListAllSamples { + /* + * x-ms-original-file: + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Operations_List.json + */ + /** + * Sample code: Lists all Chaos Studio operations. + * + * @param manager Entry point to ChaosManager. + */ + public static void listsAllChaosStudioOperations(com.azure.resourcemanager.chaos.ChaosManager manager) { + manager.operations().listAll(com.azure.core.util.Context.NONE); + } +} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java index 8dcf3c0cc1d2..9b806b0b4181 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java @@ -10,7 +10,7 @@ public final class TargetTypesGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTargetType.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/TargetTypes_Get.json */ /** * Sample code: Get a Target Type for westus2 location. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java index 206536f875f7..f54c8bbc8dc6 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java @@ -10,7 +10,7 @@ public final class TargetTypesListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListTargetTypes.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/TargetTypes_List.json */ /** * Sample code: List all Target Types for westus2 location. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java index 8f41826b3137..1f10633b8c26 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java @@ -4,10 +4,7 @@ package com.azure.resourcemanager.chaos.generated; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerEncoding; import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import java.io.IOException; import java.util.HashMap; import java.util.Map; @@ -17,22 +14,18 @@ public final class TargetsCreateOrUpdateSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/CreateUpdateTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_CreateOrUpdate.json */ /** * Sample code: Create/update a Target that extends a virtual machine resource. * * @param manager Entry point to ChaosManager. */ - public static void createUpdateATargetThatExtendsAVirtualMachineResource( - com.azure.resourcemanager.chaos.ChaosManager manager) throws IOException { + public static void + createUpdateATargetThatExtendsAVirtualMachineResource(com.azure.resourcemanager.chaos.ChaosManager manager) { manager.targets() .createOrUpdateWithResponse("exampleRG", "Microsoft.Compute", "virtualMachines", "exampleVM", - "Microsoft-Agent", - new TargetInner().withProperties(mapOf("identities", - SerializerFactory.createDefaultManagementSerializerAdapter() - .deserialize("[{\"type\":\"CertificateSubjectIssuer\",\"subject\":\"CN=example.subject\"}]", - Object.class, SerializerEncoding.JSON))), + "Microsoft-VirtualMachine", new TargetInner().withProperties(mapOf()), com.azure.core.util.Context.NONE); } diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java index be443d3a9ccd..e0a37444b972 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java @@ -10,7 +10,7 @@ public final class TargetsDeleteSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/DeleteTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_Delete.json */ /** * Sample code: Delete a Target that extends a virtual machine resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.java index 3b7fbf832397..7dd09083e2a6 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.java @@ -10,7 +10,7 @@ public final class TargetsGetSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/GetTarget.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_Get.json */ /** * Sample code: Get a Target that extends a virtual machine resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.java index 506a8eb6ea87..3de44bf20023 100644 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.java +++ b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.java @@ -10,7 +10,7 @@ public final class TargetsListSamples { /* * x-ms-original-file: - * specification/chaos/resource-manager/Microsoft.Chaos/stable/2024-01-01/examples/ListTargets.json + * specification/chaos/resource-manager/Microsoft.Chaos/stable/2025-01-01/examples/Targets_List.json */ /** * Sample code: List all Targets that extend a virtual machine resource. diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 70c504ac1527..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CapabilitiesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"publisher\":\"xi\",\"targetType\":\"rmbzo\",\"description\":\"kixrj\",\"parametersSchema\":\"irgzp\",\"urn\":\"lazszrn\"},\"id\":\"oiindfpwpjy\",\"name\":\"wbtlhflsjcdh\",\"type\":\"zfjvfbgofe\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Capability response = manager.capabilities() - .createOrUpdateWithResponse("jjklff", "mouwqlgzrfzeey", "bizikayuhq", "bjbsybb", "wrv", "ldgmfpgvmpip", - new CapabilityInner(), com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteWithResponseMockTests.java deleted file mode 100644 index 7ecfb5ff4f53..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CapabilitiesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.capabilities() - .deleteWithResponse("yhgbijtjivfx", "sjabibs", "stawfsdjpvkv", "bjxbkzbzk", "vncjabudurgk", "kmokz", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetWithResponseMockTests.java deleted file mode 100644 index e4994f209be8..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetWithResponseMockTests.java +++ /dev/null @@ -1,38 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CapabilitiesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"properties\":{\"publisher\":\"dyodnwzxltj\",\"targetType\":\"nhltiugcxn\",\"description\":\"vwxqibyqunyo\",\"parametersSchema\":\"wlmdjrkv\",\"urn\":\"bvfvpdbod\"},\"id\":\"cizsjqlhkrribdei\",\"name\":\"qipqkghvxndz\",\"type\":\"mkrefajpjorwkq\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Capability response = manager.capabilities() - .getWithResponse("fpel", "lppvksrpq", "ujzra", "htwdwrftswibyrcd", "bhshfwpracstwity", "hevxcced", - com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListMockTests.java deleted file mode 100644 index d107dd560741..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListMockTests.java +++ /dev/null @@ -1,38 +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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class CapabilitiesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"properties\":{\"publisher\":\"icccn\",\"targetType\":\"huexmk\",\"description\":\"lstvlzywe\",\"parametersSchema\":\"zrncsdt\",\"urn\":\"u\"},\"id\":\"iypbsfgytgusl\",\"name\":\"eadcygqukyhejhz\",\"type\":\"sx\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.capabilities() - .list("iyylhalnswhccsp", "kaivwit", "scywuggwoluhc", "bwemhairs", "rgzdwmsweyp", "w", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityInnerTests.java deleted file mode 100644 index 70b8bc2b67fb..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityInnerTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; - -public final class CapabilityInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityInner model = BinaryData.fromString( - "{\"properties\":{\"publisher\":\"mparcryuanzw\",\"targetType\":\"zdxtayrlhmwhf\",\"description\":\"rqobmtuk\",\"parametersSchema\":\"ryrtihfxtijbpzv\",\"urn\":\"wzsymglzufcy\"},\"id\":\"kohdbiha\",\"name\":\"ufhfcbjysa\",\"type\":\"ithxqhabifpi\"}") - .toObject(CapabilityInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityInner model = new CapabilityInner(); - model = BinaryData.fromObject(model).toObject(CapabilityInner.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityListResultTests.java deleted file mode 100644 index 67964f884b7e..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.CapabilityListResult; - -public final class CapabilityListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityListResult model = BinaryData.fromString( - "{\"value\":[{\"properties\":{\"publisher\":\"vgjxpybczm\",\"targetType\":\"mtz\",\"description\":\"bsphrupidgsybbe\",\"parametersSchema\":\"ph\",\"urn\":\"cmsxaobhdxbm\"},\"id\":\"qioqjzehtbmu\",\"name\":\"p\",\"type\":\"wnoi\"},{\"properties\":{\"publisher\":\"rxybqsoq\",\"targetType\":\"gkdmb\",\"description\":\"zlobcufpd\",\"parametersSchema\":\"rbt\",\"urn\":\"qjnqglhqgnufoooj\"},\"id\":\"wifsq\",\"name\":\"saagdf\",\"type\":\"glzlhjxrifkwmrv\"},{\"properties\":{\"publisher\":\"zntocipaouajps\",\"targetType\":\"cmpoyfdkfogkny\",\"description\":\"ofjdde\",\"parametersSchema\":\"rd\",\"urn\":\"pewnw\"},\"id\":\"eitjz\",\"name\":\"flusarhmof\",\"type\":\"qhsmyurkdtml\"}],\"nextLink\":\"ekuksjtx\"}") - .toObject(CapabilityListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityListResult model = new CapabilityListResult(); - model = BinaryData.fromObject(model).toObject(CapabilityListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityPropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityPropertiesTests.java deleted file mode 100644 index 0fcdc6236f37..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityPropertiesTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityProperties; - -public final class CapabilityPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityProperties model = BinaryData.fromString( - "{\"publisher\":\"wczbys\",\"targetType\":\"pqxu\",\"description\":\"vyq\",\"parametersSchema\":\"wby\",\"urn\":\"k\"}") - .toObject(CapabilityProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityProperties model = new CapabilityProperties(); - model = BinaryData.fromObject(model).toObject(CapabilityProperties.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeInnerTests.java deleted file mode 100644 index 86ef79b9b254..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import org.junit.jupiter.api.Assertions; - -public final class CapabilityTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityTypeInner model = BinaryData.fromString( - "{\"location\":\"huticndvkao\",\"properties\":{\"publisher\":\"i\",\"targetType\":\"yhxhu\",\"displayName\":\"k\",\"description\":\"yxolniwp\",\"parametersSchema\":\"ukjfkgiawxklr\",\"urn\":\"lwckbasyypnddhs\",\"kind\":\"bacphejko\",\"azureRbacActions\":[\"qgoulznd\",\"i\",\"wyqkgfgibm\"],\"azureRbacDataActions\":[\"akeqs\",\"xybz\"],\"runtimeProperties\":{\"kind\":\"dqytbciqfouflmm\"}},\"id\":\"kzsmodm\",\"name\":\"lougpbkw\",\"type\":\"mutduqktaps\"}") - .toObject(CapabilityTypeInner.class); - Assertions.assertEquals("huticndvkao", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityTypeInner model = new CapabilityTypeInner().withLocation("huticndvkao"); - model = BinaryData.fromObject(model).toObject(CapabilityTypeInner.class); - Assertions.assertEquals("huticndvkao", model.location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeListResultTests.java deleted file mode 100644 index f217bc572f4c..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.CapabilityTypeListResult; - -public final class CapabilityTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"jgrtfwvukxga\",\"properties\":{\"publisher\":\"cs\",\"targetType\":\"s\",\"displayName\":\"nyejhkryhtnap\",\"description\":\"wlokjyem\",\"parametersSchema\":\"vnipjox\",\"urn\":\"nchgej\",\"kind\":\"odmailzyd\",\"azureRbacActions\":[\"jwyahuxinpmqnja\"],\"azureRbacDataActions\":[\"xj\",\"prozvcputegjvwmf\",\"atscmd\",\"pjhulsuuvmkj\"],\"runtimeProperties\":{\"kind\":\"rwfndiod\"}},\"id\":\"pslwejdpvw\",\"name\":\"yoqpsoaccta\",\"type\":\"akl\"},{\"location\":\"hbcryffdfdosyge\",\"properties\":{\"publisher\":\"ojakhmsbzjhcrze\",\"targetType\":\"phlxa\",\"displayName\":\"thqt\",\"description\":\"qjbpfzfsin\",\"parametersSchema\":\"v\",\"urn\":\"jrwzox\",\"kind\":\"tfell\",\"azureRbacActions\":[\"zitonpeqfpjkjl\",\"ofpdvh\"],\"azureRbacDataActions\":[\"xypininmayhuybbk\",\"odepoogin\",\"vamih\"],\"runtimeProperties\":{\"kind\":\"narxzxtheotus\"}},\"id\":\"vyevcciqi\",\"name\":\"nhungbw\",\"type\":\"zrnf\"},{\"location\":\"gispemvtzfkufubl\",\"properties\":{\"publisher\":\"xqeofjaeqjhqjba\",\"targetType\":\"msmjqulngsntn\",\"displayName\":\"bkzgcwrwclx\",\"description\":\"rljdouskcqv\",\"parametersSchema\":\"cr\",\"urn\":\"dkwt\",\"kind\":\"xbnjbiksq\",\"azureRbacActions\":[\"ssainqpjwnzll\",\"fmppe\"],\"azureRbacDataActions\":[\"mgxsab\",\"yqduujit\"],\"runtimeProperties\":{\"kind\":\"zdzevndh\"}},\"id\":\"rwpdappdsbdkvwrw\",\"name\":\"feusnhut\",\"type\":\"eltmrldhugjzzdat\"}],\"nextLink\":\"hocdgeab\"}") - .toObject(CapabilityTypeListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityTypeListResult model = new CapabilityTypeListResult(); - model = BinaryData.fromObject(model).toObject(CapabilityTypeListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesRuntimePropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesRuntimePropertiesTests.java deleted file mode 100644 index 4d7aa0103811..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesRuntimePropertiesTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.CapabilityTypePropertiesRuntimeProperties; - -public final class CapabilityTypePropertiesRuntimePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityTypePropertiesRuntimeProperties model = BinaryData.fromString("{\"kind\":\"uhmuouqfprwzwbn\"}") - .toObject(CapabilityTypePropertiesRuntimeProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityTypePropertiesRuntimeProperties model = new CapabilityTypePropertiesRuntimeProperties(); - model = BinaryData.fromObject(model).toObject(CapabilityTypePropertiesRuntimeProperties.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesTests.java deleted file mode 100644 index 5d7b16915c7b..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesTests.java +++ /dev/null @@ -1,33 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeProperties; -import com.azure.resourcemanager.chaos.models.CapabilityTypePropertiesRuntimeProperties; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class CapabilityTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - CapabilityTypeProperties model = BinaryData.fromString( - "{\"publisher\":\"gcue\",\"targetType\":\"umkdosvqwhbmd\",\"displayName\":\"bjf\",\"description\":\"gmbmbexppbh\",\"parametersSchema\":\"qrolfpf\",\"urn\":\"algbquxigjyjg\",\"kind\":\"aoyfhrtxilnerkuj\",\"azureRbacActions\":[\"l\",\"juvf\",\"awrlyx\"],\"azureRbacDataActions\":[\"cpr\",\"nwbxgjvtbvpyssz\"],\"runtimeProperties\":{\"kind\":\"uj\"}}") - .toObject(CapabilityTypeProperties.class); - Assertions.assertEquals("l", model.azureRbacActions().get(0)); - Assertions.assertEquals("cpr", model.azureRbacDataActions().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - CapabilityTypeProperties model - = new CapabilityTypeProperties().withAzureRbacActions(Arrays.asList("l", "juvf", "awrlyx")) - .withAzureRbacDataActions(Arrays.asList("cpr", "nwbxgjvtbvpyssz")) - .withRuntimeProperties(new CapabilityTypePropertiesRuntimeProperties()); - model = BinaryData.fromObject(model).toObject(CapabilityTypeProperties.class); - Assertions.assertEquals("l", model.azureRbacActions().get(0)); - Assertions.assertEquals("cpr", model.azureRbacDataActions().get(0)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetWithResponseMockTests.java deleted file mode 100644 index 4098a3ce7ef4..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.CapabilityType; -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 CapabilityTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"k\",\"properties\":{\"publisher\":\"pbqpcrfkbwccsn\",\"targetType\":\"cdwxlpq\",\"displayName\":\"ftnkhtj\",\"description\":\"i\",\"parametersSchema\":\"wfqatmtd\",\"urn\":\"mdvy\",\"kind\":\"ikdgszywkbir\",\"azureRbacActions\":[\"zh\",\"hkjoqr\",\"qqaatjinrvgou\"],\"azureRbacDataActions\":[\"iibfggj\",\"ool\",\"rwxkvtkkgl\",\"qwjygvja\"],\"runtimeProperties\":{\"kind\":\"lmhvkzuhbxv\"}},\"id\":\"yhgsopbyrqufe\",\"name\":\"xuvw\",\"type\":\"fbn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - CapabilityType response = manager.capabilityTypes() - .getWithResponse("celve", "rypqlmfeo", "erqwkyhkobopg", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("k", response.location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListMockTests.java deleted file mode 100644 index 853ccb58bb5e..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListMockTests.java +++ /dev/null @@ -1,39 +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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.CapabilityType; -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 CapabilityTypesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"hahhxvrhmzkwpj\",\"properties\":{\"publisher\":\"spughftqsxhq\",\"targetType\":\"j\",\"displayName\":\"kndxdigrjgu\",\"description\":\"zdmsyqtfi\",\"parametersSchema\":\"hbotzingamvppho\",\"urn\":\"qzudphq\",\"kind\":\"vdkfwynwcvtbvk\",\"azureRbacActions\":[\"mtnvyq\",\"atkzwpcnpw\"],\"azureRbacDataActions\":[\"a\",\"sgvvsccyajguq\",\"hwyg\"],\"runtimeProperties\":{\"kind\":\"dnkfx\"}},\"id\":\"semdwzrmu\",\"name\":\"apfcqdpsq\",\"type\":\"qvpsvuoymg\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.capabilityTypes() - .list("jagrqmqhldvr", "iiojnal", "hfkvtvsexsowuel", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("hahhxvrhmzkwpj", response.iterator().next().location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentActionTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentActionTests.java deleted file mode 100644 index b68fefea7b58..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentActionTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosExperimentAction; -import org.junit.jupiter.api.Assertions; - -public final class ChaosExperimentActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosExperimentAction model - = BinaryData.fromString("{\"type\":\"ChaosExperimentAction\",\"name\":\"nrjawgqwg\"}") - .toObject(ChaosExperimentAction.class); - Assertions.assertEquals("nrjawgqwg", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosExperimentAction model = new ChaosExperimentAction().withName("nrjawgqwg"); - model = BinaryData.fromObject(model).toObject(ChaosExperimentAction.class); - Assertions.assertEquals("nrjawgqwg", model.name()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentBranchTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentBranchTests.java deleted file mode 100644 index 5cfee040ba42..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentBranchTests.java +++ /dev/null @@ -1,33 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosExperimentAction; -import com.azure.resourcemanager.chaos.models.ChaosExperimentBranch; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosExperimentBranchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosExperimentBranch model = BinaryData.fromString( - "{\"name\":\"ovbvmeueciv\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"zceuojgjrw\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"ueiotwmcdyt\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"x\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"it\"}]}") - .toObject(ChaosExperimentBranch.class); - Assertions.assertEquals("ovbvmeueciv", model.name()); - Assertions.assertEquals("zceuojgjrw", model.actions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosExperimentBranch model = new ChaosExperimentBranch().withName("ovbvmeueciv") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("zceuojgjrw"), - new ChaosExperimentAction().withName("ueiotwmcdyt"), new ChaosExperimentAction().withName("x"), - new ChaosExperimentAction().withName("it"))); - model = BinaryData.fromObject(model).toObject(ChaosExperimentBranch.class); - Assertions.assertEquals("ovbvmeueciv", model.name()); - Assertions.assertEquals("zceuojgjrw", model.actions().get(0).name()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentStepTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentStepTests.java deleted file mode 100644 index d90372a6000f..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosExperimentStepTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosExperimentAction; -import com.azure.resourcemanager.chaos.models.ChaosExperimentBranch; -import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosExperimentStepTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosExperimentStep model = BinaryData.fromString( - "{\"name\":\"bnbbeldawkz\",\"branches\":[{\"name\":\"liourqhak\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"hashsfwxosow\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"xcug\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"cjooxdjebwpucwwf\"}]}]}") - .toObject(ChaosExperimentStep.class); - Assertions.assertEquals("bnbbeldawkz", model.name()); - Assertions.assertEquals("liourqhak", model.branches().get(0).name()); - Assertions.assertEquals("hashsfwxosow", model.branches().get(0).actions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosExperimentStep model = new ChaosExperimentStep().withName("bnbbeldawkz") - .withBranches(Arrays.asList(new ChaosExperimentBranch().withName("liourqhak") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("hashsfwxosow"), - new ChaosExperimentAction().withName("xcug"), - new ChaosExperimentAction().withName("cjooxdjebwpucwwf"))))); - model = BinaryData.fromObject(model).toObject(ChaosExperimentStep.class); - Assertions.assertEquals("bnbbeldawkz", model.name()); - Assertions.assertEquals("liourqhak", model.branches().get(0).name()); - Assertions.assertEquals("hashsfwxosow", model.branches().get(0).actions().get(0).name()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetFilterTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetFilterTests.java deleted file mode 100644 index 38099d620262..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetFilterTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; - -public final class ChaosTargetFilterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetFilter model - = BinaryData.fromString("{\"type\":\"ChaosTargetFilter\"}").toObject(ChaosTargetFilter.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetFilter model = new ChaosTargetFilter(); - model = BinaryData.fromObject(model).toObject(ChaosTargetFilter.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetListSelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetListSelectorTests.java deleted file mode 100644 index 1dedb95fec41..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetListSelectorTests.java +++ /dev/null @@ -1,39 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetListSelector; -import com.azure.resourcemanager.chaos.models.TargetReference; -import com.azure.resourcemanager.chaos.models.TargetReferenceType; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosTargetListSelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetListSelector model = BinaryData.fromString( - "{\"type\":\"List\",\"targets\":[{\"type\":\"ChaosTarget\",\"id\":\"fbtndoaong\"},{\"type\":\"ChaosTarget\",\"id\":\"cn\"},{\"type\":\"ChaosTarget\",\"id\":\"jitcjedftwwaez\"}],\"id\":\"ojvdcpzfoqo\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"opidoamciodh\":\"databxarzgszufoxci\",\"khnzbonlw\":\"datahaz\",\"dwbwhkszzcmrvexz\":\"datatoego\"}}") - .toObject(ChaosTargetListSelector.class); - Assertions.assertEquals("ojvdcpzfoqo", model.id()); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.targets().get(0).type()); - Assertions.assertEquals("fbtndoaong", model.targets().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetListSelector model = new ChaosTargetListSelector().withId("ojvdcpzfoqo") - .withFilter(new ChaosTargetFilter()) - .withTargets( - Arrays.asList(new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("fbtndoaong"), - new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("cn"), - new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("jitcjedftwwaez"))); - model = BinaryData.fromObject(model).toObject(ChaosTargetListSelector.class); - Assertions.assertEquals("ojvdcpzfoqo", model.id()); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.targets().get(0).type()); - Assertions.assertEquals("fbtndoaong", model.targets().get(0).id()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetQuerySelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetQuerySelectorTests.java deleted file mode 100644 index 4766f3644130..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetQuerySelectorTests.java +++ /dev/null @@ -1,35 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetQuerySelector; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosTargetQuerySelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetQuerySelector model = BinaryData.fromString( - "{\"type\":\"Query\",\"queryString\":\"gsfraoyzkoow\",\"subscriptionIds\":[\"mnguxawqaldsyu\",\"ximerqfobwyznk\"],\"id\":\"ykutwpf\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"r\":\"datam\",\"kkze\":\"datakdsnfdsdoakgtdl\",\"sdsttwvog\":\"datadlhewp\",\"akufgmjz\":\"databbejdcngqqm\"}}") - .toObject(ChaosTargetQuerySelector.class); - Assertions.assertEquals("ykutwpf", model.id()); - Assertions.assertEquals("gsfraoyzkoow", model.queryString()); - Assertions.assertEquals("mnguxawqaldsyu", model.subscriptionIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetQuerySelector model = new ChaosTargetQuerySelector().withId("ykutwpf") - .withFilter(new ChaosTargetFilter()) - .withQueryString("gsfraoyzkoow") - .withSubscriptionIds(Arrays.asList("mnguxawqaldsyu", "ximerqfobwyznk")); - model = BinaryData.fromObject(model).toObject(ChaosTargetQuerySelector.class); - Assertions.assertEquals("ykutwpf", model.id()); - Assertions.assertEquals("gsfraoyzkoow", model.queryString()); - Assertions.assertEquals("mnguxawqaldsyu", model.subscriptionIds().get(0)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSelectorTests.java deleted file mode 100644 index ffe2ce68ee08..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSelectorTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ChaosTargetSelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetSelector model = BinaryData.fromString( - "{\"type\":\"ChaosTargetSelector\",\"id\":\"hniskxfbkpyc\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"auwhvylwzbtdhx\":\"datandnhj\",\"pow\":\"datajznb\"}}") - .toObject(ChaosTargetSelector.class); - Assertions.assertEquals("hniskxfbkpyc", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetSelector model = new ChaosTargetSelector().withId("hniskxfbkpyc") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")); - model = BinaryData.fromObject(model).toObject(ChaosTargetSelector.class); - Assertions.assertEquals("hniskxfbkpyc", model.id()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterParametersTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterParametersTests.java deleted file mode 100644 index ab2b8f26f74e..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterParametersTests.java +++ /dev/null @@ -1,28 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetSimpleFilterParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosTargetSimpleFilterParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetSimpleFilterParameters model - = BinaryData.fromString("{\"zones\":[\"iuiefozbhdmsm\",\"mzqhoftrmaequi\",\"hxicslfaoqz\"]}") - .toObject(ChaosTargetSimpleFilterParameters.class); - Assertions.assertEquals("iuiefozbhdmsm", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetSimpleFilterParameters model = new ChaosTargetSimpleFilterParameters() - .withZones(Arrays.asList("iuiefozbhdmsm", "mzqhoftrmaequi", "hxicslfaoqz")); - model = BinaryData.fromObject(model).toObject(ChaosTargetSimpleFilterParameters.class); - Assertions.assertEquals("iuiefozbhdmsm", model.zones().get(0)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterTests.java deleted file mode 100644 index c3342cf46e96..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ChaosTargetSimpleFilterTests.java +++ /dev/null @@ -1,29 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ChaosTargetSimpleFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetSimpleFilterParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class ChaosTargetSimpleFilterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ChaosTargetSimpleFilter model = BinaryData - .fromString("{\"type\":\"Simple\",\"parameters\":{\"zones\":[\"grtwae\",\"u\",\"zkopb\",\"inrfdwoyu\"]}}") - .toObject(ChaosTargetSimpleFilter.class); - Assertions.assertEquals("grtwae", model.parameters().zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ChaosTargetSimpleFilter model = new ChaosTargetSimpleFilter().withParameters( - new ChaosTargetSimpleFilterParameters().withZones(Arrays.asList("grtwae", "u", "zkopb", "inrfdwoyu"))); - model = BinaryData.fromObject(model).toObject(ChaosTargetSimpleFilter.class); - Assertions.assertEquals("grtwae", model.parameters().zones().get(0)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/DelayActionTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/DelayActionTests.java deleted file mode 100644 index 57169a3935a1..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/DelayActionTests.java +++ /dev/null @@ -1,28 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.DelayAction; -import java.time.Duration; -import org.junit.jupiter.api.Assertions; - -public final class DelayActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - DelayAction model = BinaryData.fromString("{\"type\":\"delay\",\"duration\":\"PT67H42M31S\",\"name\":\"mz\"}") - .toObject(DelayAction.class); - Assertions.assertEquals("mz", model.name()); - Assertions.assertEquals(Duration.parse("PT67H42M31S"), model.duration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelayAction model = new DelayAction().withName("mz").withDuration(Duration.parse("PT67H42M31S")); - model = BinaryData.fromObject(model).toObject(DelayAction.class); - Assertions.assertEquals("mz", model.name()); - Assertions.assertEquals(Duration.parse("PT67H42M31S"), model.duration()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsInnerTests.java deleted file mode 100644 index 670c59416742..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsInnerTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; - -public final class ExperimentExecutionDetailsInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionDetailsInner model = BinaryData.fromString( - "{\"type\":\"tfdygpfqb\",\"id\":\"ceopzfqrhhuaopp\",\"name\":\"qeqxo\",\"properties\":{\"failureReason\":\"ahzxctobgbk\",\"lastActionAt\":\"2021-03-02T22:54:24Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"stmgrcfbunrmfqjh\",\"stepId\":\"xbpvjymjhx\",\"status\":\"yngudivk\",\"branches\":[{},{}]},{\"stepName\":\"bxqz\",\"stepId\":\"zjf\",\"status\":\"vjfdx\",\"branches\":[{},{}]},{\"stepName\":\"tvtc\",\"stepId\":\"qtdo\",\"status\":\"cbxvwvxyslqbh\",\"branches\":[{},{},{}]},{\"stepName\":\"blytk\",\"stepId\":\"mpew\",\"status\":\"fbkrvrnsvs\",\"branches\":[{},{}]}]},\"status\":\"hxcr\",\"startedAt\":\"2020-12-28T12:25:09Z\",\"stoppedAt\":\"2021-11-28T02:47:56Z\"}}") - .toObject(ExperimentExecutionDetailsInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionDetailsInner model = new ExperimentExecutionDetailsInner(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionDetailsInner.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesRunInformationTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesRunInformationTests.java deleted file mode 100644 index f87544138491..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesRunInformationTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; - -public final class ExperimentExecutionDetailsPropertiesRunInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionDetailsPropertiesRunInformation model = BinaryData.fromString( - "{\"steps\":[{\"stepName\":\"efuzmuvpbttd\",\"stepId\":\"orppxebmnzbtb\",\"status\":\"pglkf\",\"branches\":[{\"branchName\":\"neuelfphsdyhtoz\",\"branchId\":\"kd\",\"status\":\"wq\",\"actions\":[{}]},{\"branchName\":\"zx\",\"branchId\":\"vithh\",\"status\":\"o\",\"actions\":[{}]},{\"branchName\":\"gbhcohfwdsj\",\"branchId\":\"aljutiiswac\",\"status\":\"gdkz\",\"actions\":[{},{},{},{}]}]},{\"stepName\":\"fvhqc\",\"stepId\":\"ilvpnppfuflrwd\",\"status\":\"dlxyjrxs\",\"branches\":[{\"branchName\":\"cnihgwqapnedgfbc\",\"branchId\":\"cvqvpkeqdcv\",\"status\":\"hvoodsotbobzd\",\"actions\":[{},{}]},{\"branchName\":\"wvnhdldwmgx\",\"branchId\":\"rslpmutwuoeg\",\"status\":\"khjwn\",\"actions\":[{},{}]}]}]}") - .toObject(ExperimentExecutionDetailsPropertiesRunInformation.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionDetailsPropertiesRunInformation model - = new ExperimentExecutionDetailsPropertiesRunInformation(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionDetailsPropertiesRunInformation.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesTests.java deleted file mode 100644 index a4e513fabb73..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsProperties; - -public final class ExperimentExecutionDetailsPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionDetailsProperties model = BinaryData.fromString( - "{\"failureReason\":\"srruvwbhsqfsubcg\",\"lastActionAt\":\"2021-02-04T22:06:27Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"ybsrfbjfdtwss\",\"stepId\":\"ftpvjzbexil\",\"status\":\"nfqqnvwp\",\"branches\":[{\"branchName\":\"ruoujmk\",\"branchId\":\"hwqytj\",\"status\":\"bnw\",\"actions\":[{},{},{},{}]},{\"branchName\":\"drjervnaenqpehin\",\"branchId\":\"ygmi\",\"status\":\"hnzdndslgnayqi\",\"actions\":[{},{},{},{}]},{\"branchName\":\"uhavhql\",\"branchId\":\"humaqolbgyc\",\"status\":\"iertgccymvaolp\",\"actions\":[{},{}]}]},{\"stepName\":\"lfmmdnbbglzpswi\",\"stepId\":\"mcwyhzdxssadb\",\"status\":\"nvdfznuda\",\"branches\":[{\"branchName\":\"zbn\",\"branchId\":\"lylpstdb\",\"status\":\"xsrz\",\"actions\":[{},{},{},{}]},{\"branchName\":\"erscdntne\",\"branchId\":\"iwjmygtdssls\",\"status\":\"mweriofzpy\",\"actions\":[{},{}]}]},{\"stepName\":\"wab\",\"stepId\":\"tshhszhedp\",\"status\":\"wiwubm\",\"branches\":[{\"branchName\":\"sldnkwwtppjflcxo\",\"branchId\":\"okonzmnsikvmkqz\",\"status\":\"qkdltfz\",\"actions\":[{}]},{\"branchName\":\"v\",\"branchId\":\"ur\",\"status\":\"dkwobdagx\",\"actions\":[{},{}]},{\"branchName\":\"dxbx\",\"branchId\":\"kbogqxndlkzgx\",\"status\":\"ripl\",\"actions\":[{},{}]},{\"branchName\":\"xunkbebxmubyynt\",\"branchId\":\"rbqtkoie\",\"status\":\"eotg\",\"actions\":[{}]}]}]},\"status\":\"tmuwlauwzi\",\"startedAt\":\"2021-01-24T11:46:23Z\",\"stoppedAt\":\"2021-03-14T00:48:06Z\"}") - .toObject(ExperimentExecutionDetailsProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionDetailsProperties model = new ExperimentExecutionDetailsProperties(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionDetailsProperties.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionInnerTests.java deleted file mode 100644 index bf0ce793e286..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionInnerTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionInner; - -public final class ExperimentExecutionInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionInner model = BinaryData.fromString( - "{\"type\":\"tpnapnyiropuhpig\",\"id\":\"gylgqgitxmedjvcs\",\"name\":\"n\",\"properties\":{\"status\":\"ncw\",\"startedAt\":\"2021-09-15T03:16:23Z\",\"stoppedAt\":\"2021-03-30T03:40:31Z\"}}") - .toObject(ExperimentExecutionInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionInner model = new ExperimentExecutionInner(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionInner.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionListResultTests.java deleted file mode 100644 index beee7877c53c..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionListResult; - -public final class ExperimentExecutionListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionListResult model = BinaryData.fromString( - "{\"value\":[{\"type\":\"nojvknmefqsg\",\"id\":\"ah\",\"name\":\"jyzhpvgq\",\"properties\":{\"status\":\"rvxdjzlmw\",\"startedAt\":\"2021-07-11T22:18:52Z\",\"stoppedAt\":\"2021-11-03T14:53:04Z\"}},{\"type\":\"hzovawjvzunlut\",\"id\":\"n\",\"name\":\"nxipeil\",\"properties\":{\"status\":\"uaejxdultsk\",\"startedAt\":\"2021-11-26T08:31:17Z\",\"stoppedAt\":\"2021-05-16T15:29:03Z\"}},{\"type\":\"umveekgpwozuhkf\",\"id\":\"sjyofdx\",\"name\":\"us\",\"properties\":{\"status\":\"ouwaboekqvkeln\",\"startedAt\":\"2021-02-02T03:25:54Z\",\"stoppedAt\":\"2020-12-28T23:28:21Z\"}},{\"type\":\"yjsflhhcaalnji\",\"id\":\"sxyawjoyaqcs\",\"name\":\"jpkiidzyexznelix\",\"properties\":{\"status\":\"ztfolhbnxk\",\"startedAt\":\"2021-03-24T05:03:40Z\",\"stoppedAt\":\"2021-09-05T19:55:42Z\"}}],\"nextLink\":\"ppg\"}") - .toObject(ExperimentExecutionListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionListResult model = new ExperimentExecutionListResult(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionPropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionPropertiesTests.java deleted file mode 100644 index 437ca93c39f9..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionPropertiesTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionProperties; - -public final class ExperimentExecutionPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionProperties model = BinaryData.fromString( - "{\"status\":\"trmgucnapkte\",\"startedAt\":\"2021-08-31T01:54:16Z\",\"stoppedAt\":\"2021-11-12T01:15:19Z\"}") - .toObject(ExperimentExecutionProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionProperties model = new ExperimentExecutionProperties(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionProperties.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java deleted file mode 100644 index 2fdfc8cf4d3a..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java +++ /dev/null @@ -1,99 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.azure.resourcemanager.chaos.models.ChaosExperimentAction; -import com.azure.resourcemanager.chaos.models.ChaosExperimentBranch; -import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExperimentInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentInner model = BinaryData.fromString( - "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"hagalpbuxwgipwh\":{\"principalId\":\"8d1c83f6-bb6f-4afb-b698-ff6156fab49d\",\"clientId\":\"c4646ac2-ff91-4f5e-bb01-4bd0a0d8b768\"}},\"principalId\":\"ow\",\"tenantId\":\"shwankixzbinje\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"steps\":[{\"name\":\"mryw\",\"branches\":[{\"name\":\"zoqftiyqzrnkcqvy\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"whzlsicohoq\"}]},{\"name\":\"nwvlryavwhheunmm\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"gyxzk\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"noc\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"koklya\"}]}]},{\"name\":\"uconuqszfkbey\",\"branches\":[{\"name\":\"wrmjmwvvjektc\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"enhwlrs\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"frzpwvlqdqgb\"}]},{\"name\":\"qylihkaetckt\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"civfsnkymuctq\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"jf\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"ebrjcxe\"}]},{\"name\":\"fuwutttxf\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"rbirphxe\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"c\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"vahfn\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"jky\"}]},{\"name\":\"xjvuujqgidokg\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"jyoxgvclt\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"gsncghkjeszz\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"bijhtxfvgxbf\"}]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"xnehmpvec\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"ukgri\":\"dataebfqkkrbm\",\"fbxzpuzycisp\":\"dataflz\",\"y\":\"dataqzahmgkbrp\",\"rgvtqag\":\"datahibnuqqkpika\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"buynhijggm\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"zmhjrunmp\":\"dataiarbutrcvpna\",\"nkxmyskpbhenbtk\":\"datattdbhrbnl\",\"yxczfclh\":\"dataxywnytnrsynlqidy\"}}]},\"location\":\"axdbabph\",\"tags\":{\"cocmnyyaztt\":\"qlfktsths\",\"edckzywbiexzfey\":\"twwrqp\",\"ujwb\":\"eaxib\",\"zjancuxr\":\"qwalmuzyoxaepd\"},\"id\":\"d\",\"name\":\"bavxbniwdjswzt\",\"type\":\"dbpgnxytxhp\"}") - .toObject(ExperimentInner.class); - Assertions.assertEquals("axdbabph", model.location()); - Assertions.assertEquals("qlfktsths", model.tags().get("cocmnyyaztt")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mryw", model.steps().get(0).name()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("whzlsicohoq", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("xnehmpvec", model.selectors().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentInner model = new ExperimentInner().withLocation("axdbabph") - .withTags(mapOf("cocmnyyaztt", "qlfktsths", "edckzywbiexzfey", "twwrqp", "ujwb", "eaxib", "zjancuxr", - "qwalmuzyoxaepd")) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("hagalpbuxwgipwh", new UserAssignedIdentity()))) - .withSteps(Arrays.asList( - new ChaosExperimentStep().withName("mryw") - .withBranches(Arrays - .asList(new ChaosExperimentBranch().withName("zoqftiyqzrnkcqvy") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("whzlsicohoq"))), - new ChaosExperimentBranch().withName("nwvlryavwhheunmm") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("gyxzk"), - new ChaosExperimentAction().withName("noc"), - new ChaosExperimentAction().withName("koklya"))))), - new ChaosExperimentStep().withName("uconuqszfkbey") - .withBranches(Arrays.asList( - new ChaosExperimentBranch().withName("wrmjmwvvjektc") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("enhwlrs"), - new ChaosExperimentAction().withName("frzpwvlqdqgb"))), - new ChaosExperimentBranch().withName("qylihkaetckt") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("civfsnkymuctq"), - new ChaosExperimentAction().withName("jf"), - new ChaosExperimentAction().withName("ebrjcxe"))), - new ChaosExperimentBranch().withName("fuwutttxf") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("rbirphxe"), - new ChaosExperimentAction().withName("c"), - new ChaosExperimentAction().withName("vahfn"), - new ChaosExperimentAction().withName("jky"))), - new ChaosExperimentBranch().withName("xjvuujqgidokg") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("jyoxgvclt"), - new ChaosExperimentAction().withName("gsncghkjeszz"), - new ChaosExperimentAction().withName("bijhtxfvgxbf"))))))) - .withSelectors(Arrays.asList( - new ChaosTargetSelector().withId("xnehmpvec") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")), - new ChaosTargetSelector().withId("buynhijggm") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")))); - model = BinaryData.fromObject(model).toObject(ExperimentInner.class); - Assertions.assertEquals("axdbabph", model.location()); - Assertions.assertEquals("qlfktsths", model.tags().get("cocmnyyaztt")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - Assertions.assertEquals("mryw", model.steps().get(0).name()); - Assertions.assertEquals("zoqftiyqzrnkcqvy", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("whzlsicohoq", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("xnehmpvec", model.selectors().get(0).id()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentListResultTests.java deleted file mode 100644 index 90576652d579..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentListResult; - -public final class ExperimentListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentListResult model = BinaryData.fromString( - "{\"value\":[{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"a\":{\"principalId\":\"c3a7114c-7ae0-4582-8b6e-3f3120512029\",\"clientId\":\"50764e84-912c-4147-ab13-95a139e09223\"},\"fizuckyf\":{\"principalId\":\"b1c4a920-19fd-40ee-b9a3-380b06969a8d\",\"clientId\":\"1705dd63-ea27-4656-b92c-2d915603521f\"}},\"principalId\":\"rfidfvzwdz\",\"tenantId\":\"tymw\"},\"properties\":{\"provisioningState\":\"Updating\",\"steps\":[{\"name\":\"fthwxmnteiwa\",\"branches\":[{\"name\":\"vkmijcmmxdcuf\",\"actions\":[]},{\"name\":\"fsrpymzidnse\",\"actions\":[]},{\"name\":\"cxtbzsg\",\"actions\":[]},{\"name\":\"yc\",\"actions\":[]}]},{\"name\":\"sne\",\"branches\":[{\"name\":\"dwzjeiach\",\"actions\":[]},{\"name\":\"oosflnr\",\"actions\":[]},{\"name\":\"sfqpteehz\",\"actions\":[]},{\"name\":\"vypyqrimzinpv\",\"actions\":[]}]},{\"name\":\"wjdk\",\"branches\":[{\"name\":\"soodqxhcrmnoh\",\"actions\":[]},{\"name\":\"t\",\"actions\":[]},{\"name\":\"kwh\",\"actions\":[]},{\"name\":\"soifiyipjxsqw\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"rjb\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"mocpc\":\"datacjxvsnbyxqab\",\"c\":\"datashurzafbljjgpbto\",\"idtqajzyu\":\"datamkljavb\",\"jkrlkhbzhfepg\":\"datapku\"}}]},\"location\":\"gqexzlocxs\",\"tags\":{\"j\":\"ierhhbcsglummaj\",\"jionpimexgstxgc\":\"odxobnbdxkqpxok\"},\"id\":\"odgmaajrmvdjwz\",\"name\":\"lovmclwhijcoe\",\"type\":\"ctbzaq\"},{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"fkgukdkexxppof\":{\"principalId\":\"5cb6679b-80f5-40d3-9384-1724d277ce29\",\"clientId\":\"de8786fc-868f-4f55-9d59-9294dfbca7b2\"},\"x\":{\"principalId\":\"217f5ebd-4903-4d31-8ebd-a295709aa94e\",\"clientId\":\"cfecce82-adc6-4d63-86a2-a836feac0c12\"},\"pg\":{\"principalId\":\"84363793-9918-4bfd-a709-9560de1bc77f\",\"clientId\":\"5489bffe-e788-4cd2-865e-f5d4387d69f7\"}},\"principalId\":\"toc\",\"tenantId\":\"xhvpmoue\"},\"properties\":{\"provisioningState\":\"Failed\",\"steps\":[{\"name\":\"xibqeojnx\",\"branches\":[{\"name\":\"zvddntwndeicbtwn\",\"actions\":[]}]},{\"name\":\"zao\",\"branches\":[{\"name\":\"uhrhcffcyddgl\",\"actions\":[]},{\"name\":\"jthjqkwpyei\",\"actions\":[]},{\"name\":\"xmqci\",\"actions\":[]},{\"name\":\"q\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"khixuigdtopbo\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"w\":\"datahm\",\"a\":\"dataa\"}}]},\"location\":\"hrzayvvtpgvdf\",\"tags\":{\"efgugnxk\":\"tkftutqxlngx\",\"hjybigehoqfbo\":\"xdqmidtthzrvqdra\",\"zlcuiywgqywgndrv\":\"skanyk\",\"ocpecfvmmco\":\"nhzgpphrcgyn\"},\"id\":\"fsxlzevgbmqjqa\",\"name\":\"c\",\"type\":\"pmivkwlzu\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"bacfionlebxetq\":{\"principalId\":\"06383709-1fd5-4c9b-9d4f-5f2543f80095\",\"clientId\":\"a33ddbbc-efab-4bca-8485-1da88928e998\"},\"xdpnqbqq\":{\"principalId\":\"fd10eea1-1e6d-4ea5-86a4-9fffd3177bb5\",\"clientId\":\"e81f1f7c-7a1b-4ca4-ae04-6a14c1e4e522\"},\"jfeallnwsub\":{\"principalId\":\"414c6587-d389-4295-a9d8-b4ddf4008fcf\",\"clientId\":\"7b7f11df-9231-4f95-902e-6df42ca3474e\"},\"jampmngnzscxaqw\":{\"principalId\":\"643ecd4b-0437-4c7e-963f-0562f40a3811\",\"clientId\":\"c74fe285-3408-4ee1-8d1f-eac7ea7f0d58\"}},\"principalId\":\"chcbonqvpkvlrxnj\",\"tenantId\":\"seiphe\"},\"properties\":{\"provisioningState\":\"Creating\",\"steps\":[{\"name\":\"keyyi\",\"branches\":[{\"name\":\"jbdlwtgrhpdjpju\",\"actions\":[]}]},{\"name\":\"asxazjpqyegualhb\",\"branches\":[{\"name\":\"hejjz\",\"actions\":[]},{\"name\":\"v\",\"actions\":[]},{\"name\":\"udgwdslfho\",\"actions\":[]}]},{\"name\":\"wmc\",\"branches\":[{\"name\":\"pwlbjnpg\",\"actions\":[]},{\"name\":\"cftadeh\",\"actions\":[]},{\"name\":\"nltyfsoppusuesnz\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"ej\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"ndnvo\":\"datarxzdmohctbqvudwx\",\"lazjdyggdtjixhbk\":\"datagujjugwdkcglh\",\"fwhybcibvy\":\"dataofqweykhmenevfye\",\"ynnaam\":\"datadcsi\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"ectehf\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"hezrkgq\":\"datajeyp\"}}]},\"location\":\"c\",\"tags\":{\"jpkcattpng\":\"fovgmkqsleyyvxy\",\"czsqpjhvm\":\"cr\"},\"id\":\"ajvnysounqe\",\"name\":\"a\",\"type\":\"oaeupfhyhltrpmo\"},{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"okth\":{\"principalId\":\"9f34e36e-4140-40dc-860f-cdf6f37d3a09\",\"clientId\":\"a675aa57-a888-4bf9-a649-8722b2c35dbe\"},\"uaodsfcpk\":{\"principalId\":\"52f16056-26b0-494a-a1ac-a663e88e36cf\",\"clientId\":\"f8a09c06-3821-4fd8-8ca3-c2ded73a5fd6\"},\"dpuozmyz\":{\"principalId\":\"cd6a09b0-f7ed-49aa-8b6d-f7bf5dd0d6b9\",\"clientId\":\"4a4f173c-82f8-4edc-8def-a716231d30aa\"}},\"principalId\":\"agfuaxbezyiu\",\"tenantId\":\"ktwh\"},\"properties\":{\"provisioningState\":\"Creating\",\"steps\":[{\"name\":\"zywqsmbsu\",\"branches\":[{\"name\":\"xim\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"yocf\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"kiiuxhqyudxor\":\"dataymddys\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"qn\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"llr\":\"datazvyifqrvkdvj\",\"xxbczwtr\":\"datavvdfwatkpnpul\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"wiqzbqjvsovmyo\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"obpxjmflbvvn\":\"datapkwlhz\",\"ciwwzjuqkhr\":\"datahrk\",\"oskg\":\"dataajiwkuo\",\"vxieduugidyj\":\"datasauuimj\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"rfbyaosvexcso\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"eggzfb\":\"datahocohslkev\",\"ithlvmezyvshxm\":\"datahfmvfaxkffe\",\"gigr\":\"datasbbzo\"}}]},\"location\":\"wburvjxxjnspydpt\",\"tags\":{\"udwtiukbl\":\"nkoukn\",\"o\":\"ngkpocipazy\",\"ntypmrbpizcdrqj\":\"gukgjnpiucgygevq\"},\"id\":\"dpydn\",\"name\":\"yhxdeoejzicwi\",\"type\":\"sjttgzfbish\"}],\"nextLink\":\"khaj\"}") - .toObject(ExperimentListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentListResult model = new ExperimentListResult(); - model = BinaryData.fromObject(model).toObject(ExperimentListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentPropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentPropertiesTests.java deleted file mode 100644 index 4fcccf3fdd4e..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentPropertiesTests.java +++ /dev/null @@ -1,91 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentProperties; -import com.azure.resourcemanager.chaos.models.ChaosExperimentAction; -import com.azure.resourcemanager.chaos.models.ChaosExperimentBranch; -import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExperimentPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentProperties model = BinaryData.fromString( - "{\"provisioningState\":\"Creating\",\"steps\":[{\"name\":\"mg\",\"branches\":[{\"name\":\"nkjzkdeslpvlop\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"yighxpk\"}]},{\"name\":\"wzbaiue\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"a\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"m\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"yqupedeojnabckh\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"mtxpsiebtfh\"}]},{\"name\":\"pesapskrdqmhjj\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"tldwkyzxuutk\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"cwscwsvlx\"}]}]},{\"name\":\"togt\",\"branches\":[{\"name\":\"upqsx\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"micykvceoveilo\"}]},{\"name\":\"notyfjfcnjbkcn\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"hbttkphyw\"}]},{\"name\":\"nv\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"oqnermclfpl\"}]}]},{\"name\":\"hoxus\",\"branches\":[{\"name\":\"pabgyeps\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"tazqugxywpmueefj\"}]},{\"name\":\"wfqkquj\",\"actions\":[{\"type\":\"ChaosExperimentAction\",\"name\":\"suyonobglaocq\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"tcc\"},{\"type\":\"ChaosExperimentAction\",\"name\":\"g\"}]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"dxyt\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"fudwpznt\":\"datarxv\",\"hckfrlhrx\":\"datahdzhlrqj\",\"ca\":\"databkyvp\",\"b\":\"datauzbpzkafku\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"rnwb\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"srtslhspkdeem\":\"dataseyvj\",\"ahvljuaha\":\"dataofmxagkvtmelmqkr\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"uhcdhm\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"pvfadmwsrcr\":\"dataaex\",\"fmisg\":\"datavxpvgomz\"}}]}") - .toObject(ExperimentProperties.class); - Assertions.assertEquals("mg", model.steps().get(0).name()); - Assertions.assertEquals("nkjzkdeslpvlop", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("yighxpk", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("dxyt", model.selectors().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentProperties model = new ExperimentProperties() - .withSteps(Arrays.asList( - new ChaosExperimentStep().withName("mg") - .withBranches(Arrays.asList( - new ChaosExperimentBranch().withName("nkjzkdeslpvlop") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("yighxpk"))), - new ChaosExperimentBranch().withName("wzbaiue") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("a"), - new ChaosExperimentAction().withName("m"), - new ChaosExperimentAction().withName("yqupedeojnabckh"), - new ChaosExperimentAction().withName("mtxpsiebtfh"))), - new ChaosExperimentBranch().withName("pesapskrdqmhjj") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("tldwkyzxuutk"), - new ChaosExperimentAction().withName("cwscwsvlx"))))), - new ChaosExperimentStep().withName("togt") - .withBranches(Arrays.asList( - new ChaosExperimentBranch().withName("upqsx") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("micykvceoveilo"))), - new ChaosExperimentBranch().withName("notyfjfcnjbkcn") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("hbttkphyw"))), - new ChaosExperimentBranch().withName("nv") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("oqnermclfpl"))))), - new ChaosExperimentStep().withName("hoxus") - .withBranches(Arrays.asList(new ChaosExperimentBranch() - .withName("pabgyeps") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("tazqugxywpmueefj"))), - new ChaosExperimentBranch().withName("wfqkquj") - .withActions(Arrays.asList(new ChaosExperimentAction().withName("suyonobglaocq"), - new ChaosExperimentAction().withName("tcc"), - new ChaosExperimentAction().withName("g"))))))) - .withSelectors(Arrays.asList( - new ChaosTargetSelector().withId("dxyt") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")), - new ChaosTargetSelector().withId("rnwb") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")), - new ChaosTargetSelector().withId("uhcdhm") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")))); - model = BinaryData.fromObject(model).toObject(ExperimentProperties.class); - Assertions.assertEquals("mg", model.steps().get(0).name()); - Assertions.assertEquals("nkjzkdeslpvlop", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("yighxpk", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("dxyt", model.selectors().get(0).id()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentUpdateTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentUpdateTests.java deleted file mode 100644 index 56869c32116b..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentUpdateTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentUpdate; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ExperimentUpdateTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentUpdate model = BinaryData.fromString( - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"veual\":{\"principalId\":\"117247fc-eaf3-474e-8848-1154b475989b\",\"clientId\":\"7d125f3b-6eaf-4db5-8b18-0d9528cb79d3\"},\"mkh\":{\"principalId\":\"d9cd11da-7cf8-4b79-a5dd-a55dd1b59aaa\",\"clientId\":\"4521f587-2320-497f-9696-3e8b9dd62318\"},\"bbcswsrtjri\":{\"principalId\":\"1326097e-0a1e-42ef-bee6-6e6eb3e533dc\",\"clientId\":\"5e5adf5f-53f4-47fb-af7f-312917eacb92\"},\"bpbewtghfgb\":{\"principalId\":\"194d2f05-0d3a-4288-9e57-34dfec4b18f1\",\"clientId\":\"5f7a5c17-8833-411f-8c88-dfe1b43a4ce3\"}},\"principalId\":\"gw\",\"tenantId\":\"vlvqhjkbegi\"},\"tags\":{\"aloayqcgwrtzju\":\"mxiebw\",\"txon\":\"gwyzm\",\"rknftguvriuhprwm\":\"mtsavjcbpwxqp\",\"bexrmcq\":\"yvxqtayriwwroy\"}}") - .toObject(ExperimentUpdate.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("mxiebw", model.tags().get("aloayqcgwrtzju")); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentUpdate model = new ExperimentUpdate().withIdentity(new ResourceIdentity() - .withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities(mapOf("veual", new UserAssignedIdentity(), "mkh", new UserAssignedIdentity(), - "bbcswsrtjri", new UserAssignedIdentity(), "bpbewtghfgb", new UserAssignedIdentity()))) - .withTags(mapOf("aloayqcgwrtzju", "mxiebw", "txon", "gwyzm", "rknftguvriuhprwm", "mtsavjcbpwxqp", "bexrmcq", - "yvxqtayriwwroy")); - model = BinaryData.fromObject(model).toObject(ExperimentUpdate.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("mxiebw", model.tags().get("aloayqcgwrtzju")); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateMockTests.java deleted file mode 100644 index 54e9feb0eaad..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateMockTests.java +++ /dev/null @@ -1,87 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ChaosExperimentBranch; -import com.azure.resourcemanager.chaos.models.ChaosExperimentStep; -import com.azure.resourcemanager.chaos.models.ChaosTargetFilter; -import com.azure.resourcemanager.chaos.models.ChaosTargetSelector; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.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 ExperimentsCreateOrUpdateMockTests { - @Test - public void testCreateOrUpdate() throws Exception { - String responseStr - = "{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"ev\":{\"principalId\":\"196a22c5-3ca0-4d98-9a32-4f14564ee6c2\",\"clientId\":\"7268a1de-b3af-4a98-8e4e-fbc5b33a81be\"},\"b\":{\"principalId\":\"f5872c29-9455-487c-b047-3307bb4b4df6\",\"clientId\":\"7cb69611-9b91-41ea-aa48-d2bdcfd9d2a0\"}},\"principalId\":\"rilbywdx\",\"tenantId\":\"icc\"},\"properties\":{\"provisioningState\":\"Succeeded\",\"steps\":[{\"name\":\"scjfnyns\",\"branches\":[{\"name\":\"ujiz\",\"actions\":[]},{\"name\":\"voqyt\",\"actions\":[]}]},{\"name\":\"byowbblgyavutp\",\"branches\":[{\"name\":\"joxoism\",\"actions\":[]},{\"name\":\"ksbpimlqoljx\",\"actions\":[]}]},{\"name\":\"cgxxlxs\",\"branches\":[{\"name\":\"gcvizqzdwlvwlyou\",\"actions\":[]},{\"name\":\"fgfb\",\"actions\":[]}]},{\"name\":\"jub\",\"branches\":[{\"name\":\"hgkfmin\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"owzfttsttkt\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"gqqqxh\":\"dataqactxtgzukxitmmq\",\"rxcpjuisavo\":\"datan\",\"ajlkatnw\":\"dataqdzfvazivjlfrqtt\"}}]},\"location\":\"yiopi\",\"tags\":{\"ovibrxkp\":\"qfkuvscxkdmli\",\"bteoybf\":\"loazuruocbgoo\"},\"id\":\"jxakv\",\"name\":\"jgslordilmyww\",\"type\":\"kgkxn\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Experiment response - = manager.experiments() - .define("yjkqabqgzslesjcb") - .withRegion("axconfozauo") - .withExistingResourceGroup("aryeu") - .withSteps(Arrays.asList(new ChaosExperimentStep().withName("ebjvewzcjzn") - .withBranches(Arrays.asList( - new ChaosExperimentBranch().withName("cpmguaadraufact").withActions(Arrays.asList()), - new ChaosExperimentBranch().withName("ahzovajjziuxxp").withActions(Arrays.asList()), - new ChaosExperimentBranch().withName("hneekul").withActions(Arrays.asList()), - new ChaosExperimentBranch().withName("gs").withActions(Arrays.asList()))))) - .withSelectors(Arrays.asList( - new ChaosTargetSelector().withId("ubkwdle") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")), - new ChaosTargetSelector().withId("ygdxpgpqchis") - .withFilter(new ChaosTargetFilter()) - .withAdditionalProperties(mapOf("type", "ChaosTargetSelector")))) - .withTags(mapOf("epzl", "kokwbqplhlvnu", "vmnnrw", "phwzsoldweyuqdu", "wjhhgdnhxmsivf", "biorktal", - "zaofjchvcyy", "miloxggdufiqndie")) - .withIdentity(new ResourceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("w", new UserAssignedIdentity(), "vbquwr", new UserAssignedIdentity()))) - .create(); - - Assertions.assertEquals("yiopi", response.location()); - Assertions.assertEquals("qfkuvscxkdmli", response.tags().get("ovibrxkp")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, response.identity().type()); - Assertions.assertEquals("scjfnyns", response.steps().get(0).name()); - Assertions.assertEquals("ujiz", response.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("owzfttsttkt", response.selectors().get(0).id()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsWithResponseMockTests.java deleted file mode 100644 index ff03eab7eb0a..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsExecutionDetailsWithResponseMockTests.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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExperimentsExecutionDetailsWithResponseMockTests { - @Test - public void testExecutionDetailsWithResponse() throws Exception { - String responseStr - = "{\"type\":\"qkdlw\",\"id\":\"fbumlkx\",\"name\":\"qjfsmlmbtxhw\",\"properties\":{\"failureReason\":\"srtawcoezbr\",\"lastActionAt\":\"2021-02-21T07:03:26Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"dyg\",\"stepId\":\"okkqfqjbvleo\",\"status\":\"ml\",\"branches\":[{},{},{}]}]},\"status\":\"qzfavyv\",\"startedAt\":\"2021-03-05T04:35Z\",\"stoppedAt\":\"2021-05-23T06:21:06Z\"}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExperimentExecutionDetails response = manager.experiments() - .executionDetailsWithResponse("stgktst", "dxeclzedqbcvh", "lhpl", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupWithResponseMockTests.java deleted file mode 100644 index 55a52b752e25..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupWithResponseMockTests.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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -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 ExperimentsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - String responseStr - = "{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"opqgikyzirtxdyux\":{\"principalId\":\"11bfccb8-091b-4396-ac7f-4a3661819ad9\",\"clientId\":\"03ce86b3-7836-4d0f-941d-a3636ee0f4db\"},\"ntps\":{\"principalId\":\"fc8311c3-9c68-4898-b7e7-d8389895dd54\",\"clientId\":\"f6a5722b-3a59-4fb7-a222-66619357a1fb\"},\"ioilqukrydxtq\":{\"principalId\":\"56d3852c-c618-4166-a4a3-9d23296b57b2\",\"clientId\":\"e5a56a23-cc84-4843-9824-8fe74201885c\"},\"ox\":{\"principalId\":\"844c5723-5023-42b4-ab08-72f752953f81\",\"clientId\":\"7586d2a0-ae2f-47a2-991e-d55823b33ddf\"}},\"principalId\":\"ggufhyaomtb\",\"tenantId\":\"havgrvk\"},\"properties\":{\"provisioningState\":\"Creating\",\"steps\":[{\"name\":\"jzhpjbibgjmfx\",\"branches\":[{\"name\":\"vfcluyovwxnbkfe\",\"actions\":[]}]},{\"name\":\"zxscyhwzdgirujb\",\"branches\":[{\"name\":\"omvzzbtd\",\"actions\":[]},{\"name\":\"qvpn\",\"actions\":[]},{\"name\":\"yujviylwdshfssn\",\"actions\":[]}]},{\"name\":\"bgye\",\"branches\":[{\"name\":\"ymsgaojfmwnc\",\"actions\":[]},{\"name\":\"tmr\",\"actions\":[]},{\"name\":\"hirctymoxoftpipi\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"czuhxacpqjlihh\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"ucvpamrs\":\"dataskasdvlmfwdgzxu\",\"risjnhnytxifqjz\":\"dataeuzvx\",\"lw\":\"dataxmrhu\",\"woqhihe\":\"datacesutrgjupauut\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"qg\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"xjvfoimwksl\":\"datafqntcyp\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"rcizjxvyd\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"gdyftumrtwna\":\"datacvlhv\",\"wkojgcyztsfmzn\":\"datajslb\"}}]},\"location\":\"aeqphchqnr\",\"tags\":{\"huwrykqgaifm\":\"x\",\"jdz\":\"iklbydvkhb\",\"srhnjivo\":\"xcv\"},\"id\":\"v\",\"name\":\"novqfzge\",\"type\":\"jdftuljltd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Experiment response = manager.experiments() - .getByResourceGroupWithResponse("z", "ybycnunvj", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("aeqphchqnr", response.location()); - Assertions.assertEquals("x", response.tags().get("huwrykqgaifm")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("jzhpjbibgjmfx", response.steps().get(0).name()); - Assertions.assertEquals("vfcluyovwxnbkfe", response.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("czuhxacpqjlihh", response.selectors().get(0).id()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionWithResponseMockTests.java deleted file mode 100644 index d0bc0dd2502e..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionWithResponseMockTests.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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentExecution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExperimentsGetExecutionWithResponseMockTests { - @Test - public void testGetExecutionWithResponse() throws Exception { - String responseStr - = "{\"type\":\"ripltf\",\"id\":\"tbaxk\",\"name\":\"ywrckp\",\"properties\":{\"status\":\"yhpluodpvruudlgz\",\"startedAt\":\"2021-07-04T20:01:35Z\",\"stoppedAt\":\"2021-04-27T04:41:25Z\"}}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExperimentExecution response = manager.experiments() - .getExecutionWithResponse("zqljyxgtczh", "ydbsd", "hmkxmaehvbb", com.azure.core.util.Context.NONE) - .getValue(); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsMockTests.java deleted file mode 100644 index 74744b00341c..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllExecutionsMockTests.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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentExecution; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class ExperimentsListAllExecutionsMockTests { - @Test - public void testListAllExecutions() throws Exception { - String responseStr - = "{\"value\":[{\"type\":\"jw\",\"id\":\"wqiok\",\"name\":\"sx\",\"properties\":{\"status\":\"msvpkjpr\",\"startedAt\":\"2021-06-29T04:33:46Z\",\"stoppedAt\":\"2021-06-26T08:15:06Z\"}}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.experiments().listAllExecutions("ceamtm", "zuo", com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupMockTests.java deleted file mode 100644 index 7701425428b0..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupMockTests.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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -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 ExperimentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"qmt\":{\"principalId\":\"8eaacbce-e5db-4f3c-b18c-ab43594f5a98\",\"clientId\":\"c3b4b2cb-021d-40d8-a438-6a9782710eb3\"},\"tmmjihyeozph\":{\"principalId\":\"bb509049-5400-4306-a7de-2dc85ed3eb45\",\"clientId\":\"68fe29b2-59cb-47c8-82d9-3e28f564e238\"}},\"principalId\":\"auyqncygupkv\",\"tenantId\":\"mdscwxqupev\"},\"properties\":{\"provisioningState\":\"Deleting\",\"steps\":[{\"name\":\"totxhojujb\",\"branches\":[{\"name\":\"elmcuvhixbjxyfw\",\"actions\":[]},{\"name\":\"yl\",\"actions\":[]},{\"name\":\"coolsttpkiwkkb\",\"actions\":[]},{\"name\":\"ujrywvtyl\",\"actions\":[]}]},{\"name\":\"fpncurdo\",\"branches\":[{\"name\":\"iithtywu\",\"actions\":[]},{\"name\":\"xcbihw\",\"actions\":[]},{\"name\":\"knfd\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"wjchrdg\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"luudfdlwggytsb\":\"dataumwctondz\"}},{\"type\":\"ChaosTargetSelector\",\"id\":\"tov\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"ufxqknpirgnepttw\":\"dataeinqf\",\"mqnrojlpijnkr\":\"datamsniffc\",\"zronasxift\":\"datafrddhcrati\"}}]},\"location\":\"zq\",\"tags\":{\"wesgogczh\":\"f\",\"lgnyhmo\":\"nnxk\",\"h\":\"sxkkg\"},\"id\":\"rghxjb\",\"name\":\"hqxvcxgfrpdsofbs\",\"type\":\"rnsvbuswd\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.experiments().listByResourceGroup("ixqtn", false, "tezlwff", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("zq", response.iterator().next().location()); - Assertions.assertEquals("f", response.iterator().next().tags().get("wesgogczh")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("totxhojujb", response.iterator().next().steps().get(0).name()); - Assertions.assertEquals("elmcuvhixbjxyfw", response.iterator().next().steps().get(0).branches().get(0).name()); - Assertions.assertEquals("wjchrdg", response.iterator().next().selectors().get(0).id()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListMockTests.java deleted file mode 100644 index 90cdbc49df09..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListMockTests.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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -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 ExperimentsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"wmyijejveg\":{\"principalId\":\"9e54ea8c-5cec-47ae-8024-3b0f05f1d411\",\"clientId\":\"458a26f5-d64a-4aa6-b0ba-13071327b158\"},\"pna\":{\"principalId\":\"73e1f3c9-3dbc-4e1c-bb06-45839ad00a31\",\"clientId\":\"45f1624b-2901-49fa-89a6-8f1396458ca9\"},\"xccbdreaxhcex\":{\"principalId\":\"b5c3a3f7-fdd6-4720-90ad-066968b4fc18\",\"clientId\":\"c808ff56-4a42-4549-9347-ea63f08b8aae\"},\"vqahqkghtpwi\":{\"principalId\":\"1b806910-c911-456c-a239-ac8eeda2c4f2\",\"clientId\":\"57779487-e8d4-4cff-9b28-1f0d552ce7a8\"}},\"principalId\":\"hyjsvfycx\",\"tenantId\":\"fvoow\"},\"properties\":{\"provisioningState\":\"Creating\",\"steps\":[{\"name\":\"t\",\"branches\":[{\"name\":\"qp\",\"actions\":[]},{\"name\":\"y\",\"actions\":[]},{\"name\":\"s\",\"actions\":[]},{\"name\":\"ronzmyhgfip\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"ChaosTargetSelector\",\"id\":\"xkmcwaekrrjre\",\"filter\":{\"type\":\"ChaosTargetFilter\"},\"\":{\"lbqpvuzlmvfelf\":\"datasgumhjglikkxwsl\",\"crpw\":\"datatgp\"}}]},\"location\":\"xeznoi\",\"tags\":{\"qkagfhsxt\":\"njwmwkpnbsazejj\",\"dm\":\"augzxnfaazpxdtn\"},\"id\":\"qjjlwuen\",\"name\":\"rkpyouaibrebqaay\",\"type\":\"j\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.experiments().list(false, "mctlpdngitv", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("xeznoi", response.iterator().next().location()); - Assertions.assertEquals("njwmwkpnbsazejj", response.iterator().next().tags().get("qkagfhsxt")); - Assertions.assertEquals(ResourceIdentityType.NONE, response.iterator().next().identity().type()); - Assertions.assertEquals("t", response.iterator().next().steps().get(0).name()); - Assertions.assertEquals("qp", response.iterator().next().steps().get(0).branches().get(0).name()); - Assertions.assertEquals("xkmcwaekrrjre", response.iterator().next().selectors().get(0).id()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationDisplayTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationDisplayTests.java deleted file mode 100644 index 97cc58c77086..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.OperationDisplay; - -public final class OperationDisplayTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationDisplay model = BinaryData.fromString( - "{\"provider\":\"abfatkl\",\"resource\":\"xbjhwuaanozjosph\",\"operation\":\"ulpjr\",\"description\":\"ag\"}") - .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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationInnerTests.java deleted file mode 100644 index c6eabfc572e0..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; -import com.azure.resourcemanager.chaos.models.OperationDisplay; - -public final class OperationInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationInner model = BinaryData.fromString( - "{\"name\":\"qreyfkzi\",\"isDataAction\":false,\"display\":{\"provider\":\"n\",\"resource\":\"ivx\",\"operation\":\"zel\",\"description\":\"irels\"},\"origin\":\"user\",\"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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationListResultTests.java deleted file mode 100644 index addaf911cdb8..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.OperationListResult; - -public final class OperationListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - OperationListResult model = BinaryData.fromString( - "{\"value\":[{\"name\":\"wuipiccjzkzivg\",\"isDataAction\":false,\"display\":{\"provider\":\"y\",\"resource\":\"yrnxxmueedn\",\"operation\":\"dvstkw\",\"description\":\"tchealmf\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"gdv\",\"isDataAction\":true,\"display\":{\"provider\":\"ohgwxrtfudxepxg\",\"resource\":\"agvrvmnpkuk\",\"operation\":\"i\",\"description\":\"blxgwimf\"},\"origin\":\"system\",\"actionType\":\"Internal\"}],\"nextLink\":\"wmszkk\"}") - .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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ResourceIdentityTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ResourceIdentityTests.java deleted file mode 100644 index 98b106319a14..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ResourceIdentityTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class ResourceIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ResourceIdentity model = BinaryData.fromString( - "{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"zabglcuhxwt\":{\"principalId\":\"23b4e7ab-bed4-48d5-b835-33db915ab81c\",\"clientId\":\"93ab5b70-2990-4fdc-8f04-1ad6db474dea\"},\"qik\":{\"principalId\":\"a4be7bfb-e769-4665-9b64-2c3ffd045676\",\"clientId\":\"dce9e292-c0f6-46a8-b565-0da60edeeadd\"},\"ovplw\":{\"principalId\":\"c6576fa6-c26f-4f66-92a6-7fed8fc5128b\",\"clientId\":\"4f733958-d169-4fb6-8848-8cca54998b91\"}},\"principalId\":\"hvgyuguosvmk\",\"tenantId\":\"sxqu\"}") - .toObject(ResourceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentity model = new ResourceIdentity().withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities(mapOf("zabglcuhxwt", new UserAssignedIdentity(), "qik", - new UserAssignedIdentity(), "ovplw", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepStatusTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepStatusTests.java deleted file mode 100644 index 1b9539c39281..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepStatusTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.StepStatus; - -public final class StepStatusTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - StepStatus model = BinaryData.fromString( - "{\"stepName\":\"luicpdggkzzlvmbm\",\"stepId\":\"xmodf\",\"status\":\"efyw\",\"branches\":[{\"branchName\":\"vmwy\",\"branchId\":\"fouyf\",\"status\":\"akcp\",\"actions\":[{\"actionName\":\"vqtmnub\",\"actionId\":\"kpzksmondjmq\",\"status\":\"vypomgkopkwho\",\"startTime\":\"2021-08-09T17:57:45Z\",\"endTime\":\"2021-12-07T09:07:14Z\",\"targets\":[{},{},{},{}]},{\"actionName\":\"ysmocmbqfqvmkcxo\",\"actionId\":\"pvhelxprg\",\"status\":\"atddc\",\"startTime\":\"2021-09-13T16:27:08Z\",\"endTime\":\"2021-12-04T18:39:42Z\",\"targets\":[{},{},{},{}]}]},{\"branchName\":\"jxgciqibrh\",\"branchId\":\"xsdqrhzoymibmrqy\",\"status\":\"ahwfluszdtmhrk\",\"actions\":[{\"actionName\":\"yvoqa\",\"actionId\":\"iexpbtgiwbwo\",\"status\":\"washr\",\"startTime\":\"2021-08-01T13:56:15Z\",\"endTime\":\"2021-10-17T07:53:24Z\",\"targets\":[{},{},{}]},{\"actionName\":\"wbpokulpiujwaasi\",\"actionId\":\"i\",\"status\":\"byuqerpqlp\",\"startTime\":\"2021-10-05T15:21:02Z\",\"endTime\":\"2020-12-29T00:03:32Z\",\"targets\":[{},{}]}]},{\"branchName\":\"bdbutauvf\",\"branchId\":\"kuwhh\",\"status\":\"ykojoxafnndlpic\",\"actions\":[{\"actionName\":\"mkcdyhbpkkpwdre\",\"actionId\":\"ovvqfovljxywsu\",\"status\":\"yrs\",\"startTime\":\"2021-03-16T15:34:55Z\",\"endTime\":\"2021-05-20T04:26:58Z\",\"targets\":[{},{},{}]}]}]}") - .toObject(StepStatus.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - StepStatus model = new StepStatus(); - model = BinaryData.fromObject(model).toObject(StepStatus.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetInnerTests.java deleted file mode 100644 index b8771d85c1e3..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetInnerTests.java +++ /dev/null @@ -1,41 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class TargetInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetInner model = BinaryData.fromString( - "{\"location\":\"tvcof\",\"properties\":{\"vkg\":\"dataf\",\"gdknnqv\":\"datau\"},\"id\":\"aznqntoru\",\"name\":\"sgsahmkycgr\",\"type\":\"uwjuetaeburuvdmo\"}") - .toObject(TargetInner.class); - Assertions.assertEquals("tvcof", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetInner model - = new TargetInner().withLocation("tvcof").withProperties(mapOf("vkg", "dataf", "gdknnqv", "datau")); - model = BinaryData.fromObject(model).toObject(TargetInner.class); - Assertions.assertEquals("tvcof", model.location()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetListResultTests.java deleted file mode 100644 index 9b8b508085c7..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.TargetListResult; - -public final class TargetListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetListResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"vti\",\"properties\":{\"kfzbeyvpnqicvi\":\"dataxsdszuempsb\",\"jjxd\":\"datav\"},\"id\":\"rbuukzclewyhmlwp\",\"name\":\"ztzp\",\"type\":\"fn\"},{\"location\":\"wyfzqwhxxbuyqa\",\"properties\":{\"or\":\"datafeqztppriol\",\"ncwsob\":\"dataaltol\",\"pfuvglsbjjca\":\"datawcsdbnwdcfhucq\"},\"id\":\"vxb\",\"name\":\"t\",\"type\":\"udutnco\"}],\"nextLink\":\"r\"}") - .toObject(TargetListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetListResult model = new TargetListResult(); - model = BinaryData.fromObject(model).toObject(TargetListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetReferenceTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetReferenceTests.java deleted file mode 100644 index f42a44ac9e00..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetReferenceTests.java +++ /dev/null @@ -1,28 +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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.TargetReference; -import com.azure.resourcemanager.chaos.models.TargetReferenceType; -import org.junit.jupiter.api.Assertions; - -public final class TargetReferenceTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetReference model - = BinaryData.fromString("{\"type\":\"ChaosTarget\",\"id\":\"bt\"}").toObject(TargetReference.class); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.type()); - Assertions.assertEquals("bt", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetReference model = new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("bt"); - model = BinaryData.fromObject(model).toObject(TargetReference.class); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.type()); - Assertions.assertEquals("bt", model.id()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeInnerTests.java deleted file mode 100644 index 3f07e5390166..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeInnerTests.java +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import org.junit.jupiter.api.Assertions; - -public final class TargetTypeInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetTypeInner model = BinaryData.fromString( - "{\"location\":\"dpfrxtrthzvaytdw\",\"properties\":{\"displayName\":\"brqubp\",\"description\":\"h\",\"propertiesSchema\":\"iilivpdtiirqtd\",\"resourceTypes\":[\"xoruzfgsquyfxrx\",\"l\",\"ptramxj\"]},\"id\":\"zwl\",\"name\":\"nwxuqlcvydyp\",\"type\":\"tdooaoj\"}") - .toObject(TargetTypeInner.class); - Assertions.assertEquals("dpfrxtrthzvaytdw", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetTypeInner model = new TargetTypeInner().withLocation("dpfrxtrthzvaytdw"); - model = BinaryData.fromObject(model).toObject(TargetTypeInner.class); - Assertions.assertEquals("dpfrxtrthzvaytdw", model.location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeListResultTests.java deleted file mode 100644 index 57bcae75c317..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeListResultTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.TargetTypeListResult; - -public final class TargetTypeListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetTypeListResult model = BinaryData.fromString( - "{\"value\":[{\"location\":\"jwosytxitcskfck\",\"properties\":{\"displayName\":\"umiekkezzi\",\"description\":\"ly\",\"propertiesSchema\":\"hdgqggeb\",\"resourceTypes\":[\"ygaeqidbqfatpxl\"]},\"id\":\"rxcyjmoad\",\"name\":\"uvarmywdmjsjq\",\"type\":\"jhhyxxrwlycoduhp\"},{\"location\":\"gymare\",\"properties\":{\"displayName\":\"ajxq\",\"description\":\"jhkycub\",\"propertiesSchema\":\"dgssofwqmzqal\",\"resourceTypes\":[\"njijpxacqqudf\",\"byxbaaabjy\",\"ayffim\",\"zrtuzq\"]},\"id\":\"gsexne\",\"name\":\"fdnw\",\"type\":\"wmewzsyy\"}],\"nextLink\":\"uzsoi\"}") - .toObject(TargetTypeListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetTypeListResult model = new TargetTypeListResult(); - model = BinaryData.fromObject(model).toObject(TargetTypeListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypePropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypePropertiesTests.java deleted file mode 100644 index 77f878a50c55..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypePropertiesTests.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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeProperties; - -public final class TargetTypePropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - TargetTypeProperties model = BinaryData.fromString( - "{\"displayName\":\"iodkooebwnujhem\",\"description\":\"bvdkcrodtjin\",\"propertiesSchema\":\"jlfltkacjvefkdlf\",\"resourceTypes\":[\"ggkfpagaowpul\",\"qblylsyxkqj\"]}") - .toObject(TargetTypeProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetTypeProperties model = new TargetTypeProperties(); - model = BinaryData.fromObject(model).toObject(TargetTypeProperties.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetWithResponseMockTests.java deleted file mode 100644 index 7f2f8f929381..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,39 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.TargetType; -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 TargetTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"vlp\",\"properties\":{\"displayName\":\"xkzb\",\"description\":\"sgeivsiy\",\"propertiesSchema\":\"kdncj\",\"resourceTypes\":[\"nbzoggcu\",\"apzwyrpgog\",\"qxepnylbfuaj\",\"yjt\"]},\"id\":\"vofqzhvfc\",\"name\":\"byfmowuxr\",\"type\":\"jpvd\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - TargetType response = manager.targetTypes() - .getWithResponse("qddrihpfhoqcaae", "dao", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("vlp", response.location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesListMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesListMockTests.java deleted file mode 100644 index e2e22ff7a30d..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesListMockTests.java +++ /dev/null @@ -1,39 +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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.TargetType; -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 TargetTypesListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"tfpmvmemfnczdw\",\"properties\":{\"displayName\":\"b\",\"description\":\"xlllchp\",\"propertiesSchema\":\"bzevwrd\",\"resourceTypes\":[\"ukuv\",\"jcswsmys\",\"uluqypfc\",\"lerchpq\"]},\"id\":\"mfpjbabw\",\"name\":\"dfc\",\"type\":\"sspuunnoxyhkx\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response - = manager.targetTypes().list("jkmnwq", "nobaiyhddviacegf", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tfpmvmemfnczdw", response.iterator().next().location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index e90bf7bc1e0a..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,58 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.azure.resourcemanager.chaos.models.Target; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -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 TargetsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - String responseStr - = "{\"location\":\"udaspavehh\",\"properties\":{\"dhcxgkmoy\":\"datakbunzoz\",\"f\":\"datacdyuibhmfdnbzyd\",\"fukiscvwmzhw\":\"datafcjnaeoisrvhmgor\"},\"id\":\"lefaxvxilcbtgn\",\"name\":\"nzeyqxtjj\",\"type\":\"zqlqhyc\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Target response = manager.targets() - .createOrUpdateWithResponse("a", "ysdzhez", "wva", "qyuvvfonkp", "hqyikvy", - new TargetInner().withLocation("yavluwmncstt") - .withProperties(mapOf("sgsgbdhu", "datafybvpoek", "hzvhxnkomtkubo", "dataqgnjdgkynscli", - "hihfrbbcevqagtlt", "datappnvdxz", "vgtrdcnifmzzs", "datahlfkqojpy")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("udaspavehh", response.location()); - } - - // 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/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteWithResponseMockTests.java deleted file mode 100644 index 8a0e6764ea52..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,35 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -public final class TargetsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - String responseStr = "{}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager.targets() - .deleteWithResponse("wf", "jlb", "xqvkjlmxhomdyn", "dwdigumb", "raauzzpt", - com.azure.core.util.Context.NONE); - - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsGetWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsGetWithResponseMockTests.java deleted file mode 100644 index 59bab4e21bd8..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsGetWithResponseMockTests.java +++ /dev/null @@ -1,40 +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.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Target; -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 TargetsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - String responseStr - = "{\"location\":\"ecxn\",\"properties\":{\"mlqtmldgxob\":\"dataicokpv\"},\"id\":\"irclnpk\",\"name\":\"iayz\",\"type\":\"iykhy\"}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - Target response = manager.targets() - .getWithResponse("zrrjvpgly", "zgkrvqe", "vtoepryutnw", "tpzdmovzvfvaawzq", "dflgzuri", - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("ecxn", response.location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsListMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsListMockTests.java deleted file mode 100644 index a247427faa88..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsListMockTests.java +++ /dev/null @@ -1,39 +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.chaos.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.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Target; -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 TargetsListMockTests { - @Test - public void testList() throws Exception { - String responseStr - = "{\"value\":[{\"location\":\"kdmflvestmjlx\",\"properties\":{\"wk\":\"datailozapeewchpxlk\"},\"id\":\"ziycslevufuztck\",\"name\":\"yhjtqedcgzu\",\"type\":\"wmmrq\"}]}"; - - HttpClient httpClient - = response -> Mono.just(new MockHttpResponse(response, 200, responseStr.getBytes(StandardCharsets.UTF_8))); - ChaosManager manager = ChaosManager.configure() - .withHttpClient(httpClient) - .authenticate(tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - PagedIterable response = manager.targets() - .list("xfzwi", "vwzjbhyz", "xjrk", "mbtrnegvmnvu", "eqvldspast", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("kdmflvestmjlx", response.iterator().next().location()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/UserAssignedIdentityTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/UserAssignedIdentityTests.java deleted file mode 100644 index 64bb17c19930..000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/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.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; - -public final class UserAssignedIdentityTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - UserAssignedIdentity model = BinaryData.fromString( - "{\"principalId\":\"6d0dd435-596a-45a4-bf17-70a9cb0fc500\",\"clientId\":\"fc0c94e3-ae1a-4ec2-ba47-360e4827ce7e\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}