From dbc8cefad7580122d614ea77d1cd618013f4996f Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Thu, 26 Oct 2023 08:30:31 +0000 Subject: [PATCH] CodeGen from PR 26408 in Azure/azure-rest-api-specs Merge ebd7977f9f409529c757d49045dd1ec67080afe3 into 1a2d03c96dda8ba27e21ac14c6e3707820bb421a --- .../resourcemanager/chaos/ChaosManager.java | 362 --- .../chaos/fluent/CapabilitiesClient.java | 210 -- .../chaos/fluent/CapabilityTypesClient.java | 76 - .../chaos/fluent/ChaosManagementClient.java | 88 - .../chaos/fluent/ExperimentsClient.java | 362 --- .../chaos/fluent/OperationsClient.java | 36 - .../chaos/fluent/TargetTypesClient.java | 68 - .../chaos/fluent/TargetsClient.java | 191 -- .../chaos/fluent/models/CapabilityInner.java | 104 - .../fluent/models/CapabilityProperties.java | 99 - .../fluent/models/CapabilityTypeInner.java | 219 -- .../models/CapabilityTypeProperties.java | 212 -- .../ExperimentCancelOperationResultInner.java | 54 - .../ExperimentExecutionDetailsInner.java | 161 -- .../ExperimentExecutionDetailsProperties.java | 149 - .../chaos/fluent/models/ExperimentInner.java | 185 -- .../fluent/models/ExperimentProperties.java | 124 - .../ExperimentStartOperationResultInner.java | 54 - .../fluent/models/ExperimentStatusInner.java | 115 - .../models/ExperimentStatusProperties.java | 70 - .../chaos/fluent/models/OperationInner.java | 127 - .../chaos/fluent/models/TargetInner.java | 104 - .../chaos/fluent/models/TargetTypeInner.java | 129 - .../fluent/models/TargetTypeProperties.java | 85 - .../chaos/fluent/models/package-info.java | 6 - .../chaos/fluent/package-info.java | 6 - .../CapabilitiesClientImpl.java | 1348 --------- .../implementation/CapabilitiesImpl.java | 222 -- .../chaos/implementation/CapabilityImpl.java | 64 - .../implementation/CapabilityTypeImpl.java | 101 - .../CapabilityTypesClientImpl.java | 543 ---- .../implementation/CapabilityTypesImpl.java | 73 - .../ChaosManagementClientBuilder.java | 144 - .../ChaosManagementClientImpl.java | 360 --- .../ExperimentCancelOperationResultImpl.java | 36 - .../ExperimentExecutionDetailsImpl.java | 74 - .../chaos/implementation/ExperimentImpl.java | 251 -- .../ExperimentStartOperationResultImpl.java | 36 - .../implementation/ExperimentStatusImpl.java | 53 - .../implementation/ExperimentsClientImpl.java | 2556 ----------------- .../chaos/implementation/ExperimentsImpl.java | 306 -- .../chaos/implementation/OperationImpl.java | 50 - .../implementation/OperationsClientImpl.java | 272 -- .../chaos/implementation/OperationsImpl.java | 44 - .../chaos/implementation/TargetImpl.java | 59 - .../chaos/implementation/TargetTypeImpl.java | 71 - .../implementation/TargetTypesClientImpl.java | 496 ---- .../chaos/implementation/TargetTypesImpl.java | 68 - .../implementation/TargetsClientImpl.java | 1226 -------- .../chaos/implementation/TargetsImpl.java | 196 -- .../chaos/implementation/Utils.java | 204 -- .../chaos/implementation/package-info.java | 6 - .../resourcemanager/chaos/models/Action.java | 71 - .../chaos/models/ActionStatus.java | 119 - .../chaos/models/ActionType.java | 44 - .../resourcemanager/chaos/models/Branch.java | 90 - .../chaos/models/BranchStatus.java | 88 - .../chaos/models/Capabilities.java | 200 -- .../chaos/models/Capability.java | 81 - .../chaos/models/CapabilityListResult.java | 59 - .../chaos/models/CapabilityType.java | 124 - .../models/CapabilityTypeListResult.java | 59 - ...bilityTypePropertiesRuntimeProperties.java | 39 - .../chaos/models/CapabilityTypes.java | 69 - .../chaos/models/ContinuousAction.java | 137 - .../chaos/models/DelayAction.java | 72 - .../chaos/models/DiscreteAction.java | 105 - .../chaos/models/Experiment.java | 334 --- .../ExperimentCancelOperationResult.java | 31 - ...mentExecutionActionTargetDetailsError.java | 54 - ...xecutionActionTargetDetailsProperties.java | 103 - .../models/ExperimentExecutionDetails.java | 95 - .../ExperimentExecutionDetailsListResult.java | 59 - ...cutionDetailsPropertiesRunInformation.java | 43 - .../chaos/models/ExperimentListResult.java | 59 - .../ExperimentStartOperationResult.java | 31 - .../chaos/models/ExperimentStatus.java | 60 - .../models/ExperimentStatusListResult.java | 59 - .../chaos/models/ExperimentUpdate.java | 53 - .../chaos/models/Experiments.java | 325 --- .../resourcemanager/chaos/models/Filter.java | 33 - .../chaos/models/FilterType.java | 44 - .../chaos/models/KeyValuePair.java | 89 - .../chaos/models/ListSelector.java | 81 - .../chaos/models/Operation.java | 56 - .../chaos/models/OperationDisplay.java | 91 - .../chaos/models/OperationListResult.java | 62 - .../chaos/models/Operations.java | 31 - .../resourcemanager/chaos/models/Origin.java | 53 - .../chaos/models/QuerySelector.java | 110 - .../chaos/models/ResourceIdentity.java | 133 - .../chaos/models/ResourceIdentityType.java | 54 - .../chaos/models/Selector.java | 138 - .../chaos/models/SelectorType.java | 47 - .../chaos/models/SimpleFilter.java | 59 - .../chaos/models/SimpleFilterParameters.java | 51 - .../resourcemanager/chaos/models/Step.java | 90 - .../chaos/models/StepStatus.java | 88 - .../resourcemanager/chaos/models/Target.java | 61 - .../chaos/models/TargetListResult.java | 59 - .../chaos/models/TargetReference.java | 89 - .../chaos/models/TargetReferenceType.java | 44 - .../chaos/models/TargetType.java | 82 - .../chaos/models/TargetTypeListResult.java | 59 - .../chaos/models/TargetTypes.java | 61 - .../resourcemanager/chaos/models/Targets.java | 181 -- .../chaos/models/UserAssignedIdentity.java | 55 - .../chaos/models/package-info.java | 6 - .../resourcemanager/chaos/package-info.java | 6 - .../src/main/java/module-info.java | 19 - .../CapabilitiesCreateOrUpdateSamples.java | 33 - .../generated/CapabilitiesDeleteSamples.java | 30 - .../generated/CapabilitiesGetSamples.java | 30 - .../generated/CapabilitiesListSamples.java | 30 - .../generated/CapabilityTypesGetSamples.java | 23 - .../generated/CapabilityTypesListSamples.java | 21 - .../generated/ExperimentsCancelSamples.java | 20 - .../ExperimentsCreateOrUpdateSamples.java | 73 - .../generated/ExperimentsDeleteSamples.java | 22 - .../ExperimentsGetByResourceGroupSamples.java | 22 - ...ExperimentsGetExecutionDetailsSamples.java | 26 - .../ExperimentsGetStatusSamples.java | 26 - .../ExperimentsListAllStatusesSamples.java | 20 - ...ExperimentsListByResourceGroupSamples.java | 20 - ...xperimentsListExecutionDetailsSamples.java | 20 - .../generated/ExperimentsListSamples.java | 20 - .../generated/ExperimentsStartSamples.java | 20 - .../generated/ExperimentsUpdateSamples.java | 52 - .../generated/TargetTypesGetSamples.java | 20 - .../generated/TargetTypesListSamples.java | 20 - .../TargetsCreateOrUpdateSamples.java | 57 - .../chaos/generated/TargetsDeleteSamples.java | 29 - .../chaos/generated/TargetsGetSamples.java | 29 - .../chaos/generated/TargetsListSamples.java | 29 - .../chaos/generated/ActionTests.java | 24 - .../chaos/generated/BranchTests.java | 40 - ...esCreateOrUpdateWithResponseMockTests.java | 76 - ...pabilitiesDeleteWithResponseMockTests.java | 70 - .../CapabilitiesGetWithResponseMockTests.java | 74 - .../generated/CapabilitiesListMockTests.java | 67 - .../chaos/generated/CapabilityInnerTests.java | 25 - .../generated/CapabilityListResultTests.java | 25 - .../generated/CapabilityPropertiesTests.java | 25 - .../generated/CapabilityTypeInnerTests.java | 28 - .../CapabilityTypeListResultTests.java | 25 - ...yTypePropertiesRuntimePropertiesTests.java | 24 - .../CapabilityTypePropertiesTests.java | 36 - ...pabilityTypesGetWithResponseMockTests.java | 70 - .../CapabilityTypesListMockTests.java | 68 - .../chaos/generated/DelayActionTests.java | 30 - ...rimentCancelOperationResultInnerTests.java | 24 - .../ExperimentExecutionDetailsInnerTests.java | 25 - ...rimentExecutionDetailsListResultTests.java | 25 - ...nDetailsPropertiesRunInformationTests.java | 26 - ...rimentExecutionDetailsPropertiesTests.java | 25 - .../chaos/generated/ExperimentInnerTests.java | 190 -- .../generated/ExperimentListResultTests.java | 25 - .../generated/ExperimentPropertiesTests.java | 103 - ...erimentStartOperationResultInnerTests.java | 24 - .../generated/ExperimentStatusInnerTests.java | 25 - .../ExperimentStatusListResultTests.java | 25 - .../ExperimentStatusPropertiesTests.java | 25 - .../generated/ExperimentUpdateTests.java | 50 - ...xperimentsCancelWithResponseMockTests.java | 66 - ...tsCreateOrUpdateWithResponseMockTests.java | 146 - ...eByResourceGroupWithResponseMockTests.java | 63 - ...tByResourceGroupWithResponseMockTests.java | 77 - ...ExecutionDetailsWithResponseMockTests.java | 67 - ...rimentsGetStatusWithResponseMockTests.java | 67 - .../ExperimentsListAllStatusesMockTests.java | 65 - ...perimentsListByResourceGroupMockTests.java | 75 - ...erimentsListExecutionDetailsMockTests.java | 65 - .../generated/ExperimentsListMockTests.java | 74 - ...ExperimentsStartWithResponseMockTests.java | 66 - .../chaos/generated/FilterTests.java | 21 - .../chaos/generated/ListSelectorTests.java | 44 - .../generated/OperationDisplayTests.java | 25 - .../chaos/generated/OperationInnerTests.java | 26 - .../generated/OperationListResultTests.java | 25 - .../chaos/generated/QuerySelectorTests.java | 39 - .../generated/ResourceIdentityTests.java | 47 - .../chaos/generated/SelectorTests.java | 43 - .../SimpleFilterParametersTests.java | 29 - .../chaos/generated/SimpleFilterTests.java | 33 - .../chaos/generated/StepStatusTests.java | 25 - .../chaos/generated/StepTests.java | 64 - .../chaos/generated/TargetInnerTests.java | 42 - .../generated/TargetListResultTests.java | 25 - .../chaos/generated/TargetReferenceTests.java | 28 - .../chaos/generated/TargetTypeInnerTests.java | 28 - .../generated/TargetTypeListResultTests.java | 25 - .../generated/TargetTypePropertiesTests.java | 25 - .../TargetTypesGetWithResponseMockTests.java | 70 - .../generated/TargetTypesListMockTests.java | 68 - ...tsCreateOrUpdateWithResponseMockTests.java | 93 - .../TargetsDeleteWithResponseMockTests.java | 69 - .../TargetsGetWithResponseMockTests.java | 70 - .../chaos/generated/TargetsListMockTests.java | 68 - .../generated/UserAssignedIdentityTests.java | 25 - 199 files changed, 20829 deletions(-) delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentCancelOperationResultInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/package-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/package-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/Utils.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/package-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionStatus.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/BranchStatus.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypePropertiesRuntimeProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentCancelOperationResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsError.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsProperties.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsPropertiesRunInformation.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStartOperationResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatus.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatusListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/FilterType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/KeyValuePair.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operation.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationDisplay.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Origin.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentity.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentityType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SelectorType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/StepStatus.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReference.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReferenceType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/UserAssignedIdentity.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/package-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/package-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/main/java/module-info.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ActionTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/BranchTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityPropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesRuntimePropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/DelayActionTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentCancelOperationResultInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesRunInformationTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentPropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStartOperationResultInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusPropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentUpdateTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/FilterTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ListSelectorTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationDisplayTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/QuerySelectorTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ResourceIdentityTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SelectorTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterParametersTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepStatusTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetReferenceTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeInnerTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeListResultTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypePropertiesTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesListMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsGetWithResponseMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsListMockTests.java delete mode 100644 sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/UserAssignedIdentityTests.java 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 deleted file mode 100644 index 0a8981c49044c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/ChaosManager.java +++ /dev/null @@ -1,362 +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; - -import com.azure.core.credential.TokenCredential; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.HttpPipelinePosition; -import com.azure.core.http.policy.AddDatePolicy; -import com.azure.core.http.policy.AddHeadersFromContextPolicy; -import com.azure.core.http.policy.HttpLogOptions; -import com.azure.core.http.policy.HttpLoggingPolicy; -import com.azure.core.http.policy.HttpPipelinePolicy; -import com.azure.core.http.policy.HttpPolicyProviders; -import com.azure.core.http.policy.RequestIdPolicy; -import com.azure.core.http.policy.RetryOptions; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.http.policy.ArmChallengeAuthenticationPolicy; -import com.azure.core.management.profile.AzureProfile; -import com.azure.core.util.Configuration; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.ChaosManagementClient; -import com.azure.resourcemanager.chaos.implementation.CapabilitiesImpl; -import com.azure.resourcemanager.chaos.implementation.CapabilityTypesImpl; -import com.azure.resourcemanager.chaos.implementation.ChaosManagementClientBuilder; -import com.azure.resourcemanager.chaos.implementation.ExperimentsImpl; -import com.azure.resourcemanager.chaos.implementation.OperationsImpl; -import com.azure.resourcemanager.chaos.implementation.TargetTypesImpl; -import com.azure.resourcemanager.chaos.implementation.TargetsImpl; -import com.azure.resourcemanager.chaos.models.Capabilities; -import com.azure.resourcemanager.chaos.models.CapabilityTypes; -import com.azure.resourcemanager.chaos.models.Experiments; -import com.azure.resourcemanager.chaos.models.Operations; -import com.azure.resourcemanager.chaos.models.TargetTypes; -import com.azure.resourcemanager.chaos.models.Targets; -import java.time.Duration; -import java.time.temporal.ChronoUnit; -import java.util.ArrayList; -import java.util.List; -import java.util.Objects; -import java.util.stream.Collectors; - -/** Entry point to ChaosManager. Chaos Management Client. */ -public final class ChaosManager { - private Capabilities capabilities; - - private CapabilityTypes capabilityTypes; - - private Experiments experiments; - - private Operations operations; - - private TargetTypes targetTypes; - - private Targets targets; - - private final ChaosManagementClient clientObject; - - private ChaosManager(HttpPipeline httpPipeline, AzureProfile profile, Duration defaultPollInterval) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - this.clientObject = - new ChaosManagementClientBuilder() - .pipeline(httpPipeline) - .endpoint(profile.getEnvironment().getResourceManagerEndpoint()) - .subscriptionId(profile.getSubscriptionId()) - .defaultPollInterval(defaultPollInterval) - .buildClient(); - } - - /** - * Creates an instance of Chaos service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Chaos service API instance. - */ - public static ChaosManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return configure().authenticate(credential, profile); - } - - /** - * Creates an instance of Chaos service API entry point. - * - * @param httpPipeline the {@link HttpPipeline} configured with Azure authentication credential. - * @param profile the Azure profile for client. - * @return the Chaos service API instance. - */ - public static ChaosManager authenticate(HttpPipeline httpPipeline, AzureProfile profile) { - Objects.requireNonNull(httpPipeline, "'httpPipeline' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - return new ChaosManager(httpPipeline, profile, null); - } - - /** - * Gets a Configurable instance that can be used to create ChaosManager with optional configuration. - * - * @return the Configurable instance allowing configurations. - */ - public static Configurable configure() { - return new ChaosManager.Configurable(); - } - - /** The Configurable allowing configurations to be set. */ - public static final class Configurable { - private static final ClientLogger LOGGER = new ClientLogger(Configurable.class); - - private HttpClient httpClient; - private HttpLogOptions httpLogOptions; - private final List policies = new ArrayList<>(); - private final List scopes = new ArrayList<>(); - private RetryPolicy retryPolicy; - private RetryOptions retryOptions; - private Duration defaultPollInterval; - - private Configurable() { - } - - /** - * Sets the http client. - * - * @param httpClient the HTTP client. - * @return the configurable object itself. - */ - public Configurable withHttpClient(HttpClient httpClient) { - this.httpClient = Objects.requireNonNull(httpClient, "'httpClient' cannot be null."); - return this; - } - - /** - * Sets the logging options to the HTTP pipeline. - * - * @param httpLogOptions the HTTP log options. - * @return the configurable object itself. - */ - public Configurable withLogOptions(HttpLogOptions httpLogOptions) { - this.httpLogOptions = Objects.requireNonNull(httpLogOptions, "'httpLogOptions' cannot be null."); - return this; - } - - /** - * Adds the pipeline policy to the HTTP pipeline. - * - * @param policy the HTTP pipeline policy. - * @return the configurable object itself. - */ - public Configurable withPolicy(HttpPipelinePolicy policy) { - this.policies.add(Objects.requireNonNull(policy, "'policy' cannot be null.")); - return this; - } - - /** - * Adds the scope to permission sets. - * - * @param scope the scope. - * @return the configurable object itself. - */ - public Configurable withScope(String scope) { - this.scopes.add(Objects.requireNonNull(scope, "'scope' cannot be null.")); - return this; - } - - /** - * Sets the retry policy to the HTTP pipeline. - * - * @param retryPolicy the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryPolicy(RetryPolicy retryPolicy) { - this.retryPolicy = Objects.requireNonNull(retryPolicy, "'retryPolicy' cannot be null."); - return this; - } - - /** - * Sets the retry options for the HTTP pipeline retry policy. - * - *

This setting has no effect, if retry policy is set via {@link #withRetryPolicy(RetryPolicy)}. - * - * @param retryOptions the retry options for the HTTP pipeline retry policy. - * @return the configurable object itself. - */ - public Configurable withRetryOptions(RetryOptions retryOptions) { - this.retryOptions = Objects.requireNonNull(retryOptions, "'retryOptions' cannot be null."); - return this; - } - - /** - * Sets the default poll interval, used when service does not provide "Retry-After" header. - * - * @param defaultPollInterval the default poll interval. - * @return the configurable object itself. - */ - public Configurable withDefaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = - Objects.requireNonNull(defaultPollInterval, "'defaultPollInterval' cannot be null."); - if (this.defaultPollInterval.isNegative()) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("'defaultPollInterval' cannot be negative")); - } - return this; - } - - /** - * Creates an instance of Chaos service API entry point. - * - * @param credential the credential to use. - * @param profile the Azure profile for client. - * @return the Chaos service API instance. - */ - public ChaosManager authenticate(TokenCredential credential, AzureProfile profile) { - Objects.requireNonNull(credential, "'credential' cannot be null."); - Objects.requireNonNull(profile, "'profile' cannot be null."); - - StringBuilder userAgentBuilder = new StringBuilder(); - userAgentBuilder - .append("azsdk-java") - .append("-") - .append("com.azure.resourcemanager.chaos") - .append("/") - .append("1.0.0-beta.1"); - if (!Configuration.getGlobalConfiguration().get("AZURE_TELEMETRY_DISABLED", false)) { - userAgentBuilder - .append(" (") - .append(Configuration.getGlobalConfiguration().get("java.version")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.name")) - .append("; ") - .append(Configuration.getGlobalConfiguration().get("os.version")) - .append("; auto-generated)"); - } else { - userAgentBuilder.append(" (auto-generated)"); - } - - if (scopes.isEmpty()) { - scopes.add(profile.getEnvironment().getManagementEndpoint() + "/.default"); - } - if (retryPolicy == null) { - if (retryOptions != null) { - retryPolicy = new RetryPolicy(retryOptions); - } else { - retryPolicy = new RetryPolicy("Retry-After", ChronoUnit.SECONDS); - } - } - List policies = new ArrayList<>(); - policies.add(new UserAgentPolicy(userAgentBuilder.toString())); - policies.add(new AddHeadersFromContextPolicy()); - policies.add(new RequestIdPolicy()); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_CALL) - .collect(Collectors.toList())); - HttpPolicyProviders.addBeforeRetryPolicies(policies); - policies.add(retryPolicy); - policies.add(new AddDatePolicy()); - policies.add(new ArmChallengeAuthenticationPolicy(credential, scopes.toArray(new String[0]))); - policies - .addAll( - this - .policies - .stream() - .filter(p -> p.getPipelinePosition() == HttpPipelinePosition.PER_RETRY) - .collect(Collectors.toList())); - HttpPolicyProviders.addAfterRetryPolicies(policies); - policies.add(new HttpLoggingPolicy(httpLogOptions)); - HttpPipeline httpPipeline = - new HttpPipelineBuilder() - .httpClient(httpClient) - .policies(policies.toArray(new HttpPipelinePolicy[0])) - .build(); - return new ChaosManager(httpPipeline, profile, defaultPollInterval); - } - } - - /** - * 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. - * - * @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 Experiments. It manages Experiment. - * - * @return Resource collection API of Experiments. - */ - public Experiments experiments() { - if (this.experiments == null) { - this.experiments = new ExperimentsImpl(clientObject.getExperiments(), this); - } - return experiments; - } - - /** - * 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. - * - * @return Resource collection API of TargetTypes. - */ - public TargetTypes targetTypes() { - if (this.targetTypes == null) { - this.targetTypes = new TargetTypesImpl(clientObject.getTargetTypes(), this); - } - return targetTypes; - } - - /** - * Gets the resource collection API of Targets. - * - * @return Resource collection API of Targets. - */ - public Targets targets() { - if (this.targets == null) { - this.targets = new TargetsImpl(clientObject.getTargets(), this); - } - return targets; - } - - /** - * @return Wrapped service client ChaosManagementClient providing direct access to the underlying auto-generated API - * implementation, based on Azure REST API. - */ - public ChaosManagementClient serviceClient() { - return this.clientObject; - } -} 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 deleted file mode 100644 index 9de7900898eea..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilitiesClient.java +++ /dev/null @@ -1,210 +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; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; - -/** An instance of this class provides access to all the operations defined in CapabilitiesClient. */ -public interface CapabilitiesClient { - /** - * 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 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 {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName); - - /** - * 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 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 {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - Context context); - - /** - * 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 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. - * @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 Capability resource that extends a Target resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context); - - /** - * 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 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. - * @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 Capability resource that extends a Target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityInner get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName); - - /** - * 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 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context); - - /** - * 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 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. - * @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 parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName); - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - CapabilityInner capability, - Context context); - - /** - * 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 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); -} 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 deleted file mode 100644 index 1bf7ffdeaf694..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/CapabilityTypesClient.java +++ /dev/null @@ -1,76 +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; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; - -/** An instance of this class provides access to all the operations defined in CapabilityTypesClient. */ -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 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 list of Capability Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, 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 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. - * @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 Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String locationName, 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 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. - * @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 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, Context context); - - /** - * Get a Capability Type resource for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 Capability Type resource for given Target Type and location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - CapabilityTypeInner get(String locationName, 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 deleted file mode 100644 index a0154a97764ed..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ChaosManagementClient.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent; - -import com.azure.core.http.HttpPipeline; -import java.time.Duration; - -/** The interface for ChaosManagementClient class. */ -public interface ChaosManagementClient { - /** - * Gets GUID that represents an Azure subscription ID. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - String getEndpoint(); - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - String getApiVersion(); - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - HttpPipeline getHttpPipeline(); - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - Duration getDefaultPollInterval(); - - /** - * Gets the CapabilitiesClient object to access its operations. - * - * @return the CapabilitiesClient object. - */ - CapabilitiesClient getCapabilities(); - - /** - * Gets the CapabilityTypesClient object to access its operations. - * - * @return the CapabilityTypesClient object. - */ - CapabilityTypesClient getCapabilityTypes(); - - /** - * Gets the ExperimentsClient object to access its operations. - * - * @return the ExperimentsClient object. - */ - ExperimentsClient getExperiments(); - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - OperationsClient getOperations(); - - /** - * Gets the TargetTypesClient object to access its operations. - * - * @return the TargetTypesClient object. - */ - TargetTypesClient getTargetTypes(); - - /** - * Gets the TargetsClient object to access its operations. - * - * @return the TargetsClient object. - */ - TargetsClient getTargets(); -} 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 deleted file mode 100644 index a33fb3e5d4298..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/ExperimentsClient.java +++ /dev/null @@ -1,362 +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; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import com.azure.resourcemanager.chaos.models.ExperimentUpdate; - -/** An instance of this class provides access to all the operations defined in ExperimentsClient. */ -public interface ExperimentsClient { - /** - * Get a list of Experiment resources in a subscription. - * - * @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 Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Boolean running, String continuationToken, Context context); - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse(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); - - /** - * Get 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 a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByResourceGroupWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Get 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 a Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentInner getByResourceGroup(String resourceGroupName, String experimentName); - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, String experimentName, ExperimentInner experiment, Context context); - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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); - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response updateWithResponse( - String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context); - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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); - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response cancelWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentCancelOperationResultInner cancel(String resourceGroupName, String experimentName); - - /** - * Start 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 model that represents the result of a start Experiment operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response startWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Start 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 model that represents the result of a start Experiment operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentStartOperationResultInner start(String resourceGroupName, String experimentName); - - /** - * Get a list of statuses of 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 a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAllStatuses(String resourceGroupName, String experimentName); - - /** - * Get a list of statuses of 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 a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAllStatuses( - String resourceGroupName, String experimentName, Context context); - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getStatusWithResponse( - String resourceGroupName, String experimentName, String statusId, Context context); - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentStatusInner getStatus(String resourceGroupName, String experimentName, String statusId); - - /** - * Get a list of execution details of 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 a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName); - - /** - * Get a list of execution details of 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 a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName, Context context); - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getExecutionDetailsWithResponse( - String resourceGroupName, String experimentName, String executionDetailsId, Context context); - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ExperimentExecutionDetailsInner getExecutionDetails( - String resourceGroupName, String experimentName, String executionDetailsId); -} 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 deleted file mode 100644 index fdd25c05ff159..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/OperationsClient.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public interface OperationsClient { - /** - * Get a list all available Operations. - * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listAll(); - - /** - * Get a list all available Operations. - * - * @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}. - */ - @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 deleted file mode 100644 index 46f1a4177d1fe..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetTypesClient.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; - -/** An instance of this class provides access to all the operations defined in TargetTypesClient. */ -public interface TargetTypesClient { - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName); - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String locationName, String continuationToken, Context context); - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String locationName, String targetTypeName, Context context); - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TargetTypeInner get(String locationName, 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 deleted file mode 100644 index a3ec48e28f4b0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/TargetsClient.java +++ /dev/null @@ -1,191 +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; - -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; - -/** An instance of this class provides access to all the operations defined in TargetsClient. */ -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. - * @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 resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName); - - /** - * 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 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 Target resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - Context context); - - /** - * 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 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. - * @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 resource that extends a tracked regional resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context); - - /** - * 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 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 Target resource that extends a tracked regional resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - TargetInner get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName); - - /** - * 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 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. - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response deleteWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context); - - /** - * 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 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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName); - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response createOrUpdateWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - TargetInner target, - Context context); - - /** - * 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 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); -} 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 deleted file mode 100644 index 32126fd4a0729..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityInner.java +++ /dev/null @@ -1,104 +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.Immutable; -import com.azure.core.management.ProxyResource; -import com.azure.core.management.SystemData; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents a Capability resource. */ -@Immutable -public final class CapabilityInner extends ProxyResource { - /* - * The standard system metadata of a resource type. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * The properties of a capability resource. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityProperties innerProperties; - - /** Creates an instance of CapabilityInner class. */ - public CapabilityInner() { - } - - /** - * Get the systemData property: The standard system metadata of a resource type. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the innerProperties property: The properties of a capability resource. - * - * @return the innerProperties value. - */ - private CapabilityProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the publisher property: String of the Publisher that this Capability extends. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Get the targetType property: String of the Target Type that this Capability extends. - * - * @return the targetType value. - */ - public String targetType() { - return this.innerProperties() == null ? null : this.innerProperties().targetType(); - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the parametersSchema property: URL to retrieve JSON schema of the Capability parameters. - * - * @return the parametersSchema value. - */ - public String parametersSchema() { - return this.innerProperties() == null ? null : this.innerProperties().parametersSchema(); - } - - /** - * Get the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - public String urn() { - return this.innerProperties() == null ? null : this.innerProperties().urn(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityProperties.java deleted file mode 100644 index 4970fe21a6cac..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityProperties.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.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents the Capability properties model. */ -@Immutable -public final class CapabilityProperties { - /* - * String of the Publisher that this Capability extends. - */ - @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * String of the Target Type that this Capability extends. - */ - @JsonProperty(value = "targetType", access = JsonProperty.Access.WRITE_ONLY) - private String targetType; - - /* - * Localized string of the description. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * URL to retrieve JSON schema of the Capability parameters. - */ - @JsonProperty(value = "parametersSchema", access = JsonProperty.Access.WRITE_ONLY) - private String parametersSchema; - - /* - * String of the URN for this Capability Type. - */ - @JsonProperty(value = "urn", access = JsonProperty.Access.WRITE_ONLY) - private String urn; - - /** Creates an instance of CapabilityProperties class. */ - public CapabilityProperties() { - } - - /** - * Get the publisher property: String of the Publisher that this Capability extends. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Get the targetType property: String of the Target Type that this Capability extends. - * - * @return the targetType value. - */ - public String targetType() { - return this.targetType; - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the parametersSchema property: URL to retrieve JSON schema of the Capability parameters. - * - * @return the parametersSchema value. - */ - public String parametersSchema() { - return this.parametersSchema; - } - - /** - * Get the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - public String urn() { - return this.urn; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 5fa57575bc576..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeInner.java +++ /dev/null @@ -1,219 +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.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.models.CapabilityTypePropertiesRuntimeProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a Capability Type resource. */ -@Fluent -public final class CapabilityTypeInner extends ProxyResource { - /* - * The system metadata properties of the capability type resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Location of the Capability Type resource. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The properties of the capability type resource. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private CapabilityTypeProperties innerProperties; - - /** Creates an instance of CapabilityTypeInner class. */ - 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. - * - * @param location the location value to set. - * @return the CapabilityTypeInner object itself. - */ - public CapabilityTypeInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the innerProperties property: The properties of the capability type resource. - * - * @return the innerProperties value. - */ - private CapabilityTypeProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the publisher property: String of the Publisher that this Capability Type extends. - * - * @return the publisher value. - */ - public String publisher() { - return this.innerProperties() == null ? null : this.innerProperties().publisher(); - } - - /** - * Get the targetType property: String of the Target Type that this Capability Type extends. - * - * @return the targetType value. - */ - public String targetType() { - return this.innerProperties() == null ? null : this.innerProperties().targetType(); - } - - /** - * Get the displayName property: Localized string of the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the parametersSchema property: URL to retrieve JSON schema of the Capability Type parameters. - * - * @return the parametersSchema value. - */ - public String parametersSchema() { - return this.innerProperties() == null ? null : this.innerProperties().parametersSchema(); - } - - /** - * Get the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - public String urn() { - return this.innerProperties() == null ? null : this.innerProperties().urn(); - } - - /** - * Get the kind property: String of the kind of this Capability Type. - * - * @return the kind value. - */ - public String kind() { - return this.innerProperties() == null ? null : this.innerProperties().kind(); - } - - /** - * Get the azureRbacActions property: Control plane actions necessary to execute capability type. - * - * @return the azureRbacActions value. - */ - 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. - * - * @return the azureRbacDataActions value. - */ - public List azureRbacDataActions() { - return this.innerProperties() == null ? null : this.innerProperties().azureRbacDataActions(); - } - - /** - * Set the azureRbacDataActions property: Data plane actions necessary to execute capability type. - * - * @param azureRbacDataActions the azureRbacDataActions value to set. - * @return the CapabilityTypeInner object itself. - */ - public CapabilityTypeInner withAzureRbacDataActions(List azureRbacDataActions) { - if (this.innerProperties() == null) { - this.innerProperties = new CapabilityTypeProperties(); - } - this.innerProperties().withAzureRbacDataActions(azureRbacDataActions); - return this; - } - - /** - * Get the runtimeProperties property: Runtime properties of this Capability Type. - * - * @return the runtimeProperties value. - */ - 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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} 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 deleted file mode 100644 index 5767a0f53322a..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/CapabilityTypeProperties.java +++ /dev/null @@ -1,212 +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.resourcemanager.chaos.models.CapabilityTypePropertiesRuntimeProperties; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the Capability Type properties model. */ -@Fluent -public final class CapabilityTypeProperties { - /* - * String of the Publisher that this Capability Type extends. - */ - @JsonProperty(value = "publisher", access = JsonProperty.Access.WRITE_ONLY) - private String publisher; - - /* - * String of the Target Type that this Capability Type extends. - */ - @JsonProperty(value = "targetType", access = JsonProperty.Access.WRITE_ONLY) - private String targetType; - - /* - * Localized string of the display name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Localized string of the description. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * URL to retrieve JSON schema of the Capability Type parameters. - */ - @JsonProperty(value = "parametersSchema", access = JsonProperty.Access.WRITE_ONLY) - private String parametersSchema; - - /* - * String of the URN for this Capability Type. - */ - @JsonProperty(value = "urn", access = JsonProperty.Access.WRITE_ONLY) - private String urn; - - /* - * String of the kind of this Capability Type. - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /* - * Control plane actions necessary to execute capability type. - */ - @JsonProperty(value = "azureRbacActions") - private List azureRbacActions; - - /* - * Data plane actions necessary to execute capability type. - */ - @JsonProperty(value = "azureRbacDataActions") - private List azureRbacDataActions; - - /* - * Runtime properties of this Capability Type. - */ - @JsonProperty(value = "runtimeProperties") - private CapabilityTypePropertiesRuntimeProperties runtimeProperties; - - /** Creates an instance of CapabilityTypeProperties class. */ - public CapabilityTypeProperties() { - } - - /** - * Get the publisher property: String of the Publisher that this Capability Type extends. - * - * @return the publisher value. - */ - public String publisher() { - return this.publisher; - } - - /** - * Get the targetType property: String of the Target Type that this Capability Type extends. - * - * @return the targetType value. - */ - public String targetType() { - return this.targetType; - } - - /** - * Get the displayName property: Localized string of the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the parametersSchema property: URL to retrieve JSON schema of the Capability Type parameters. - * - * @return the parametersSchema value. - */ - public String parametersSchema() { - return this.parametersSchema; - } - - /** - * Get the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - public String urn() { - return this.urn; - } - - /** - * Get the kind property: String of the kind of this Capability Type. - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Get the azureRbacActions property: Control plane actions necessary to execute capability type. - * - * @return the azureRbacActions value. - */ - 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. - * - * @return the azureRbacDataActions value. - */ - public List azureRbacDataActions() { - return this.azureRbacDataActions; - } - - /** - * Set the azureRbacDataActions property: Data plane actions necessary to execute capability type. - * - * @param azureRbacDataActions the azureRbacDataActions value to set. - * @return the CapabilityTypeProperties object itself. - */ - public CapabilityTypeProperties withAzureRbacDataActions(List azureRbacDataActions) { - this.azureRbacDataActions = azureRbacDataActions; - return this; - } - - /** - * Get the runtimeProperties property: Runtime properties of this Capability Type. - * - * @return the runtimeProperties value. - */ - 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. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (runtimeProperties() != null) { - runtimeProperties().validate(); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentCancelOperationResultInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentCancelOperationResultInner.java deleted file mode 100644 index 051a70ae06f43..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentCancelOperationResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents the result of a cancel Experiment operation. */ -@Immutable -public final class ExperimentCancelOperationResultInner { - /* - * String of the Experiment name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * URL to retrieve the Experiment status. - */ - @JsonProperty(value = "statusUrl", access = JsonProperty.Access.WRITE_ONLY) - private String statusUrl; - - /** Creates an instance of ExperimentCancelOperationResultInner class. */ - public ExperimentCancelOperationResultInner() { - } - - /** - * Get the name property: String of the Experiment name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the statusUrl property: URL to retrieve the Experiment status. - * - * @return the statusUrl value. - */ - public String statusUrl() { - return this.statusUrl; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index 0df49eb47164c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsInner.java +++ /dev/null @@ -1,161 +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.Immutable; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Model that represents the execution details of a Experiment. */ -@Immutable -public final class ExperimentExecutionDetailsInner { - /* - * String of the resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * String of the fully qualified resource ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * String of the resource name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The properties of the experiment execution details. - */ - @JsonProperty(value = "properties", access = JsonProperty.Access.WRITE_ONLY) - private ExperimentExecutionDetailsProperties innerProperties; - - /** Creates an instance of ExperimentExecutionDetailsInner class. */ - public ExperimentExecutionDetailsInner() { - } - - /** - * Get the type property: String of the resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the id property: String of the fully qualified resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: String of the resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the innerProperties property: The properties of the experiment execution details. - * - * @return the innerProperties value. - */ - private ExperimentExecutionDetailsProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the experimentId property: The id of the experiment. - * - * @return the experimentId value. - */ - public String experimentId() { - return this.innerProperties() == null ? null : this.innerProperties().experimentId(); - } - - /** - * Get the status property: The value of the status of the experiment execution. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the failureReason property: The reason why the execution failed. - * - * @return the failureReason value. - */ - public String failureReason() { - return this.innerProperties() == null ? null : this.innerProperties().failureReason(); - } - - /** - * Get the createdDateTime property: String that represents the created date time. - * - * @return the createdDateTime value. - */ - public OffsetDateTime createdDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().createdDateTime(); - } - - /** - * Get the lastActionDateTime property: String that represents the last action date time. - * - * @return the lastActionDateTime value. - */ - public OffsetDateTime lastActionDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().lastActionDateTime(); - } - - /** - * Get the startDateTime property: String that represents the start date time. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().startDateTime(); - } - - /** - * Get the stopDateTime property: String that represents the stop date time. - * - * @return the stopDateTime value. - */ - public OffsetDateTime stopDateTime() { - return this.innerProperties() == null ? null : this.innerProperties().stopDateTime(); - } - - /** - * Get the runInformation property: The information of the experiment run. - * - * @return the runInformation value. - */ - public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { - return this.innerProperties() == null ? null : this.innerProperties().runInformation(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} 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/fluent/models/ExperimentExecutionDetailsProperties.java deleted file mode 100644 index 4ef82667e0726..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentExecutionDetailsProperties.java +++ /dev/null @@ -1,149 +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.Immutable; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsPropertiesRunInformation; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Model that represents the Experiment execution details properties model. */ -@Immutable -public final class ExperimentExecutionDetailsProperties { - /* - * The id of the experiment. - */ - @JsonProperty(value = "experimentId", access = JsonProperty.Access.WRITE_ONLY) - private String experimentId; - - /* - * The value of the status of the experiment execution. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The reason why the execution failed. - */ - @JsonProperty(value = "failureReason", access = JsonProperty.Access.WRITE_ONLY) - private String failureReason; - - /* - * String that represents the created date time. - */ - @JsonProperty(value = "createdDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDateTime; - - /* - * String that represents the last action date time. - */ - @JsonProperty(value = "lastActionDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime lastActionDateTime; - - /* - * String that represents the start date time. - */ - @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startDateTime; - - /* - * String that represents the stop date time. - */ - @JsonProperty(value = "stopDateTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime stopDateTime; - - /* - * The information of the experiment run. - */ - @JsonProperty(value = "runInformation", access = JsonProperty.Access.WRITE_ONLY) - private ExperimentExecutionDetailsPropertiesRunInformation runInformation; - - /** Creates an instance of ExperimentExecutionDetailsProperties class. */ - public ExperimentExecutionDetailsProperties() { - } - - /** - * Get the experimentId property: The id of the experiment. - * - * @return the experimentId value. - */ - public String experimentId() { - return this.experimentId; - } - - /** - * Get the status property: The value of the status of the experiment execution. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the failureReason property: The reason why the execution failed. - * - * @return the failureReason value. - */ - public String failureReason() { - return this.failureReason; - } - - /** - * Get the createdDateTime property: String that represents the created date time. - * - * @return the createdDateTime value. - */ - public OffsetDateTime createdDateTime() { - return this.createdDateTime; - } - - /** - * Get the lastActionDateTime property: String that represents the last action date time. - * - * @return the lastActionDateTime value. - */ - public OffsetDateTime lastActionDateTime() { - return this.lastActionDateTime; - } - - /** - * Get the startDateTime property: String that represents the start date time. - * - * @return the startDateTime value. - */ - public OffsetDateTime startDateTime() { - return this.startDateTime; - } - - /** - * Get the stopDateTime property: String that represents the stop date time. - * - * @return the stopDateTime value. - */ - public OffsetDateTime stopDateTime() { - return this.stopDateTime; - } - - /** - * Get the runInformation property: The information of the experiment run. - * - * @return the runInformation value. - */ - public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { - return this.runInformation; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (runInformation() != null) { - runInformation().validate(); - } - } -} 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 deleted file mode 100644 index 6e8ea34c269d7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentInner.java +++ /dev/null @@ -1,185 +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.Resource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; -import java.util.Map; - -/** Model that represents a Experiment resource. */ -@Fluent -public final class ExperimentInner extends Resource { - /* - * The system metadata of the experiment resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * The identity of the experiment resource. - */ - @JsonProperty(value = "identity") - private ResourceIdentity identity; - - /* - * The properties of the experiment resource. - */ - @JsonProperty(value = "properties", required = true) - private ExperimentProperties innerProperties = new ExperimentProperties(); - - /** Creates an instance of ExperimentInner class. */ - 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. - * - * @return the identity value. - */ - public ResourceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the experiment resource. - * - * @param identity the identity value to set. - * @return the ExperimentInner object itself. - */ - public ExperimentInner withIdentity(ResourceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Get the innerProperties property: The properties of the experiment resource. - * - * @return the innerProperties value. - */ - private ExperimentProperties innerProperties() { - return this.innerProperties; - } - - /** {@inheritDoc} */ - @Override - public ExperimentInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** {@inheritDoc} */ - @Override - public ExperimentInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the steps property: List of steps. - * - * @return the steps value. - */ - public List steps() { - return this.innerProperties() == null ? null : this.innerProperties().steps(); - } - - /** - * Set the steps property: List of steps. - * - * @param steps the steps value to set. - * @return the ExperimentInner object itself. - */ - public ExperimentInner withSteps(List steps) { - if (this.innerProperties() == null) { - this.innerProperties = new ExperimentProperties(); - } - this.innerProperties().withSteps(steps); - return this; - } - - /** - * Get the selectors property: List of selectors. - * - * @return the selectors value. - */ - public List selectors() { - return this.innerProperties() == null ? null : this.innerProperties().selectors(); - } - - /** - * Set the selectors property: List of selectors. - * - * @param selectors the selectors value to set. - * @return the ExperimentInner object itself. - */ - public ExperimentInner withSelectors(List selectors) { - if (this.innerProperties() == null) { - this.innerProperties = new ExperimentProperties(); - } - this.innerProperties().withSelectors(selectors); - return this; - } - - /** - * Get the startOnCreation property: A boolean value that indicates if experiment should be started on creation or - * not. - * - * @return the startOnCreation value. - */ - public Boolean startOnCreation() { - return this.innerProperties() == null ? null : this.innerProperties().startOnCreation(); - } - - /** - * Set the startOnCreation property: A boolean value that indicates if experiment should be started on creation or - * not. - * - * @param startOnCreation the startOnCreation value to set. - * @return the ExperimentInner object itself. - */ - public ExperimentInner withStartOnCreation(Boolean startOnCreation) { - if (this.innerProperties() == null) { - this.innerProperties = new ExperimentProperties(); - } - this.innerProperties().withStartOnCreation(startOnCreation); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model ExperimentInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ExperimentInner.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentProperties.java deleted file mode 100644 index 81e0dcaf89e35..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentProperties.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the Experiment properties model. */ -@Fluent -public final class ExperimentProperties { - /* - * List of steps. - */ - @JsonProperty(value = "steps", required = true) - private List steps; - - /* - * List of selectors. - */ - @JsonProperty(value = "selectors", required = true) - private List selectors; - - /* - * A boolean value that indicates if experiment should be started on creation or not. - */ - @JsonProperty(value = "startOnCreation") - private Boolean startOnCreation; - - /** Creates an instance of ExperimentProperties class. */ - public ExperimentProperties() { - } - - /** - * Get the steps property: List of steps. - * - * @return the steps value. - */ - public List steps() { - return this.steps; - } - - /** - * Set the steps property: List of steps. - * - * @param steps the steps value to set. - * @return the ExperimentProperties object itself. - */ - public ExperimentProperties withSteps(List steps) { - this.steps = steps; - return this; - } - - /** - * Get the selectors property: List of selectors. - * - * @return the selectors value. - */ - public List selectors() { - return this.selectors; - } - - /** - * Set the selectors property: List of selectors. - * - * @param selectors the selectors value to set. - * @return the ExperimentProperties object itself. - */ - public ExperimentProperties withSelectors(List selectors) { - this.selectors = selectors; - return this; - } - - /** - * Get the startOnCreation property: A boolean value that indicates if experiment should be started on creation or - * not. - * - * @return the startOnCreation value. - */ - public Boolean startOnCreation() { - return this.startOnCreation; - } - - /** - * Set the startOnCreation property: A boolean value that indicates if experiment should be started on creation or - * not. - * - * @param startOnCreation the startOnCreation value to set. - * @return the ExperimentProperties object itself. - */ - public ExperimentProperties withStartOnCreation(Boolean startOnCreation) { - this.startOnCreation = startOnCreation; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (steps() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property steps in model ExperimentProperties")); - } else { - steps().forEach(e -> e.validate()); - } - if (selectors() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property selectors in model ExperimentProperties")); - } else { - selectors().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ExperimentProperties.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java deleted file mode 100644 index 03dc806d31cd5..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStartOperationResultInner.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.fluent.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents the result of a start Experiment operation. */ -@Immutable -public final class ExperimentStartOperationResultInner { - /* - * String of the Experiment name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * URL to retrieve the Experiment status. - */ - @JsonProperty(value = "statusUrl", access = JsonProperty.Access.WRITE_ONLY) - private String statusUrl; - - /** Creates an instance of ExperimentStartOperationResultInner class. */ - public ExperimentStartOperationResultInner() { - } - - /** - * Get the name property: String of the Experiment name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the statusUrl property: URL to retrieve the Experiment status. - * - * @return the statusUrl value. - */ - public String statusUrl() { - return this.statusUrl; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusInner.java deleted file mode 100644 index 9d65b12242b61..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusInner.java +++ /dev/null @@ -1,115 +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.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Model that represents the status of a Experiment. */ -@Immutable -public final class ExperimentStatusInner { - /* - * String of the resource type. - */ - @JsonProperty(value = "type", access = JsonProperty.Access.WRITE_ONLY) - private String type; - - /* - * String of the fully qualified resource ID. - */ - @JsonProperty(value = "id", access = JsonProperty.Access.WRITE_ONLY) - private String id; - - /* - * String of the resource name. - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * The properties of experiment execution status. - */ - @JsonProperty(value = "properties") - private ExperimentStatusProperties innerProperties; - - /** Creates an instance of ExperimentStatusInner class. */ - public ExperimentStatusInner() { - } - - /** - * Get the type property: String of the resource type. - * - * @return the type value. - */ - public String type() { - return this.type; - } - - /** - * Get the id property: String of the fully qualified resource ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Get the name property: String of the resource name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the innerProperties property: The properties of experiment execution status. - * - * @return the innerProperties value. - */ - private ExperimentStatusProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the status property: String that represents the status of a Experiment. - * - * @return the status value. - */ - public String status() { - return this.innerProperties() == null ? null : this.innerProperties().status(); - } - - /** - * Get the createdDateUtc property: String that represents the created date time of a Experiment. - * - * @return the createdDateUtc value. - */ - public OffsetDateTime createdDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().createdDateUtc(); - } - - /** - * Get the endDateUtc property: String that represents the end date time of a Experiment. - * - * @return the endDateUtc value. - */ - public OffsetDateTime endDateUtc() { - return this.innerProperties() == null ? null : this.innerProperties().endDateUtc(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() != null) { - innerProperties().validate(); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java deleted file mode 100644 index cef7dca7b1fbb..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/ExperimentStatusProperties.java +++ /dev/null @@ -1,70 +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.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Model that represents the Experiment status properties model. */ -@Immutable -public final class ExperimentStatusProperties { - /* - * String that represents the status of a Experiment. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * String that represents the created date time of a Experiment. - */ - @JsonProperty(value = "createdDateUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime createdDateUtc; - - /* - * String that represents the end date time of a Experiment. - */ - @JsonProperty(value = "endDateUtc", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endDateUtc; - - /** Creates an instance of ExperimentStatusProperties class. */ - public ExperimentStatusProperties() { - } - - /** - * Get the status property: String that represents the status of a Experiment. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the createdDateUtc property: String that represents the created date time of a Experiment. - * - * @return the createdDateUtc value. - */ - public OffsetDateTime createdDateUtc() { - return this.createdDateUtc; - } - - /** - * Get the endDateUtc property: String that represents the end date time of a Experiment. - * - * @return the endDateUtc value. - */ - public OffsetDateTime endDateUtc() { - return this.endDateUtc; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationInner.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationInner.java deleted file mode 100644 index e710daaf81ae3..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/OperationInner.java +++ /dev/null @@ -1,127 +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.resourcemanager.chaos.models.ActionType; -import com.azure.resourcemanager.chaos.models.OperationDisplay; -import com.azure.resourcemanager.chaos.models.Origin; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** - * REST API Operation - * - *

Details of a REST API operation, returned from the Resource Provider Operations API. - */ -@Fluent -public final class OperationInner { - /* - * The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" - */ - @JsonProperty(value = "name", access = JsonProperty.Access.WRITE_ONLY) - private String name; - - /* - * Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for - * ARM/control-plane operations. - */ - @JsonProperty(value = "isDataAction", access = JsonProperty.Access.WRITE_ONLY) - private Boolean isDataAction; - - /* - * Localized display information for this particular operation. - */ - @JsonProperty(value = "display") - private OperationDisplay display; - - /* - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default - * value is "user,system" - */ - @JsonProperty(value = "origin", access = JsonProperty.Access.WRITE_ONLY) - private Origin origin; - - /* - * Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. - */ - @JsonProperty(value = "actionType", access = JsonProperty.Access.WRITE_ONLY) - private ActionType actionType; - - /** Creates an instance of OperationInner class. */ - public OperationInner() { - } - - /** - * Get the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Get the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - public Boolean isDataAction() { - return this.isDataAction; - } - - /** - * Get the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - public OperationDisplay display() { - return this.display; - } - - /** - * Set the display property: Localized display information for this particular operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - - /** - * Get the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - public Origin origin() { - return this.origin; - } - - /** - * Get the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - public ActionType actionType() { - return this.actionType; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (display() != null) { - display().validate(); - } - } -} 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 deleted file mode 100644 index 7145cd04d0680..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetInner.java +++ /dev/null @@ -1,104 +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.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** Model that represents a Target resource. */ -@Fluent -public final class TargetInner extends ProxyResource { - /* - * The system metadata of the target resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Location of the target resource. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The properties of the target resource. - */ - @JsonProperty(value = "properties", required = true) - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map properties; - - /** Creates an instance of TargetInner class. */ - public TargetInner() { - } - - /** - * Get the systemData property: The system metadata of the target resource. - * - * @return the systemData value. - */ - public SystemData systemData() { - return this.systemData; - } - - /** - * Get the location property: Location of the target resource. - * - * @return the location value. - */ - public String location() { - return this.location; - } - - /** - * Set the location property: Location of the target resource. - * - * @param location the location value to set. - * @return the TargetInner object itself. - */ - public TargetInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * 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. - * - * @param properties the properties value to set. - * @return the TargetInner object itself. - */ - public TargetInner withProperties(Map properties) { - this.properties = properties; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (properties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property properties in model TargetInner")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TargetInner.class); -} 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 deleted file mode 100644 index d96b2afce917e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeInner.java +++ /dev/null @@ -1,129 +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.ProxyResource; -import com.azure.core.management.SystemData; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a Target Type resource. */ -@Fluent -public final class TargetTypeInner extends ProxyResource { - /* - * The system metadata properties of the target type resource. - */ - @JsonProperty(value = "systemData", access = JsonProperty.Access.WRITE_ONLY) - private SystemData systemData; - - /* - * Location of the Target Type resource. - */ - @JsonProperty(value = "location") - private String location; - - /* - * The properties of the target type resource. - */ - @JsonProperty(value = "properties", required = true) - private TargetTypeProperties innerProperties = new TargetTypeProperties(); - - /** Creates an instance of TargetTypeInner class. */ - 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. - * - * @param location the location value to set. - * @return the TargetTypeInner object itself. - */ - public TargetTypeInner withLocation(String location) { - this.location = location; - return this; - } - - /** - * Get the innerProperties property: The properties of the target type resource. - * - * @return the innerProperties value. - */ - private TargetTypeProperties innerProperties() { - return this.innerProperties; - } - - /** - * Get the displayName property: Localized string of the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.innerProperties() == null ? null : this.innerProperties().displayName(); - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.innerProperties() == null ? null : this.innerProperties().description(); - } - - /** - * Get the propertiesSchema property: URL to retrieve JSON schema of the Target Type properties. - * - * @return the propertiesSchema value. - */ - public String propertiesSchema() { - return this.innerProperties() == null ? null : this.innerProperties().propertiesSchema(); - } - - /** - * Get the resourceTypes property: List of resource types this Target Type can extend. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.innerProperties() == null ? null : this.innerProperties().resourceTypes(); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (innerProperties() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property innerProperties in model TargetTypeInner")); - } else { - innerProperties().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TargetTypeInner.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeProperties.java deleted file mode 100644 index 9bc624dedb5c0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/TargetTypeProperties.java +++ /dev/null @@ -1,85 +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.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the base Target Type properties model. */ -@Immutable -public final class TargetTypeProperties { - /* - * Localized string of the display name. - */ - @JsonProperty(value = "displayName", access = JsonProperty.Access.WRITE_ONLY) - private String displayName; - - /* - * Localized string of the description. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /* - * URL to retrieve JSON schema of the Target Type properties. - */ - @JsonProperty(value = "propertiesSchema", access = JsonProperty.Access.WRITE_ONLY) - private String propertiesSchema; - - /* - * List of resource types this Target Type can extend. - */ - @JsonProperty(value = "resourceTypes", access = JsonProperty.Access.WRITE_ONLY) - private List resourceTypes; - - /** Creates an instance of TargetTypeProperties class. */ - public TargetTypeProperties() { - } - - /** - * Get the displayName property: Localized string of the display name. - * - * @return the displayName value. - */ - public String displayName() { - return this.displayName; - } - - /** - * Get the description property: Localized string of the description. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Get the propertiesSchema property: URL to retrieve JSON schema of the Target Type properties. - * - * @return the propertiesSchema value. - */ - public String propertiesSchema() { - return this.propertiesSchema; - } - - /** - * Get the resourceTypes property: List of resource types this Target Type can extend. - * - * @return the resourceTypes value. - */ - public List resourceTypes() { - return this.resourceTypes; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/package-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/package-info.java deleted file mode 100644 index 528b3b0bc9607..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the inner data models for ChaosManagementClient. Chaos Management Client. */ -package com.azure.resourcemanager.chaos.fluent.models; diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/package-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/package-info.java deleted file mode 100644 index 80b2eb1aca618..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/fluent/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the service clients for ChaosManagementClient. Chaos Management Client. */ -package com.azure.resourcemanager.chaos.fluent; 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 deleted file mode 100644 index d9f1e9571315e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesClientImpl.java +++ /dev/null @@ -1,1348 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.CapabilitiesClient; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.azure.resourcemanager.chaos.models.CapabilityListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CapabilitiesClient. */ -public final class CapabilitiesClientImpl implements CapabilitiesClient { - /** The proxy service used to perform REST calls. */ - private final CapabilitiesService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of CapabilitiesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CapabilitiesClientImpl(ChaosManagementClientImpl client) { - this.service = - RestProxy.create(CapabilitiesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientCapabilities to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface CapabilitiesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @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, - @QueryParam("continuationToken") String continuationToken, - @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}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @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); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}/capabilities/{capabilityName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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, - @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}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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, - @BodyParam("application/json") CapabilityInner capability, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * 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 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 - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken) { - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - 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())); - } - - /** - * 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 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 - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName 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(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken, - 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.. - * - * @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 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 {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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 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 {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - final String continuationToken = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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 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 {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * 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 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 {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - final String continuationToken = null; - return new PagedIterable<>( - listAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken)); - } - - /** - * 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 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 {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken, - context)); - } - - /** - * 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 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. - * @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 Capability resource that extends a Target resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - if (capabilityName == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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. - * @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 Capability resource that extends a Target resource along with {@link Response} on successful completion - * of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - if (capabilityName == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - accept, - context); - } - - /** - * 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 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. - * @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 Capability resource that extends a Target resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName) { - return getWithResponseAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 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. - * @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 Capability resource that extends a Target resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context) { - return getWithResponseAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - context) - .block(); - } - - /** - * 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 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. - * @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 Capability resource that extends a Target resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public CapabilityInner get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName) { - return getWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - Context.NONE) - .getValue(); - } - - /** - * 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 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. - * @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 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - if (capabilityName == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityName 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, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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. - * @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 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - if (capabilityName == null) { - return Mono.error(new IllegalArgumentException("Parameter capabilityName 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, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - accept, - context); - } - - /** - * 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 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. - * @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 parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName) { - return deleteWithResponseAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName) - .flatMap(ignored -> Mono.empty()); - } - - /** - * 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 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. - * @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}. - */ - @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(); - } - - /** - * 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 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. - * @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 parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName) { - deleteWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - Context.NONE); - } - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - CapabilityInner capability) { - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - 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(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - capability, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - CapabilityInner capability, - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - 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); - } - - /** - * 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 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}. - */ - @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())); - } - - /** - * 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 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}. - */ - @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(); - } - - /** - * 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 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(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Capability resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Capability resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 deleted file mode 100644 index 524e853d9a4c6..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilitiesImpl.java +++ /dev/null @@ -1,222 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.CapabilitiesClient; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.azure.resourcemanager.chaos.models.Capabilities; -import com.azure.resourcemanager.chaos.models.Capability; - -public final class CapabilitiesImpl implements Capabilities { - private static final ClientLogger LOGGER = new ClientLogger(CapabilitiesImpl.class); - - private final CapabilitiesClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public CapabilitiesImpl( - CapabilitiesClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); - return Utils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - continuationToken, - context); - return Utils.mapPage(inner, inner1 -> new CapabilityImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CapabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Capability get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName) { - CapabilityInner inner = - this - .serviceClient() - .get( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName); - if (inner != null) { - return new CapabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - 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) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - capability, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CapabilityImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Capability createOrUpdate( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - CapabilityInner capability) { - CapabilityInner inner = - this - .serviceClient() - .createOrUpdate( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - capabilityName, - capability); - if (inner != null) { - return new CapabilityImpl(inner, this.manager()); - } else { - return null; - } - } - - private CapabilitiesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityImpl.java deleted file mode 100644 index 1fae5a86f13a8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityImpl.java +++ /dev/null @@ -1,64 +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.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.azure.resourcemanager.chaos.models.Capability; - -public final class CapabilityImpl implements Capability { - private CapabilityInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - CapabilityImpl(CapabilityInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String targetType() { - return this.innerModel().targetType(); - } - - public String description() { - return this.innerModel().description(); - } - - public String parametersSchema() { - return this.innerModel().parametersSchema(); - } - - public String urn() { - return this.innerModel().urn(); - } - - public CapabilityInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index c6076205a25af..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypeImpl.java +++ /dev/null @@ -1,101 +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.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import com.azure.resourcemanager.chaos.models.CapabilityType; -import com.azure.resourcemanager.chaos.models.CapabilityTypePropertiesRuntimeProperties; -import java.util.Collections; -import java.util.List; - -public final class CapabilityTypeImpl implements CapabilityType { - private CapabilityTypeInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - CapabilityTypeImpl(CapabilityTypeInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String location() { - return this.innerModel().location(); - } - - public String publisher() { - return this.innerModel().publisher(); - } - - public String targetType() { - return this.innerModel().targetType(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String parametersSchema() { - return this.innerModel().parametersSchema(); - } - - public String urn() { - return this.innerModel().urn(); - } - - public String kind() { - return this.innerModel().kind(); - } - - public List azureRbacActions() { - List inner = this.innerModel().azureRbacActions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List azureRbacDataActions() { - List inner = this.innerModel().azureRbacDataActions(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public CapabilityTypePropertiesRuntimeProperties runtimeProperties() { - return this.innerModel().runtimeProperties(); - } - - public CapabilityTypeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index fb5359984b2c1..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesClientImpl.java +++ /dev/null @@ -1,543 +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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.CapabilityTypesClient; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import com.azure.resourcemanager.chaos.models.CapabilityTypeListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in CapabilityTypesClient. */ -public final class CapabilityTypesClientImpl implements CapabilityTypesClient { - /** The proxy service used to perform REST calls. */ - private final CapabilityTypesService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of CapabilityTypesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - CapabilityTypesClientImpl(ChaosManagementClientImpl client) { - this.service = - RestProxy.create(CapabilityTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientCapabilityTypes to be used by the proxy service - * to perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface CapabilityTypesService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/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, - @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}") - @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("capabilityTypeName") String capabilityTypeName, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of Capability Type resources for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 Type resources for given Target Type and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String targetTypeName, String continuationToken) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName 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, - 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())); - } - - /** - * Get a list of Capability Type resources for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 Type resources for given Target Type and location along with {@link PagedResponse} - * on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String targetTypeName, String continuationToken, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName 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, - targetTypeName, - continuationToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of Capability Type resources for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 Type resources for given Target Type and location as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String locationName, String targetTypeName, String continuationToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, 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 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Capability Type resources for given Target Type and location as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName, String targetTypeName) { - final String continuationToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, 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 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. - * @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 Type resources for given Target Type and location as paginated response with {@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), - 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 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Capability Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName, String targetTypeName) { - final String continuationToken = null; - return new PagedIterable<>(listAsync(locationName, 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 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. - * @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 Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String locationName, String targetTypeName, String continuationToken, Context context) { - return new PagedIterable<>(listAsync(locationName, targetTypeName, continuationToken, context)); - } - - /** - * Get a Capability Type resource for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 Capability Type resource for given Target Type and location along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String targetTypeName, String capabilityTypeName) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); - } - if (capabilityTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityTypeName is required and cannot be null.")); - } - 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)) - .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 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. - * @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 Capability Type resource for given Target Type and location along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String targetTypeName, String capabilityTypeName, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); - } - if (capabilityTypeName == null) { - return Mono - .error(new IllegalArgumentException("Parameter capabilityTypeName is required and cannot be null.")); - } - 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); - } - - /** - * Get a Capability Type resource for given Target Type and location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 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) - .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 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. - * @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 Capability Type resource for given Target Type and location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String locationName, String targetTypeName, String capabilityTypeName, Context context) { - return getWithResponseAsync(locationName, 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 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. - * @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 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(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Capability Type resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Capability Type resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 deleted file mode 100644 index d846aab402ea6..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/CapabilityTypesImpl.java +++ /dev/null @@ -1,73 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.CapabilityTypesClient; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import com.azure.resourcemanager.chaos.models.CapabilityType; -import com.azure.resourcemanager.chaos.models.CapabilityTypes; - -public final class CapabilityTypesImpl implements CapabilityTypes { - private static final ClientLogger LOGGER = new ClientLogger(CapabilityTypesImpl.class); - - private final CapabilityTypesClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public CapabilityTypesImpl( - CapabilityTypesClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String locationName, String targetTypeName) { - PagedIterable inner = this.serviceClient().list(locationName, targetTypeName); - return Utils.mapPage(inner, inner1 -> new CapabilityTypeImpl(inner1, this.manager())); - } - - public PagedIterable list( - String locationName, String targetTypeName, String continuationToken, Context context) { - PagedIterable inner = - this.serviceClient().list(locationName, targetTypeName, continuationToken, context); - return Utils.mapPage(inner, inner1 -> new CapabilityTypeImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String locationName, String targetTypeName, String capabilityTypeName, Context context) { - Response inner = - this.serviceClient().getWithResponse(locationName, targetTypeName, capabilityTypeName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new CapabilityTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public CapabilityType get(String locationName, String targetTypeName, String capabilityTypeName) { - CapabilityTypeInner inner = this.serviceClient().get(locationName, targetTypeName, capabilityTypeName); - if (inner != null) { - return new CapabilityTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - private CapabilityTypesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index ed74ff20611a7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientBuilder.java +++ /dev/null @@ -1,144 +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.implementation; - -import com.azure.core.annotation.ServiceClientBuilder; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.http.policy.RetryPolicy; -import com.azure.core.http.policy.UserAgentPolicy; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.serializer.SerializerFactory; -import com.azure.core.util.serializer.SerializerAdapter; -import java.time.Duration; - -/** A builder for creating a new instance of the ChaosManagementClientImpl type. */ -@ServiceClientBuilder(serviceClients = {ChaosManagementClientImpl.class}) -public final class ChaosManagementClientBuilder { - /* - * GUID that represents an Azure subscription ID. - */ - private String subscriptionId; - - /** - * Sets GUID that represents an Azure subscription ID. - * - * @param subscriptionId the subscriptionId value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; - return this; - } - - /* - * server parameter - */ - private String endpoint; - - /** - * Sets server parameter. - * - * @param endpoint the endpoint value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; - return this; - } - - /* - * The environment to connect to - */ - private AzureEnvironment environment; - - /** - * Sets The environment to connect to. - * - * @param environment the environment value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder environment(AzureEnvironment environment) { - this.environment = environment; - return this; - } - - /* - * The HTTP pipeline to send requests through - */ - private HttpPipeline pipeline; - - /** - * Sets The HTTP pipeline to send requests through. - * - * @param pipeline the pipeline value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder pipeline(HttpPipeline pipeline) { - this.pipeline = pipeline; - return this; - } - - /* - * The default poll interval for long-running operation - */ - private Duration defaultPollInterval; - - /** - * Sets The default poll interval for long-running operation. - * - * @param defaultPollInterval the defaultPollInterval value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder defaultPollInterval(Duration defaultPollInterval) { - this.defaultPollInterval = defaultPollInterval; - return this; - } - - /* - * The serializer to serialize an object into a string - */ - private SerializerAdapter serializerAdapter; - - /** - * Sets The serializer to serialize an object into a string. - * - * @param serializerAdapter the serializerAdapter value. - * @return the ChaosManagementClientBuilder. - */ - public ChaosManagementClientBuilder serializerAdapter(SerializerAdapter serializerAdapter) { - this.serializerAdapter = serializerAdapter; - return this; - } - - /** - * Builds an instance of ChaosManagementClientImpl with the provided parameters. - * - * @return an instance of ChaosManagementClientImpl. - */ - public ChaosManagementClientImpl buildClient() { - String localEndpoint = (endpoint != null) ? endpoint : "https://management.azure.com"; - AzureEnvironment localEnvironment = (environment != null) ? environment : AzureEnvironment.AZURE; - HttpPipeline localPipeline = - (pipeline != null) - ? pipeline - : new HttpPipelineBuilder().policies(new UserAgentPolicy(), new RetryPolicy()).build(); - Duration localDefaultPollInterval = - (defaultPollInterval != null) ? defaultPollInterval : Duration.ofSeconds(30); - SerializerAdapter localSerializerAdapter = - (serializerAdapter != null) - ? serializerAdapter - : SerializerFactory.createDefaultManagementSerializerAdapter(); - ChaosManagementClientImpl client = - new ChaosManagementClientImpl( - localPipeline, - localSerializerAdapter, - localDefaultPollInterval, - localEnvironment, - subscriptionId, - localEndpoint); - return client; - } -} 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 deleted file mode 100644 index c07707c92a9db..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ChaosManagementClientImpl.java +++ /dev/null @@ -1,360 +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.implementation; - -import com.azure.core.annotation.ServiceClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.Response; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.exception.ManagementError; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.management.polling.PollResult; -import com.azure.core.management.polling.PollerFactory; -import com.azure.core.util.Context; -import com.azure.core.util.CoreUtils; -import com.azure.core.util.logging.ClientLogger; -import com.azure.core.util.polling.AsyncPollResponse; -import com.azure.core.util.polling.LongRunningOperationStatus; -import com.azure.core.util.polling.PollerFlux; -import com.azure.core.util.serializer.SerializerAdapter; -import com.azure.core.util.serializer.SerializerEncoding; -import com.azure.resourcemanager.chaos.fluent.CapabilitiesClient; -import com.azure.resourcemanager.chaos.fluent.CapabilityTypesClient; -import com.azure.resourcemanager.chaos.fluent.ChaosManagementClient; -import com.azure.resourcemanager.chaos.fluent.ExperimentsClient; -import com.azure.resourcemanager.chaos.fluent.OperationsClient; -import com.azure.resourcemanager.chaos.fluent.TargetTypesClient; -import com.azure.resourcemanager.chaos.fluent.TargetsClient; -import java.io.IOException; -import java.lang.reflect.Type; -import java.nio.ByteBuffer; -import java.nio.charset.Charset; -import java.nio.charset.StandardCharsets; -import java.time.Duration; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -/** Initializes a new instance of the ChaosManagementClientImpl type. */ -@ServiceClient(builder = ChaosManagementClientBuilder.class) -public final class ChaosManagementClientImpl implements ChaosManagementClient { - /** GUID that represents an Azure subscription ID. */ - private final String subscriptionId; - - /** - * Gets GUID that represents an Azure subscription ID. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** server parameter. */ - private final String endpoint; - - /** - * Gets server parameter. - * - * @return the endpoint value. - */ - public String getEndpoint() { - return this.endpoint; - } - - /** Api Version. */ - private final String apiVersion; - - /** - * Gets Api Version. - * - * @return the apiVersion value. - */ - public String getApiVersion() { - return this.apiVersion; - } - - /** The HTTP pipeline to send requests through. */ - private final HttpPipeline httpPipeline; - - /** - * Gets The HTTP pipeline to send requests through. - * - * @return the httpPipeline value. - */ - public HttpPipeline getHttpPipeline() { - return this.httpPipeline; - } - - /** The serializer to serialize an object into a string. */ - private final SerializerAdapter serializerAdapter; - - /** - * Gets The serializer to serialize an object into a string. - * - * @return the serializerAdapter value. - */ - SerializerAdapter getSerializerAdapter() { - return this.serializerAdapter; - } - - /** The default poll interval for long-running operation. */ - private final Duration defaultPollInterval; - - /** - * Gets The default poll interval for long-running operation. - * - * @return the defaultPollInterval value. - */ - public Duration getDefaultPollInterval() { - return this.defaultPollInterval; - } - - /** 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. */ - private final CapabilityTypesClient capabilityTypes; - - /** - * Gets the CapabilityTypesClient object to access its operations. - * - * @return the CapabilityTypesClient object. - */ - public CapabilityTypesClient getCapabilityTypes() { - return this.capabilityTypes; - } - - /** The ExperimentsClient object to access its operations. */ - private final ExperimentsClient experiments; - - /** - * Gets the ExperimentsClient object to access its operations. - * - * @return the ExperimentsClient object. - */ - public ExperimentsClient getExperiments() { - return this.experiments; - } - - /** The OperationsClient object to access its operations. */ - private final OperationsClient operations; - - /** - * Gets the OperationsClient object to access its operations. - * - * @return the OperationsClient object. - */ - public OperationsClient getOperations() { - return this.operations; - } - - /** The TargetTypesClient object to access its operations. */ - private final TargetTypesClient targetTypes; - - /** - * Gets the TargetTypesClient object to access its operations. - * - * @return the TargetTypesClient object. - */ - public TargetTypesClient getTargetTypes() { - return this.targetTypes; - } - - /** The TargetsClient object to access its operations. */ - private final TargetsClient targets; - - /** - * Gets the TargetsClient object to access its operations. - * - * @return the TargetsClient object. - */ - public TargetsClient getTargets() { - return this.targets; - } - - /** - * Initializes an instance of ChaosManagementClient client. - * - * @param httpPipeline The HTTP pipeline to send requests through. - * @param serializerAdapter The serializer to serialize an object into a string. - * @param defaultPollInterval The default poll interval for long-running operation. - * @param environment The Azure environment. - * @param subscriptionId GUID that represents an Azure subscription ID. - * @param endpoint server parameter. - */ - ChaosManagementClientImpl( - HttpPipeline httpPipeline, - SerializerAdapter serializerAdapter, - Duration defaultPollInterval, - AzureEnvironment environment, - String subscriptionId, - String endpoint) { - this.httpPipeline = httpPipeline; - this.serializerAdapter = serializerAdapter; - this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; - this.endpoint = endpoint; - this.apiVersion = "2023-04-15-preview"; - this.capabilities = new CapabilitiesClientImpl(this); - this.capabilityTypes = new CapabilityTypesClientImpl(this); - this.experiments = new ExperimentsClientImpl(this); - this.operations = new OperationsClientImpl(this); - this.targetTypes = new TargetTypesClientImpl(this); - this.targets = new TargetsClientImpl(this); - } - - /** - * Gets default client context. - * - * @return the default client context. - */ - public Context getContext() { - return Context.NONE; - } - - /** - * Merges default client context with provided context. - * - * @param context the context to be merged with default client context. - * @return the merged context. - */ - public Context mergeContext(Context context) { - return CoreUtils.mergeContexts(this.getContext(), context); - } - - /** - * Gets long running operation result. - * - * @param activationResponse the response of activation operation. - * @param httpPipeline the http pipeline. - * @param pollResultType type of poll result. - * @param finalResultType type of final result. - * @param context the context shared by all requests. - * @param type of poll result. - * @param type of final result. - * @return poller flux for poll result and final result. - */ - public PollerFlux, U> getLroResult( - Mono>> activationResponse, - HttpPipeline httpPipeline, - Type pollResultType, - Type finalResultType, - Context context) { - return PollerFactory - .create( - serializerAdapter, - httpPipeline, - pollResultType, - finalResultType, - defaultPollInterval, - activationResponse, - context); - } - - /** - * Gets the final result, or an error, based on last async poll response. - * - * @param response the last async poll response. - * @param type of poll result. - * @param type of final result. - * @return the final result, or an error. - */ - public Mono getLroFinalResultOrError(AsyncPollResponse, U> response) { - if (response.getStatus() != LongRunningOperationStatus.SUCCESSFULLY_COMPLETED) { - String errorMessage; - ManagementError managementError = null; - HttpResponse errorResponse = null; - PollResult.Error lroError = response.getValue().getError(); - if (lroError != null) { - errorResponse = - new HttpResponseImpl( - lroError.getResponseStatusCode(), lroError.getResponseHeaders(), lroError.getResponseBody()); - - errorMessage = response.getValue().getError().getMessage(); - String errorBody = response.getValue().getError().getResponseBody(); - if (errorBody != null) { - // try to deserialize error body to ManagementError - try { - managementError = - this - .getSerializerAdapter() - .deserialize(errorBody, ManagementError.class, SerializerEncoding.JSON); - if (managementError.getCode() == null || managementError.getMessage() == null) { - managementError = null; - } - } catch (IOException | RuntimeException ioe) { - LOGGER.logThrowableAsWarning(ioe); - } - } - } else { - // fallback to default error message - errorMessage = "Long running operation failed."; - } - if (managementError == null) { - // fallback to default ManagementError - managementError = new ManagementError(response.getStatus().toString(), errorMessage); - } - return Mono.error(new ManagementException(errorMessage, errorResponse, managementError)); - } else { - return response.getFinalResult(); - } - } - - private static final class HttpResponseImpl extends HttpResponse { - private final int statusCode; - - private final byte[] responseBody; - - private final HttpHeaders httpHeaders; - - HttpResponseImpl(int statusCode, HttpHeaders httpHeaders, String responseBody) { - super(null); - this.statusCode = statusCode; - this.httpHeaders = httpHeaders; - this.responseBody = responseBody == null ? null : responseBody.getBytes(StandardCharsets.UTF_8); - } - - public int getStatusCode() { - return statusCode; - } - - public String getHeaderValue(String s) { - return httpHeaders.getValue(s); - } - - public HttpHeaders getHeaders() { - return httpHeaders; - } - - public Flux getBody() { - return Flux.just(ByteBuffer.wrap(responseBody)); - } - - public Mono getBodyAsByteArray() { - return Mono.just(responseBody); - } - - public Mono getBodyAsString() { - return Mono.just(new String(responseBody, StandardCharsets.UTF_8)); - } - - public Mono getBodyAsString(Charset charset) { - return Mono.just(new String(responseBody, charset)); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ChaosManagementClientImpl.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java deleted file mode 100644 index ab9f6c580516b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentCancelOperationResultImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.implementation; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner; -import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult; - -public final class ExperimentCancelOperationResultImpl implements ExperimentCancelOperationResult { - private ExperimentCancelOperationResultInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - ExperimentCancelOperationResultImpl( - ExperimentCancelOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public String statusUrl() { - return this.innerModel().statusUrl(); - } - - public ExperimentCancelOperationResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index abb9d17a9c4b1..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentExecutionDetailsImpl.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.implementation; - -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; - -public final class ExperimentExecutionDetailsImpl implements ExperimentExecutionDetails { - private ExperimentExecutionDetailsInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - ExperimentExecutionDetailsImpl( - ExperimentExecutionDetailsInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String type() { - return this.innerModel().type(); - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String experimentId() { - return this.innerModel().experimentId(); - } - - public String status() { - return this.innerModel().status(); - } - - public String failureReason() { - return this.innerModel().failureReason(); - } - - public OffsetDateTime createdDateTime() { - return this.innerModel().createdDateTime(); - } - - public OffsetDateTime lastActionDateTime() { - return this.innerModel().lastActionDateTime(); - } - - public OffsetDateTime startDateTime() { - return this.innerModel().startDateTime(); - } - - public OffsetDateTime stopDateTime() { - return this.innerModel().stopDateTime(); - } - - public ExperimentExecutionDetailsPropertiesRunInformation runInformation() { - return this.innerModel().runInformation(); - } - - public ExperimentExecutionDetailsInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index d48f0bfa66a59..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentImpl.java +++ /dev/null @@ -1,251 +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.implementation; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult; -import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult; -import com.azure.resourcemanager.chaos.models.ExperimentUpdate; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -import java.util.Collections; -import java.util.List; -import java.util.Map; - -public final class ExperimentImpl implements Experiment, Experiment.Definition, Experiment.Update { - private ExperimentInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public String location() { - return this.innerModel().location(); - } - - public Map tags() { - Map inner = this.innerModel().tags(); - if (inner != null) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public ResourceIdentity identity() { - return this.innerModel().identity(); - } - - public List steps() { - List inner = this.innerModel().steps(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public List selectors() { - List inner = this.innerModel().selectors(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public Boolean startOnCreation() { - return this.innerModel().startOnCreation(); - } - - public Region region() { - return Region.fromName(this.regionName()); - } - - public String regionName() { - return this.location(); - } - - public String resourceGroupName() { - return resourceGroupName; - } - - public ExperimentInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } - - private String resourceGroupName; - - private String experimentName; - - private ExperimentUpdate updateExperiment; - - public ExperimentImpl withExistingResourceGroup(String resourceGroupName) { - this.resourceGroupName = resourceGroupName; - return this; - } - - public Experiment create() { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), Context.NONE) - .getValue(); - return this; - } - - public Experiment create(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .createOrUpdateWithResponse(resourceGroupName, experimentName, this.innerModel(), context) - .getValue(); - return this; - } - - ExperimentImpl(String name, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = new ExperimentInner(); - this.serviceManager = serviceManager; - this.experimentName = name; - } - - public ExperimentImpl update() { - this.updateExperiment = new ExperimentUpdate(); - return this; - } - - public Experiment apply() { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .updateWithResponse(resourceGroupName, experimentName, updateExperiment, Context.NONE) - .getValue(); - return this; - } - - public Experiment apply(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .updateWithResponse(resourceGroupName, experimentName, updateExperiment, context) - .getValue(); - return this; - } - - ExperimentImpl(ExperimentInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - this.resourceGroupName = Utils.getValueFromIdByName(innerObject.id(), "resourceGroups"); - this.experimentName = Utils.getValueFromIdByName(innerObject.id(), "experiments"); - } - - public Experiment refresh() { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .getByResourceGroupWithResponse(resourceGroupName, experimentName, Context.NONE) - .getValue(); - return this; - } - - public Experiment refresh(Context context) { - this.innerObject = - serviceManager - .serviceClient() - .getExperiments() - .getByResourceGroupWithResponse(resourceGroupName, experimentName, context) - .getValue(); - return this; - } - - public Response cancelWithResponse(Context context) { - return serviceManager.experiments().cancelWithResponse(resourceGroupName, experimentName, context); - } - - public ExperimentCancelOperationResult cancel() { - return serviceManager.experiments().cancel(resourceGroupName, experimentName); - } - - public Response startWithResponse(Context context) { - return serviceManager.experiments().startWithResponse(resourceGroupName, experimentName, context); - } - - public ExperimentStartOperationResult start() { - return serviceManager.experiments().start(resourceGroupName, experimentName); - } - - public ExperimentImpl withRegion(Region location) { - this.innerModel().withLocation(location.toString()); - return this; - } - - public ExperimentImpl withRegion(String location) { - this.innerModel().withLocation(location); - return this; - } - - public ExperimentImpl withSteps(List steps) { - this.innerModel().withSteps(steps); - return this; - } - - public ExperimentImpl withSelectors(List selectors) { - this.innerModel().withSelectors(selectors); - return this; - } - - public ExperimentImpl withTags(Map tags) { - this.innerModel().withTags(tags); - return this; - } - - public ExperimentImpl withIdentity(ResourceIdentity identity) { - if (isInCreateMode()) { - this.innerModel().withIdentity(identity); - return this; - } else { - this.updateExperiment.withIdentity(identity); - return this; - } - } - - public ExperimentImpl withStartOnCreation(Boolean startOnCreation) { - this.innerModel().withStartOnCreation(startOnCreation); - return this; - } - - private boolean isInCreateMode() { - return this.innerModel().id() == null; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java deleted file mode 100644 index 8fa3ca1fcc2c6..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStartOperationResultImpl.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.implementation; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner; -import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult; - -public final class ExperimentStartOperationResultImpl implements ExperimentStartOperationResult { - private ExperimentStartOperationResultInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - ExperimentStartOperationResultImpl( - ExperimentStartOperationResultInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public String statusUrl() { - return this.innerModel().statusUrl(); - } - - public ExperimentStartOperationResultInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java deleted file mode 100644 index 491789a838555..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentStatusImpl.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.implementation; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import com.azure.resourcemanager.chaos.models.ExperimentStatus; -import java.time.OffsetDateTime; - -public final class ExperimentStatusImpl implements ExperimentStatus { - private ExperimentStatusInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - ExperimentStatusImpl( - ExperimentStatusInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String type() { - return this.innerModel().type(); - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String status() { - return this.innerModel().status(); - } - - public OffsetDateTime createdDateUtc() { - return this.innerModel().createdDateUtc(); - } - - public OffsetDateTime endDateUtc() { - return this.innerModel().endDateUtc(); - } - - public ExperimentStatusInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index dcf3d6a39bc9f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsClientImpl.java +++ /dev/null @@ -1,2556 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.Patch; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Post; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.ExperimentsClient; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsListResult; -import com.azure.resourcemanager.chaos.models.ExperimentListResult; -import com.azure.resourcemanager.chaos.models.ExperimentStatusListResult; -import com.azure.resourcemanager.chaos.models.ExperimentUpdate; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in ExperimentsClient. */ -public final class ExperimentsClientImpl implements ExperimentsClient { - /** The proxy service used to perform REST calls. */ - private final ExperimentsService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of ExperimentsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - ExperimentsClientImpl(ChaosManagementClientImpl client) { - this.service = - RestProxy.create(ExperimentsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientExperiments to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface ExperimentsService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/experiments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @QueryParam("running") Boolean running, - @QueryParam("continuationToken") String continuationToken, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @QueryParam("running") Boolean running, - @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({200, 204}) - @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}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup( - @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"}) - @Put( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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); - - @Headers({"Content-Type: application/json"}) - @Patch( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}") - @ExpectedResponses({200}) - @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, - Context context); - - @Headers({"Content-Type: application/json"}) - @Post( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/cancel") - @ExpectedResponses({202}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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); - - @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( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/statuses") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllStatuses( - @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}/statuses/{statusId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getStatus( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("experimentName") String experimentName, - @PathParam("statusId") String statusId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Chaos/experiments/{experimentName}/executionDetails") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listExecutionDetails( - @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}/executionDetails/{executionDetailsId}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getExecutionDetails( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, - @PathParam("experimentName") String experimentName, - @PathParam("executionDetailsId") String executionDetailsId, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllStatusesNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listExecutionDetailsNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Boolean running, String continuationToken) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (this.client.getSubscriptionId() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - running, - 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())); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - Boolean running, String continuationToken, 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - running, - continuationToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Boolean running, String continuationToken) { - return new PagedFlux<>( - () -> listSinglePageAsync(running, continuationToken), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Experiment resources in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync() { - final Boolean running = null; - final String continuationToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(running, continuationToken), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Boolean running, String continuationToken, Context context) { - return new PagedFlux<>( - () -> listSinglePageAsync(running, continuationToken, context), - nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - final Boolean running = null; - final String continuationToken = null; - return new PagedIterable<>(listAsync(running, continuationToken)); - } - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Boolean running, String continuationToken, Context context) { - return new PagedIterable<>(listAsync(running, continuationToken, context)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Boolean running, String continuationToken) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - running, - 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())); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync( - String resourceGroupName, Boolean running, String continuationToken, 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - running, - continuationToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Boolean running, String continuationToken) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, running, continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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 Experiment resources in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName) { - final Boolean running = null; - final String continuationToken = null; - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, running, continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync( - String resourceGroupName, Boolean running, String continuationToken, Context context) { - return new PagedFlux<>( - () -> listByResourceGroupSinglePageAsync(resourceGroupName, running, continuationToken, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - final Boolean running = null; - final String continuationToken = null; - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, running, continuationToken)); - } - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup( - String resourceGroupName, Boolean running, String continuationToken, Context context) { - 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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String experimentName) { - return deleteWithResponseAsync(resourceGroupName, experimentName).flatMap(ignored -> Mono.empty()); - } - - /** - * 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response deleteWithResponse(String resourceGroupName, String experimentName, Context context) { - return deleteWithResponseAsync(resourceGroupName, experimentName, context).block(); - } - - /** - * 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) { - deleteWithResponse(resourceGroupName, experimentName, Context.NONE); - } - - /** - * Get 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 Experiment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - 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 - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get 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 Experiment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync( - 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 - .getByResourceGroup( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - accept, - context); - } - - /** - * Get 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 Experiment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getByResourceGroupAsync(String resourceGroupName, String experimentName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, experimentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get 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 Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse( - String resourceGroupName, String experimentName, Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, experimentName, context).block(); - } - - /** - * Get 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 Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentInner getByResourceGroup(String resourceGroupName, String experimentName) { - return getByResourceGroupWithResponse(resourceGroupName, experimentName, Context.NONE).getValue(); - } - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String experimentName, ExperimentInner experiment) { - 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.")); - } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); - } else { - experiment.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)) - .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 experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, String experimentName, ExperimentInner experiment, 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.")); - } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); - } else { - experiment.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); - } - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync( - String resourceGroupName, String experimentName, ExperimentInner experiment) { - return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response createOrUpdateWithResponse( - String resourceGroupName, String experimentName, ExperimentInner experiment, Context context) { - return createOrUpdateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block(); - } - - /** - * Create or update a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 createOrUpdateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue(); - } - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String experimentName, ExperimentUpdate experiment) { - 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.")); - } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); - } else { - experiment.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)) - .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 experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> updateWithResponseAsync( - String resourceGroupName, String experimentName, ExperimentUpdate experiment, 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.")); - } - if (experiment == null) { - return Mono.error(new IllegalArgumentException("Parameter experiment is required and cannot be null.")); - } else { - experiment.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); - } - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync( - String resourceGroupName, String experimentName, ExperimentUpdate experiment) { - return updateWithResponseAsync(resourceGroupName, experimentName, experiment) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response updateWithResponse( - String resourceGroupName, String experimentName, ExperimentUpdate experiment, Context context) { - return updateWithResponseAsync(resourceGroupName, experimentName, experiment, context).block(); - } - - /** - * The operation to update an experiment. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param experiment 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 updateWithResponse(resourceGroupName, experimentName, experiment, Context.NONE).getValue(); - } - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - 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.")); - } - 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 - .cancel( - 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. - * - * @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 model that represents the result of a cancel Experiment operation along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> cancelWithResponseAsync( - 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 - .cancel( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - accept, - context); - } - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono cancelAsync(String resourceGroupName, String experimentName) { - return cancelWithResponseAsync(resourceGroupName, experimentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response cancelWithResponse( - String resourceGroupName, String experimentName, Context context) { - return cancelWithResponseAsync(resourceGroupName, experimentName, context).block(); - } - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentCancelOperationResultInner cancel(String resourceGroupName, String experimentName) { - return cancelWithResponse(resourceGroupName, experimentName, Context.NONE).getValue(); - } - - /** - * Start 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 model that represents the result of a start Experiment operation along with {@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 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 model that represents the result of a start Experiment operation along with {@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 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 model that represents the result of a start Experiment operation on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono startAsync(String resourceGroupName, String experimentName) { - return startWithResponseAsync(resourceGroupName, experimentName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Start 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 model that represents the result of a start Experiment operation along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response startWithResponse( - String resourceGroupName, String experimentName, Context context) { - return startWithResponseAsync(resourceGroupName, experimentName, context).block(); - } - - /** - * Start 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 model that represents the result of a start Experiment operation. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentStartOperationResultInner start(String resourceGroupName, String experimentName) { - return startWithResponse(resourceGroupName, experimentName, Context.NONE).getValue(); - } - - /** - * Get a list of statuses of 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 list of statuses of a Experiment resource along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllStatusesSinglePageAsync( - 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 - .listAllStatuses( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - 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 statuses of 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 list of statuses of a Experiment resource along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllStatusesSinglePageAsync( - 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 - .listAllStatuses( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of statuses of 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 list of statuses of a Experiment resource as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllStatusesAsync(String resourceGroupName, String experimentName) { - return new PagedFlux<>( - () -> listAllStatusesSinglePageAsync(resourceGroupName, experimentName), - nextLink -> listAllStatusesNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of statuses of 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 list of statuses of a Experiment resource as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllStatusesAsync( - String resourceGroupName, String experimentName, Context context) { - return new PagedFlux<>( - () -> listAllStatusesSinglePageAsync(resourceGroupName, experimentName, context), - nextLink -> listAllStatusesNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of statuses of 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 list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAllStatuses(String resourceGroupName, String experimentName) { - return new PagedIterable<>(listAllStatusesAsync(resourceGroupName, experimentName)); - } - - /** - * Get a list of statuses of 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 list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAllStatuses( - String resourceGroupName, String experimentName, Context context) { - return new PagedIterable<>(listAllStatusesAsync(resourceGroupName, experimentName, context)); - } - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getStatusWithResponseAsync( - String resourceGroupName, String experimentName, String statusId) { - 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.")); - } - if (statusId == null) { - return Mono.error(new IllegalArgumentException("Parameter statusId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getStatus( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - statusId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getStatusWithResponseAsync( - String resourceGroupName, String experimentName, String statusId, 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.")); - } - if (statusId == null) { - return Mono.error(new IllegalArgumentException("Parameter statusId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getStatus( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - statusId, - accept, - context); - } - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getStatusAsync( - String resourceGroupName, String experimentName, String statusId) { - return getStatusWithResponseAsync(resourceGroupName, experimentName, statusId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getStatusWithResponse( - String resourceGroupName, String experimentName, String statusId, Context context) { - return getStatusWithResponseAsync(resourceGroupName, experimentName, statusId, context).block(); - } - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentStatusInner getStatus(String resourceGroupName, String experimentName, String statusId) { - return getStatusWithResponse(resourceGroupName, experimentName, statusId, Context.NONE).getValue(); - } - - /** - * Get a list of execution details of 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 list of execution details of a Experiment resource along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listExecutionDetailsSinglePageAsync( - 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 - .listExecutionDetails( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - 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 execution details of 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 list of execution details of a Experiment resource along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listExecutionDetailsSinglePageAsync( - 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 - .listExecutionDetails( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of execution details of 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 list of execution details of a Experiment resource as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listExecutionDetailsAsync( - String resourceGroupName, String experimentName) { - return new PagedFlux<>( - () -> listExecutionDetailsSinglePageAsync(resourceGroupName, experimentName), - nextLink -> listExecutionDetailsNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of execution details of 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 list of execution details of a Experiment resource as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listExecutionDetailsAsync( - String resourceGroupName, String experimentName, Context context) { - return new PagedFlux<>( - () -> listExecutionDetailsSinglePageAsync(resourceGroupName, experimentName, context), - nextLink -> listExecutionDetailsNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of execution details of 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 list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName) { - return new PagedIterable<>(listExecutionDetailsAsync(resourceGroupName, experimentName)); - } - - /** - * Get a list of execution details of 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 list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName, Context context) { - return new PagedIterable<>(listExecutionDetailsAsync(resourceGroupName, experimentName, context)); - } - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionDetailsWithResponseAsync( - String resourceGroupName, String experimentName, String executionDetailsId) { - 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.")); - } - if (executionDetailsId == null) { - return Mono - .error(new IllegalArgumentException("Parameter executionDetailsId is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .getExecutionDetails( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - executionDetailsId, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getExecutionDetailsWithResponseAsync( - String resourceGroupName, String experimentName, String executionDetailsId, 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.")); - } - if (executionDetailsId == null) { - return Mono - .error(new IllegalArgumentException("Parameter executionDetailsId is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .getExecutionDetails( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - experimentName, - executionDetailsId, - accept, - context); - } - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getExecutionDetailsAsync( - String resourceGroupName, String experimentName, String executionDetailsId) { - return getExecutionDetailsWithResponseAsync(resourceGroupName, experimentName, executionDetailsId) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getExecutionDetailsWithResponse( - String resourceGroupName, String experimentName, String executionDetailsId, Context context) { - return getExecutionDetailsWithResponseAsync(resourceGroupName, experimentName, executionDetailsId, context) - .block(); - } - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ExperimentExecutionDetailsInner getExecutionDetails( - String resourceGroupName, String experimentName, String executionDetailsId) { - return getExecutionDetailsWithResponse(resourceGroupName, experimentName, executionDetailsId, Context.NONE) - .getValue(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment statuses and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllStatusesNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllStatusesNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment statuses and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllStatusesNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllStatusesNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment execution details and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listExecutionDetailsNextSinglePageAsync( - String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listExecutionDetailsNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Experiment execution details and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listExecutionDetailsNextSinglePageAsync( - String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listExecutionDetailsNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 deleted file mode 100644 index 66d80202a470f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/ExperimentsImpl.java +++ /dev/null @@ -1,306 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.ExperimentsClient; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails; -import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult; -import com.azure.resourcemanager.chaos.models.ExperimentStatus; -import com.azure.resourcemanager.chaos.models.Experiments; - -public final class ExperimentsImpl implements Experiments { - private static final ClientLogger LOGGER = new ClientLogger(ExperimentsImpl.class); - - private final ExperimentsClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public ExperimentsImpl(ExperimentsClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list() { - PagedIterable inner = this.serviceClient().list(); - return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); - } - - public PagedIterable list(Boolean running, String continuationToken, Context context) { - PagedIterable inner = this.serviceClient().list(running, continuationToken, context); - return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup(String resourceGroupName) { - PagedIterable inner = this.serviceClient().listByResourceGroup(resourceGroupName); - return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); - } - - public PagedIterable listByResourceGroup( - String resourceGroupName, Boolean running, String continuationToken, Context context) { - PagedIterable inner = - this.serviceClient().listByResourceGroup(resourceGroupName, running, continuationToken, context); - return Utils.mapPage(inner, inner1 -> new ExperimentImpl(inner1, this.manager())); - } - - public Response deleteByResourceGroupWithResponse( - String resourceGroupName, String experimentName, Context context) { - return this.serviceClient().deleteWithResponse(resourceGroupName, experimentName, context); - } - - public void deleteByResourceGroup(String resourceGroupName, String experimentName) { - this.serviceClient().delete(resourceGroupName, experimentName); - } - - public Response getByResourceGroupWithResponse( - String resourceGroupName, String experimentName, Context context) { - Response inner = - this.serviceClient().getByResourceGroupWithResponse(resourceGroupName, experimentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExperimentImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Experiment getByResourceGroup(String resourceGroupName, String experimentName) { - ExperimentInner inner = this.serviceClient().getByResourceGroup(resourceGroupName, experimentName); - if (inner != null) { - return new ExperimentImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response cancelWithResponse( - String resourceGroupName, String experimentName, Context context) { - Response inner = - this.serviceClient().cancelWithResponse(resourceGroupName, experimentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExperimentCancelOperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExperimentCancelOperationResult cancel(String resourceGroupName, String experimentName) { - ExperimentCancelOperationResultInner inner = this.serviceClient().cancel(resourceGroupName, experimentName); - if (inner != null) { - return new ExperimentCancelOperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public Response startWithResponse( - String resourceGroupName, String experimentName, Context context) { - Response inner = - this.serviceClient().startWithResponse(resourceGroupName, experimentName, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExperimentStartOperationResultImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExperimentStartOperationResult start(String resourceGroupName, String experimentName) { - ExperimentStartOperationResultInner inner = this.serviceClient().start(resourceGroupName, experimentName); - if (inner != null) { - return new ExperimentStartOperationResultImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listAllStatuses(String resourceGroupName, String experimentName) { - PagedIterable inner = - this.serviceClient().listAllStatuses(resourceGroupName, experimentName); - return Utils.mapPage(inner, inner1 -> new ExperimentStatusImpl(inner1, this.manager())); - } - - public PagedIterable listAllStatuses( - String resourceGroupName, String experimentName, Context context) { - PagedIterable inner = - this.serviceClient().listAllStatuses(resourceGroupName, experimentName, context); - return Utils.mapPage(inner, inner1 -> new ExperimentStatusImpl(inner1, this.manager())); - } - - public Response getStatusWithResponse( - String resourceGroupName, String experimentName, String statusId, Context context) { - Response inner = - this.serviceClient().getStatusWithResponse(resourceGroupName, experimentName, statusId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExperimentStatusImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExperimentStatus getStatus(String resourceGroupName, String experimentName, String statusId) { - ExperimentStatusInner inner = this.serviceClient().getStatus(resourceGroupName, experimentName, statusId); - if (inner != null) { - return new ExperimentStatusImpl(inner, this.manager()); - } else { - return null; - } - } - - public PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName) { - PagedIterable inner = - this.serviceClient().listExecutionDetails(resourceGroupName, experimentName); - return Utils.mapPage(inner, inner1 -> new ExperimentExecutionDetailsImpl(inner1, this.manager())); - } - - public PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName, Context context) { - PagedIterable inner = - this.serviceClient().listExecutionDetails(resourceGroupName, experimentName, context); - return Utils.mapPage(inner, inner1 -> new ExperimentExecutionDetailsImpl(inner1, this.manager())); - } - - public Response getExecutionDetailsWithResponse( - String resourceGroupName, String experimentName, String executionDetailsId, Context context) { - Response inner = - this - .serviceClient() - .getExecutionDetailsWithResponse(resourceGroupName, experimentName, executionDetailsId, context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new ExperimentExecutionDetailsImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public ExperimentExecutionDetails getExecutionDetails( - String resourceGroupName, String experimentName, String executionDetailsId) { - ExperimentExecutionDetailsInner inner = - this.serviceClient().getExecutionDetails(resourceGroupName, experimentName, executionDetailsId); - if (inner != null) { - return new ExperimentExecutionDetailsImpl(inner, this.manager()); - } else { - return null; - } - } - - public Experiment getById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String experimentName = Utils.getValueFromIdByName(id, "experiments"); - if (experimentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, experimentName, Context.NONE).getValue(); - } - - public Response getByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String experimentName = Utils.getValueFromIdByName(id, "experiments"); - if (experimentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id))); - } - return this.getByResourceGroupWithResponse(resourceGroupName, experimentName, context); - } - - public void deleteById(String id) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String experimentName = Utils.getValueFromIdByName(id, "experiments"); - if (experimentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id))); - } - this.deleteByResourceGroupWithResponse(resourceGroupName, experimentName, Context.NONE); - } - - public Response deleteByIdWithResponse(String id, Context context) { - String resourceGroupName = Utils.getValueFromIdByName(id, "resourceGroups"); - if (resourceGroupName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String - .format("The resource ID '%s' is not valid. Missing path segment 'resourceGroups'.", id))); - } - String experimentName = Utils.getValueFromIdByName(id, "experiments"); - if (experimentName == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException( - String.format("The resource ID '%s' is not valid. Missing path segment 'experiments'.", id))); - } - return this.deleteByResourceGroupWithResponse(resourceGroupName, experimentName, context); - } - - private ExperimentsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } - - public ExperimentImpl define(String name) { - return new ExperimentImpl(name, this.manager()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationImpl.java deleted file mode 100644 index 1680fbc0fd948..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationImpl.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.implementation; - -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; -import com.azure.resourcemanager.chaos.models.ActionType; -import com.azure.resourcemanager.chaos.models.Operation; -import com.azure.resourcemanager.chaos.models.OperationDisplay; -import com.azure.resourcemanager.chaos.models.Origin; - -public final class OperationImpl implements Operation { - private OperationInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - OperationImpl(OperationInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String name() { - return this.innerModel().name(); - } - - public Boolean isDataAction() { - return this.innerModel().isDataAction(); - } - - public OperationDisplay display() { - return this.innerModel().display(); - } - - public Origin origin() { - return this.innerModel().origin(); - } - - public ActionType actionType() { - return this.innerModel().actionType(); - } - - public OperationInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index 886c955a9fccc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsClientImpl.java +++ /dev/null @@ -1,272 +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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.OperationsClient; -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; -import com.azure.resourcemanager.chaos.models.OperationListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in OperationsClient. */ -public final class OperationsClientImpl implements OperationsClient { - /** The proxy service used to perform REST calls. */ - private final OperationsService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of OperationsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - OperationsClientImpl(ChaosManagementClientImpl client) { - this.service = - RestProxy.create(OperationsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientOperations to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface OperationsService { - @Headers({"Content-Type: application/json"}) - @Get("/providers/Microsoft.Chaos/operations") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAll( - @HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listAllNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list all available Operations. - * - * @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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync() { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listAll(this.client.getEndpoint(), this.client.getApiVersion(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get a list all available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list all available Operations along with {@link PagedResponse} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllSinglePageAsync(Context context) { - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAll(this.client.getEndpoint(), this.client.getApiVersion(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list all available Operations. - * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync() { - return new PagedFlux<>(() -> listAllSinglePageAsync(), nextLink -> listAllNextSinglePageAsync(nextLink)); - } - - /** - * Get a list all available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list all available Operations as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAllAsync(Context context) { - return new PagedFlux<>( - () -> listAllSinglePageAsync(context), nextLink -> listAllNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list all available Operations. - * - * @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}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll() { - return new PagedIterable<>(listAllAsync()); - } - - /** - * Get a list all available Operations. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list all available Operations as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listAll(Context context) { - return new PagedIterable<>(listAllAsync(context)); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listAllNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return a list of REST API operations supported by an Azure Resource Provider along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listAllNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listAllNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsImpl.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsImpl.java deleted file mode 100644 index 25e7075255985..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/OperationsImpl.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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.OperationsClient; -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; -import com.azure.resourcemanager.chaos.models.Operation; -import com.azure.resourcemanager.chaos.models.Operations; - -public final class OperationsImpl implements Operations { - private static final ClientLogger LOGGER = new ClientLogger(OperationsImpl.class); - - private final OperationsClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public OperationsImpl(OperationsClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable listAll() { - PagedIterable inner = this.serviceClient().listAll(); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - public PagedIterable listAll(Context context) { - PagedIterable inner = this.serviceClient().listAll(context); - return Utils.mapPage(inner, inner1 -> new OperationImpl(inner1, this.manager())); - } - - private OperationsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index ef8433375132c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetImpl.java +++ /dev/null @@ -1,59 +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.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.azure.resourcemanager.chaos.models.Target; -import java.util.Collections; -import java.util.Map; - -public final class TargetImpl implements Target { - private TargetInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - TargetImpl(TargetInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - 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) { - return Collections.unmodifiableMap(inner); - } else { - return Collections.emptyMap(); - } - } - - public TargetInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index 4d823d32c2b8f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypeImpl.java +++ /dev/null @@ -1,71 +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.implementation; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import com.azure.resourcemanager.chaos.models.TargetType; -import java.util.Collections; -import java.util.List; - -public final class TargetTypeImpl implements TargetType { - private TargetTypeInner innerObject; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - TargetTypeImpl(TargetTypeInner innerObject, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerObject = innerObject; - this.serviceManager = serviceManager; - } - - public String id() { - return this.innerModel().id(); - } - - public String name() { - return this.innerModel().name(); - } - - public String type() { - return this.innerModel().type(); - } - - public SystemData systemData() { - return this.innerModel().systemData(); - } - - public String location() { - return this.innerModel().location(); - } - - public String displayName() { - return this.innerModel().displayName(); - } - - public String description() { - return this.innerModel().description(); - } - - public String propertiesSchema() { - return this.innerModel().propertiesSchema(); - } - - public List resourceTypes() { - List inner = this.innerModel().resourceTypes(); - if (inner != null) { - return Collections.unmodifiableList(inner); - } else { - return Collections.emptyList(); - } - } - - public TargetTypeInner innerModel() { - return this.innerObject; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index ce7407df6a7c3..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesClientImpl.java +++ /dev/null @@ -1,496 +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.implementation; - -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.TargetTypesClient; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import com.azure.resourcemanager.chaos.models.TargetTypeListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TargetTypesClient. */ -public final class TargetTypesClientImpl implements TargetTypesClient { - /** The proxy service used to perform REST calls. */ - private final TargetTypesService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of TargetTypesClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TargetTypesClientImpl(ChaosManagementClientImpl client) { - this.service = - RestProxy.create(TargetTypesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientTargetTypes to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface TargetTypesService { - @Headers({"Content-Type: application/json"}) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/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, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/providers/Microsoft.Chaos/locations/{locationName}/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, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String locationName, String continuationToken) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName 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)) - .>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 Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location along with {@link PagedResponse} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String locationName, String continuationToken, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName 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, - continuationToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 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), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String locationName) { - final String continuationToken = null; - return new PagedFlux<>( - () -> listSinglePageAsync(locationName, continuationToken), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 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), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String locationName) { - final String continuationToken = null; - return new PagedIterable<>(listAsync(locationName, continuationToken)); - } - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 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)); - } - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String locationName, String targetTypeName) { - 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - locationName, - 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 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. - * @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 Target Type resources for given location along with {@link Response} on successful completion of {@link - * Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - String locationName, String targetTypeName, 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 (locationName == null) { - return Mono.error(new IllegalArgumentException("Parameter locationName is required and cannot be null.")); - } - if (targetTypeName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetTypeName is required and cannot be null.")); - } - 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); - } - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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())); - } - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 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(); - } - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @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(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Target Type resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Target Type resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 deleted file mode 100644 index f3b78d87c6c6f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetTypesImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.TargetTypesClient; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import com.azure.resourcemanager.chaos.models.TargetType; -import com.azure.resourcemanager.chaos.models.TargetTypes; - -public final class TargetTypesImpl implements TargetTypes { - private static final ClientLogger LOGGER = new ClientLogger(TargetTypesImpl.class); - - private final TargetTypesClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public TargetTypesImpl(TargetTypesClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list(String locationName) { - PagedIterable inner = this.serviceClient().list(locationName); - return Utils.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); - return Utils.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); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TargetTypeImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public TargetType get(String locationName, String targetTypeName) { - TargetTypeInner inner = this.serviceClient().get(locationName, targetTypeName); - if (inner != null) { - return new TargetTypeImpl(inner, this.manager()); - } else { - return null; - } - } - - private TargetTypesClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} 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 deleted file mode 100644 index 316f3813e73ac..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsClientImpl.java +++ /dev/null @@ -1,1226 +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.implementation; - -import com.azure.core.annotation.BodyParam; -import com.azure.core.annotation.Delete; -import com.azure.core.annotation.ExpectedResponses; -import com.azure.core.annotation.Get; -import com.azure.core.annotation.HeaderParam; -import com.azure.core.annotation.Headers; -import com.azure.core.annotation.Host; -import com.azure.core.annotation.HostParam; -import com.azure.core.annotation.PathParam; -import com.azure.core.annotation.Put; -import com.azure.core.annotation.QueryParam; -import com.azure.core.annotation.ReturnType; -import com.azure.core.annotation.ServiceInterface; -import com.azure.core.annotation.ServiceMethod; -import com.azure.core.annotation.UnexpectedResponseExceptionType; -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.RestProxy; -import com.azure.core.management.exception.ManagementException; -import com.azure.core.util.Context; -import com.azure.core.util.FluxUtil; -import com.azure.resourcemanager.chaos.fluent.TargetsClient; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.azure.resourcemanager.chaos.models.TargetListResult; -import reactor.core.publisher.Mono; - -/** An instance of this class provides access to all the operations defined in TargetsClient. */ -public final class TargetsClientImpl implements TargetsClient { - /** The proxy service used to perform REST calls. */ - private final TargetsService service; - - /** The service client containing this operation class. */ - private final ChaosManagementClientImpl client; - - /** - * Initializes an instance of TargetsClientImpl. - * - * @param client the instance of the service client containing this operation class. - */ - TargetsClientImpl(ChaosManagementClientImpl client) { - this.service = RestProxy.create(TargetsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); - this.client = client; - } - - /** - * The interface defining all the services for ChaosManagementClientTargets to be used by the proxy service to - * perform REST calls. - */ - @Host("{$host}") - @ServiceInterface(name = "ChaosManagementClien") - public interface TargetsService { - @Headers({"Content-Type: application/json"}) - @Get( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list( - @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, - @QueryParam("continuationToken") String continuationToken, - @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}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get( - @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); - - @Headers({"Content-Type: application/json"}) - @Delete( - "/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{parentProviderNamespace}/{parentResourceType}/{parentResourceName}/providers/Microsoft.Chaos/targets/{targetName}") - @ExpectedResponses({200, 204}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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, - @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}) - @UnexpectedResponseExceptionType(ManagementException.class) - 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, - @BodyParam("application/json") TargetInner target, - @HeaderParam("Accept") String accept, - Context context); - - @Headers({"Content-Type: application/json"}) - @Get("{nextLink}") - @ExpectedResponses({200}) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, - @HeaderParam("Accept") String accept, - Context context); - } - - /** - * 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 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 Target resources that extend a tracked regional resource along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken) { - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .list( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - 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())); - } - - /** - * 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 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 Target resources that extend a tracked regional resource along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName 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(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken, - accept, - context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } - - /** - * 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 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 Target resources that extend a tracked regional resource as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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. - * @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 resources that extend a tracked regional resource as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName) { - final String continuationToken = null; - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * 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 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 Target resources that extend a tracked regional resource as paginated response with {@link - * PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - Context context) { - return new PagedFlux<>( - () -> - listSinglePageAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken, - context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * 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. - * @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 resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName) { - final String continuationToken = null; - return new PagedIterable<>( - listAsync( - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, continuationToken)); - } - - /** - * 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 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 Target resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - Context context) { - return new PagedIterable<>( - listAsync( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken, - context)); - } - - /** - * 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 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 Target resource that extends a tracked regional resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> - service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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. - * @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 Target resource that extends a tracked regional resource along with {@link Response} on successful - * completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync( - 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .get( - this.client.getEndpoint(), - this.client.getApiVersion(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - accept, - context); - } - - /** - * 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 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 Target resource that extends a tracked regional resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono getAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - return getWithResponseAsync( - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * 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 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. - * @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 Target resource that extends a tracked regional resource along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context) { - return getWithResponseAsync( - resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName, context) - .block(); - } - - /** - * 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 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 Target resource that extends a tracked regional resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TargetInner get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - return getWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - Context.NONE) - .getValue(); - } - - /** - * 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 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 the {@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) { - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName 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, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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. - * @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 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.")); - } - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - if (targetName == null) { - return Mono.error(new IllegalArgumentException("Parameter targetName 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, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - accept, - context); - } - - /** - * 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 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 {@link Mono} that completes when a successful response is received. - */ - @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()); - } - - /** - * 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 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. - * @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}. - */ - @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(); - } - - /** - * 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 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. - */ - @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); - } - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - TargetInner target) { - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - 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(), - this.client.getSubscriptionId(), - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - target, - accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * 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 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}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> createOrUpdateWithResponseAsync( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - TargetInner target, - 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 (parentProviderNamespace == null) { - return Mono - .error( - new IllegalArgumentException("Parameter parentProviderNamespace is required and cannot be null.")); - } - if (parentResourceType == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceType is required and cannot be null.")); - } - if (parentResourceName == null) { - return Mono - .error(new IllegalArgumentException("Parameter parentResourceName is required and cannot be null.")); - } - 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); - } - - /** - * 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 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}. - */ - @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())); - } - - /** - * 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 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}. - */ - @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(); - } - - /** - * 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 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(); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Target resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) - .>map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Get the next page of items. - * - * @param nextLink The URL to get the next list of items - *

The nextLink parameter. - * @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 list of Target resources and a link for pagination along with {@link - * PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { - if (nextLink == null) { - return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); - } - if (this.client.getEndpoint() == null) { - return Mono - .error( - new IllegalArgumentException( - "Parameter this.client.getEndpoint() is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listNext(nextLink, this.client.getEndpoint(), accept, context) - .map( - res -> - new PagedResponseBase<>( - res.getRequest(), - res.getStatusCode(), - res.getHeaders(), - res.getValue().value(), - res.getValue().nextLink(), - null)); - } -} diff --git a/sdk/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 deleted file mode 100644 index 7bcbde028239f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/TargetsImpl.java +++ /dev/null @@ -1,196 +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.implementation; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.http.rest.SimpleResponse; -import com.azure.core.util.Context; -import com.azure.core.util.logging.ClientLogger; -import com.azure.resourcemanager.chaos.fluent.TargetsClient; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.azure.resourcemanager.chaos.models.Target; -import com.azure.resourcemanager.chaos.models.Targets; - -public final class TargetsImpl implements Targets { - private static final ClientLogger LOGGER = new ClientLogger(TargetsImpl.class); - - private final TargetsClient innerClient; - - private final com.azure.resourcemanager.chaos.ChaosManager serviceManager; - - public TargetsImpl(TargetsClient innerClient, com.azure.resourcemanager.chaos.ChaosManager serviceManager) { - this.innerClient = innerClient; - this.serviceManager = serviceManager; - } - - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName) { - PagedIterable inner = - this - .serviceClient() - .list(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName); - return Utils.mapPage(inner, inner1 -> new TargetImpl(inner1, this.manager())); - } - - public PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - Context context) { - PagedIterable inner = - this - .serviceClient() - .list( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - continuationToken, - context); - return Utils.mapPage(inner, inner1 -> new TargetImpl(inner1, this.manager())); - } - - public Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context) { - Response inner = - this - .serviceClient() - .getWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TargetImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Target get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName) { - TargetInner inner = - this - .serviceClient() - .get(resourceGroupName, parentProviderNamespace, parentResourceType, parentResourceName, targetName); - if (inner != null) { - return new TargetImpl(inner, this.manager()); - } else { - return null; - } - } - - 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) { - Response inner = - this - .serviceClient() - .createOrUpdateWithResponse( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - target, - context); - if (inner != null) { - return new SimpleResponse<>( - inner.getRequest(), - inner.getStatusCode(), - inner.getHeaders(), - new TargetImpl(inner.getValue(), this.manager())); - } else { - return null; - } - } - - public Target createOrUpdate( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - TargetInner target) { - TargetInner inner = - this - .serviceClient() - .createOrUpdate( - resourceGroupName, - parentProviderNamespace, - parentResourceType, - parentResourceName, - targetName, - target); - if (inner != null) { - return new TargetImpl(inner, this.manager()); - } else { - return null; - } - } - - private TargetsClient serviceClient() { - return this.innerClient; - } - - private com.azure.resourcemanager.chaos.ChaosManager manager() { - return this.serviceManager; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/Utils.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/Utils.java deleted file mode 100644 index a5c97173501ee..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/Utils.java +++ /dev/null @@ -1,204 +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.implementation; - -import com.azure.core.http.rest.PagedFlux; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.PagedResponse; -import com.azure.core.http.rest.PagedResponseBase; -import com.azure.core.util.CoreUtils; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.Iterator; -import java.util.List; -import java.util.function.Function; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import reactor.core.publisher.Flux; - -final class Utils { - static String getValueFromIdByName(String id, String name) { - if (id == null) { - return null; - } - Iterator itr = Arrays.stream(id.split("/")).iterator(); - while (itr.hasNext()) { - String part = itr.next(); - if (part != null && !part.trim().isEmpty()) { - if (part.equalsIgnoreCase(name)) { - if (itr.hasNext()) { - return itr.next(); - } else { - return null; - } - } - } - } - return null; - } - - static String getValueFromIdByParameterName(String id, String pathTemplate, String parameterName) { - if (id == null || pathTemplate == null) { - return null; - } - String parameterNameParentheses = "{" + parameterName + "}"; - List idSegmentsReverted = Arrays.asList(id.split("/")); - List pathSegments = Arrays.asList(pathTemplate.split("/")); - Collections.reverse(idSegmentsReverted); - Iterator idItrReverted = idSegmentsReverted.iterator(); - int pathIndex = pathSegments.size(); - while (idItrReverted.hasNext() && pathIndex > 0) { - String idSegment = idItrReverted.next(); - String pathSegment = pathSegments.get(--pathIndex); - if (!CoreUtils.isNullOrEmpty(idSegment) && !CoreUtils.isNullOrEmpty(pathSegment)) { - if (pathSegment.equalsIgnoreCase(parameterNameParentheses)) { - if (pathIndex == 0 || (pathIndex == 1 && pathSegments.get(0).isEmpty())) { - List segments = new ArrayList<>(); - segments.add(idSegment); - idItrReverted.forEachRemaining(segments::add); - Collections.reverse(segments); - if (segments.size() > 0 && segments.get(0).isEmpty()) { - segments.remove(0); - } - return String.join("/", segments); - } else { - return idSegment; - } - } - } - } - return null; - } - - static PagedIterable mapPage(PagedIterable pageIterable, Function mapper) { - return new PagedIterableImpl(pageIterable, mapper); - } - - private static final class PagedIterableImpl extends PagedIterable { - - private final PagedIterable pagedIterable; - private final Function mapper; - private final Function, PagedResponse> pageMapper; - - private PagedIterableImpl(PagedIterable pagedIterable, Function mapper) { - super( - PagedFlux - .create( - () -> - (continuationToken, pageSize) -> - Flux.fromStream(pagedIterable.streamByPage().map(getPageMapper(mapper))))); - this.pagedIterable = pagedIterable; - this.mapper = mapper; - this.pageMapper = getPageMapper(mapper); - } - - private static Function, PagedResponse> getPageMapper(Function mapper) { - return page -> - new PagedResponseBase( - page.getRequest(), - page.getStatusCode(), - page.getHeaders(), - page.getElements().stream().map(mapper).collect(Collectors.toList()), - page.getContinuationToken(), - null); - } - - @Override - public Stream stream() { - return pagedIterable.stream().map(mapper); - } - - @Override - public Stream> streamByPage() { - return pagedIterable.streamByPage().map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken) { - return pagedIterable.streamByPage(continuationToken).map(pageMapper); - } - - @Override - public Stream> streamByPage(int preferredPageSize) { - return pagedIterable.streamByPage(preferredPageSize).map(pageMapper); - } - - @Override - public Stream> streamByPage(String continuationToken, int preferredPageSize) { - return pagedIterable.streamByPage(continuationToken, preferredPageSize).map(pageMapper); - } - - @Override - public Iterator iterator() { - return new IteratorImpl(pagedIterable.iterator(), mapper); - } - - @Override - public Iterable> iterableByPage() { - return new IterableImpl, PagedResponse>(pagedIterable.iterableByPage(), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken), pageMapper); - } - - @Override - public Iterable> iterableByPage(int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(preferredPageSize), pageMapper); - } - - @Override - public Iterable> iterableByPage(String continuationToken, int preferredPageSize) { - return new IterableImpl, PagedResponse>( - pagedIterable.iterableByPage(continuationToken, preferredPageSize), pageMapper); - } - } - - private static final class IteratorImpl implements Iterator { - - private final Iterator iterator; - private final Function mapper; - - private IteratorImpl(Iterator iterator, Function mapper) { - this.iterator = iterator; - this.mapper = mapper; - } - - @Override - public boolean hasNext() { - return iterator.hasNext(); - } - - @Override - public S next() { - return mapper.apply(iterator.next()); - } - - @Override - public void remove() { - iterator.remove(); - } - } - - private static final class IterableImpl implements Iterable { - - private final Iterable iterable; - private final Function mapper; - - private IterableImpl(Iterable iterable, Function mapper) { - this.iterable = iterable; - this.mapper = mapper; - } - - @Override - public Iterator iterator() { - return new IteratorImpl(iterable.iterator(), mapper); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/package-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/package-info.java deleted file mode 100644 index a6fc0cab942d5..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/implementation/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the implementations for ChaosManagementClient. Chaos Management Client. */ -package com.azure.resourcemanager.chaos.implementation; diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java deleted file mode 100644 index b66cd0a8ffc2d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Action.java +++ /dev/null @@ -1,71 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Model that represents the base action model. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = Action.class) -@JsonTypeName("Action") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "delay", value = DelayAction.class), - @JsonSubTypes.Type(name = "discrete", value = DiscreteAction.class), - @JsonSubTypes.Type(name = "continuous", value = ContinuousAction.class) -}) -@Fluent -public class Action { - /* - * String that represents a Capability URN. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /** Creates an instance of Action class. */ - public Action() { - } - - /** - * Get the name property: String that represents a Capability URN. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: String that represents a Capability URN. - * - * @param name the name value to set. - * @return the Action object itself. - */ - public Action withName(String name) { - this.name = name; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Action")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Action.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionStatus.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionStatus.java deleted file mode 100644 index 4307ffdb739a8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionStatus.java +++ /dev/null @@ -1,119 +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; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; -import java.util.List; - -/** Model that represents the an action and its status. */ -@Immutable -public final class ActionStatus { - /* - * The name of the action status. - */ - @JsonProperty(value = "actionName", access = JsonProperty.Access.WRITE_ONLY) - private String actionName; - - /* - * The id of the action status. - */ - @JsonProperty(value = "actionId", access = JsonProperty.Access.WRITE_ONLY) - private String actionId; - - /* - * The status of the action. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * String that represents the start time of the action. - */ - @JsonProperty(value = "startTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime startTime; - - /* - * String that represents the end time of the action. - */ - @JsonProperty(value = "endTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime endTime; - - /* - * The array of targets. - */ - @JsonProperty(value = "targets", access = JsonProperty.Access.WRITE_ONLY) - private List targets; - - /** Creates an instance of ActionStatus class. */ - public ActionStatus() { - } - - /** - * Get the actionName property: The name of the action status. - * - * @return the actionName value. - */ - public String actionName() { - return this.actionName; - } - - /** - * Get the actionId property: The id of the action status. - * - * @return the actionId value. - */ - public String actionId() { - return this.actionId; - } - - /** - * Get the status property: The status of the action. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the startTime property: String that represents the start time of the action. - * - * @return the startTime value. - */ - public OffsetDateTime startTime() { - return this.startTime; - } - - /** - * Get the endTime property: String that represents the end time of the action. - * - * @return the endTime value. - */ - public OffsetDateTime endTime() { - return this.endTime; - } - - /** - * Get the targets property: The array of targets. - * - * @return the targets value. - */ - public List targets() { - return this.targets; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (targets() != null) { - targets().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionType.java deleted file mode 100644 index 83a87be8eca45..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ActionType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. */ -public final class ActionType extends ExpandableStringEnum { - /** Static value Internal for ActionType. */ - public static final ActionType INTERNAL = fromString("Internal"); - - /** - * Creates a new instance of ActionType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public ActionType() { - } - - /** - * Creates or finds a ActionType from its string representation. - * - * @param name a name to look for. - * @return the corresponding ActionType. - */ - @JsonCreator - public static ActionType fromString(String name) { - return fromString(name, ActionType.class); - } - - /** - * Gets known ActionType values. - * - * @return known ActionType values. - */ - public static Collection values() { - return values(ActionType.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java deleted file mode 100644 index 6cb88d39d96ce..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Branch.java +++ /dev/null @@ -1,90 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a branch in the step. */ -@Fluent -public final class Branch { - /* - * String of the branch name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * List of actions. - */ - @JsonProperty(value = "actions", required = true) - private List actions; - - /** Creates an instance of Branch class. */ - public Branch() { - } - - /** - * Get the name property: String of the branch name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: String of the branch name. - * - * @param name the name value to set. - * @return the Branch object itself. - */ - public Branch withName(String name) { - this.name = name; - return this; - } - - /** - * Get the actions property: List of actions. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Set the actions property: List of actions. - * - * @param actions the actions value to set. - * @return the Branch object itself. - */ - public Branch withActions(List actions) { - this.actions = actions; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Branch")); - } - if (actions() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property actions in model Branch")); - } else { - actions().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Branch.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/BranchStatus.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/BranchStatus.java deleted file mode 100644 index af57124c70813..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/BranchStatus.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the a list of actions and action statuses. */ -@Immutable -public final class BranchStatus { - /* - * The name of the branch status. - */ - @JsonProperty(value = "branchName", access = JsonProperty.Access.WRITE_ONLY) - private String branchName; - - /* - * The id of the branch status. - */ - @JsonProperty(value = "branchId", access = JsonProperty.Access.WRITE_ONLY) - private String branchId; - - /* - * The status of the branch. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The array of actions. - */ - @JsonProperty(value = "actions", access = JsonProperty.Access.WRITE_ONLY) - private List actions; - - /** Creates an instance of BranchStatus class. */ - public BranchStatus() { - } - - /** - * Get the branchName property: The name of the branch status. - * - * @return the branchName value. - */ - public String branchName() { - return this.branchName; - } - - /** - * Get the branchId property: The id of the branch status. - * - * @return the branchId value. - */ - public String branchId() { - return this.branchId; - } - - /** - * Get the status property: The status of the branch. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the actions property: The array of actions. - * - * @return the actions value. - */ - public List actions() { - return this.actions; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (actions() != null) { - actions().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index e071ff39ef619..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capabilities.java +++ /dev/null @@ -1,200 +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; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; - -/** Resource collection API of Capabilities. */ -public interface Capabilities { - /** - * 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 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 {@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.. - * - * @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 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 {@link - * PagedIterable}. - */ - PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String continuationToken, - Context context); - - /** - * 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 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. - * @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 Capability resource that extends a Target resource along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context); - - /** - * 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 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. - * @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 Capability resource that extends a Target resource. - */ - Capability get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName); - - /** - * 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 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. - * @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}. - */ - Response deleteWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - Context context); - - /** - * 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 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. - * @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 parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName); - - /** - * 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 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}. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - String capabilityName, - CapabilityInner capability, - Context context); - - /** - * 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 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); -} 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 deleted file mode 100644 index 26837dec35b4a..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Capability.java +++ /dev/null @@ -1,81 +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; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; - -/** An immutable client-side representation of Capability. */ -public interface Capability { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * 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: The standard system metadata of a resource type. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the publisher property: String of the Publisher that this Capability extends. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the targetType property: String of the Target Type that this Capability extends. - * - * @return the targetType value. - */ - String targetType(); - - /** - * Gets the description property: Localized string of the description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the parametersSchema property: URL to retrieve JSON schema of the Capability parameters. - * - * @return the parametersSchema value. - */ - String parametersSchema(); - - /** - * Gets the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - String urn(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.CapabilityInner object. - * - * @return the inner object. - */ - CapabilityInner innerModel(); -} 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 deleted file mode 100644 index e1fd74729bef0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Capability resources and a link for pagination. */ -@Immutable -public final class CapabilityListResult { - /* - * List of Capability resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Capability resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of CapabilityListResult class. */ - public CapabilityListResult() { - } - - /** - * Get the value property: List of Capability resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Capability resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index a06b99e80baa2..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityType.java +++ /dev/null @@ -1,124 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import java.util.List; - -/** An immutable client-side representation of CapabilityType. */ -public interface CapabilityType { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * 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: The system metadata properties of the capability type resource. - * - * @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. - * - * @return the publisher value. - */ - String publisher(); - - /** - * Gets the targetType property: String of the Target Type that this Capability Type extends. - * - * @return the targetType value. - */ - String targetType(); - - /** - * Gets the displayName property: Localized string of the display name. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: Localized string of the description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the parametersSchema property: URL to retrieve JSON schema of the Capability Type parameters. - * - * @return the parametersSchema value. - */ - String parametersSchema(); - - /** - * Gets the urn property: String of the URN for this Capability Type. - * - * @return the urn value. - */ - String urn(); - - /** - * Gets the kind property: String of the kind of this Capability Type. - * - * @return the kind value. - */ - String kind(); - - /** - * Gets the azureRbacActions property: Control plane actions necessary to execute capability type. - * - * @return the azureRbacActions value. - */ - List azureRbacActions(); - - /** - * Gets the azureRbacDataActions property: Data plane actions necessary to execute capability type. - * - * @return the azureRbacDataActions value. - */ - List azureRbacDataActions(); - - /** - * Gets the runtimeProperties property: Runtime properties of this Capability Type. - * - * @return the runtimeProperties value. - */ - CapabilityTypePropertiesRuntimeProperties runtimeProperties(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner object. - * - * @return the inner object. - */ - CapabilityTypeInner innerModel(); -} 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 deleted file mode 100644 index 103292b6fa7cd..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypeListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityTypeInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Capability Type resources and a link for pagination. */ -@Immutable -public final class CapabilityTypeListResult { - /* - * List of Capability Type resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Capability Type resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of CapabilityTypeListResult class. */ - public CapabilityTypeListResult() { - } - - /** - * Get the value property: List of Capability Type resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Capability Type resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypePropertiesRuntimeProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypePropertiesRuntimeProperties.java deleted file mode 100644 index 4aea503b42c3d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypePropertiesRuntimeProperties.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Runtime properties of this Capability Type. */ -@Immutable -public final class CapabilityTypePropertiesRuntimeProperties { - /* - * String of the kind of the resource's action type (continuous or discrete). - */ - @JsonProperty(value = "kind", access = JsonProperty.Access.WRITE_ONLY) - private String kind; - - /** Creates an instance of CapabilityTypePropertiesRuntimeProperties class. */ - public CapabilityTypePropertiesRuntimeProperties() { - } - - /** - * Get the kind property: String of the kind of the resource's action type (continuous or discrete). - * - * @return the kind value. - */ - public String kind() { - return this.kind; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} 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 deleted file mode 100644 index b04d648c21f51..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/CapabilityTypes.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of CapabilityTypes. */ -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 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 list of Capability Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list(String locationName, 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 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. - * @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 Type resources for given Target Type and location as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list( - String locationName, 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 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. - * @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 Capability Type resource for given Target Type and location along with {@link Response}. - */ - Response getWithResponse( - String locationName, 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 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. - * @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 Capability Type resource for given Target Type and location. - */ - CapabilityType get(String locationName, String targetTypeName, String capabilityTypeName); -} 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 deleted file mode 100644 index b42856c08bfd0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ContinuousAction.java +++ /dev/null @@ -1,137 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; -import java.util.List; - -/** Model that represents a continuous action. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("continuous") -@Fluent -public final class ContinuousAction extends Action { - /* - * ISO8601 formatted string that represents a duration. - */ - @JsonProperty(value = "duration", required = true) - private Duration duration; - - /* - * List of key value pairs. - */ - @JsonProperty(value = "parameters", required = true) - private List parameters; - - /* - * String that represents a selector. - */ - @JsonProperty(value = "selectorId", required = true) - private String selectorId; - - /** Creates an instance of ContinuousAction class. */ - public ContinuousAction() { - } - - /** - * Get the duration property: ISO8601 formatted string that represents a duration. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Set the duration property: ISO8601 formatted string that represents a duration. - * - * @param duration the duration value to set. - * @return the ContinuousAction object itself. - */ - public ContinuousAction withDuration(Duration duration) { - this.duration = duration; - return this; - } - - /** - * Get the parameters property: List of key value pairs. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: List of key value pairs. - * - * @param parameters the parameters value to set. - * @return the ContinuousAction object itself. - */ - public ContinuousAction withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the selectorId property: String that represents a selector. - * - * @return the selectorId value. - */ - public String selectorId() { - return this.selectorId; - } - - /** - * Set the selectorId property: String that represents a selector. - * - * @param selectorId the selectorId value to set. - * @return the ContinuousAction object itself. - */ - public ContinuousAction withSelectorId(String selectorId) { - this.selectorId = selectorId; - return this; - } - - /** {@inheritDoc} */ - @Override - public ContinuousAction withName(String name) { - super.withName(name); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (duration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property duration in model ContinuousAction")); - } - if (parameters() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property parameters in model ContinuousAction")); - } else { - parameters().forEach(e -> e.validate()); - } - if (selectorId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property selectorId in model ContinuousAction")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ContinuousAction.class); -} 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 deleted file mode 100644 index b704318eccab5..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DelayAction.java +++ /dev/null @@ -1,72 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.time.Duration; - -/** Model that represents a delay action. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("delay") -@Fluent -public final class DelayAction extends Action { - /* - * ISO8601 formatted string that represents a duration. - */ - @JsonProperty(value = "duration", required = true) - private Duration duration; - - /** Creates an instance of DelayAction class. */ - public DelayAction() { - } - - /** - * Get the duration property: ISO8601 formatted string that represents a duration. - * - * @return the duration value. - */ - public Duration duration() { - return this.duration; - } - - /** - * Set the duration property: ISO8601 formatted string that represents a duration. - * - * @param duration the duration value to set. - * @return the DelayAction object itself. - */ - public DelayAction withDuration(Duration duration) { - this.duration = duration; - return this; - } - - /** {@inheritDoc} */ - @Override - public DelayAction withName(String name) { - super.withName(name); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (duration() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property duration in model DelayAction")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DelayAction.class); -} 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 deleted file mode 100644 index 148c4c785fe74..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/DiscreteAction.java +++ /dev/null @@ -1,105 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Model that represents a discrete action. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("discrete") -@Fluent -public final class DiscreteAction extends Action { - /* - * List of key value pairs. - */ - @JsonProperty(value = "parameters", required = true) - private List parameters; - - /* - * String that represents a selector. - */ - @JsonProperty(value = "selectorId", required = true) - private String selectorId; - - /** Creates an instance of DiscreteAction class. */ - public DiscreteAction() { - } - - /** - * Get the parameters property: List of key value pairs. - * - * @return the parameters value. - */ - public List parameters() { - return this.parameters; - } - - /** - * Set the parameters property: List of key value pairs. - * - * @param parameters the parameters value to set. - * @return the DiscreteAction object itself. - */ - public DiscreteAction withParameters(List parameters) { - this.parameters = parameters; - return this; - } - - /** - * Get the selectorId property: String that represents a selector. - * - * @return the selectorId value. - */ - public String selectorId() { - return this.selectorId; - } - - /** - * Set the selectorId property: String that represents a selector. - * - * @param selectorId the selectorId value to set. - * @return the DiscreteAction object itself. - */ - public DiscreteAction withSelectorId(String selectorId) { - this.selectorId = selectorId; - return this; - } - - /** {@inheritDoc} */ - @Override - public DiscreteAction withName(String name) { - super.withName(name); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (parameters() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property parameters in model DiscreteAction")); - } else { - parameters().forEach(e -> e.validate()); - } - if (selectorId() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property selectorId in model DiscreteAction")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(DiscreteAction.class); -} 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 deleted file mode 100644 index 6802361fc65b0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiment.java +++ /dev/null @@ -1,334 +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; - -import com.azure.core.http.rest.Response; -import com.azure.core.management.Region; -import com.azure.core.management.SystemData; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import java.util.List; -import java.util.Map; - -/** An immutable client-side representation of Experiment. */ -public interface Experiment { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * 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 location property: The geo-location where the resource lives. - * - * @return the location value. - */ - String location(); - - /** - * Gets the tags property: Resource tags. - * - * @return the tags value. - */ - Map tags(); - - /** - * Gets the systemData property: The system metadata of the experiment resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the identity property: The identity of the experiment resource. - * - * @return the identity value. - */ - ResourceIdentity identity(); - - /** - * Gets the steps property: List of steps. - * - * @return the steps value. - */ - List steps(); - - /** - * Gets the selectors property: List of selectors. - * - * @return the selectors value. - */ - List selectors(); - - /** - * Gets the startOnCreation property: A boolean value that indicates if experiment should be started on creation or - * not. - * - * @return the startOnCreation value. - */ - Boolean startOnCreation(); - - /** - * Gets the region of the resource. - * - * @return the region of the resource. - */ - Region region(); - - /** - * Gets the name of the resource region. - * - * @return the name of the resource region. - */ - String regionName(); - - /** - * Gets the name of the resource group. - * - * @return the name of the resource group. - */ - String resourceGroupName(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentInner object. - * - * @return the inner object. - */ - ExperimentInner innerModel(); - - /** The entirety of the Experiment definition. */ - interface Definition - extends DefinitionStages.Blank, - DefinitionStages.WithLocation, - DefinitionStages.WithResourceGroup, - DefinitionStages.WithSteps, - DefinitionStages.WithSelectors, - DefinitionStages.WithCreate { - } - - /** The Experiment definition stages. */ - interface DefinitionStages { - /** The first stage of the Experiment definition. */ - interface Blank extends WithLocation { - } - - /** The stage of the Experiment definition allowing to specify location. */ - interface WithLocation { - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(Region location); - - /** - * Specifies the region for the resource. - * - * @param location The geo-location where the resource lives. - * @return the next definition stage. - */ - WithResourceGroup withRegion(String location); - } - - /** The stage of the Experiment definition allowing to specify parent resource. */ - interface WithResourceGroup { - /** - * Specifies resourceGroupName. - * - * @param resourceGroupName String that represents an Azure resource group. - * @return the next definition stage. - */ - WithSteps withExistingResourceGroup(String resourceGroupName); - } - - /** The stage of the Experiment definition allowing to specify steps. */ - interface WithSteps { - /** - * Specifies the steps property: List of steps.. - * - * @param steps List of steps. - * @return the next definition stage. - */ - WithSelectors withSteps(List steps); - } - - /** The stage of the Experiment definition allowing to specify selectors. */ - interface WithSelectors { - /** - * Specifies the selectors property: List of selectors.. - * - * @param selectors List of selectors. - * @return the next definition stage. - */ - WithCreate withSelectors(List selectors); - } - - /** - * The stage of the Experiment definition which contains all the minimum required properties for the resource to - * be created, but also allows for any other optional properties to be specified. - */ - interface WithCreate - extends DefinitionStages.WithTags, DefinitionStages.WithIdentity, DefinitionStages.WithStartOnCreation { - /** - * Executes the create request. - * - * @return the created resource. - */ - Experiment create(); - - /** - * Executes the create request. - * - * @param context The context to associate with this operation. - * @return the created resource. - */ - Experiment create(Context context); - } - - /** The stage of the Experiment definition allowing to specify tags. */ - interface WithTags { - /** - * Specifies the tags property: Resource tags.. - * - * @param tags Resource tags. - * @return the next definition stage. - */ - WithCreate withTags(Map tags); - } - - /** The stage of the Experiment definition allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The identity of the experiment resource.. - * - * @param identity The identity of the experiment resource. - * @return the next definition stage. - */ - WithCreate withIdentity(ResourceIdentity identity); - } - - /** The stage of the Experiment definition allowing to specify startOnCreation. */ - interface WithStartOnCreation { - /** - * Specifies the startOnCreation property: A boolean value that indicates if experiment should be started on - * creation or not.. - * - * @param startOnCreation A boolean value that indicates if experiment should be started on creation or not. - * @return the next definition stage. - */ - WithCreate withStartOnCreation(Boolean startOnCreation); - } - } - - /** - * Begins update for the Experiment resource. - * - * @return the stage of resource update. - */ - Experiment.Update update(); - - /** The template for Experiment update. */ - interface Update extends UpdateStages.WithIdentity { - /** - * Executes the update request. - * - * @return the updated resource. - */ - Experiment apply(); - - /** - * Executes the update request. - * - * @param context The context to associate with this operation. - * @return the updated resource. - */ - Experiment apply(Context context); - } - - /** The Experiment update stages. */ - interface UpdateStages { - /** The stage of the Experiment update allowing to specify identity. */ - interface WithIdentity { - /** - * Specifies the identity property: The identity of the experiment resource.. - * - * @param identity The identity of the experiment resource. - * @return the next definition stage. - */ - Update withIdentity(ResourceIdentity identity); - } - } - - /** - * Refreshes the resource to sync with Azure. - * - * @return the refreshed resource. - */ - Experiment refresh(); - - /** - * Refreshes the resource to sync with Azure. - * - * @param context The context to associate with this operation. - * @return the refreshed resource. - */ - Experiment refresh(Context context); - - /** - * Cancel a running Experiment resource. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents the result of a cancel Experiment operation along with {@link Response}. - */ - Response cancelWithResponse(Context context); - - /** - * Cancel a running Experiment resource. - * - * @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 the result of a cancel Experiment operation. - */ - ExperimentCancelOperationResult cancel(); - - /** - * Start a Experiment resource. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return model that represents the result of a start Experiment operation along with {@link Response}. - */ - Response startWithResponse(Context context); - - /** - * Start a Experiment resource. - * - * @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 the result of a start Experiment operation. - */ - ExperimentStartOperationResult start(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentCancelOperationResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentCancelOperationResult.java deleted file mode 100644 index 863656108f975..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentCancelOperationResult.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner; - -/** An immutable client-side representation of ExperimentCancelOperationResult. */ -public interface ExperimentCancelOperationResult { - /** - * Gets the name property: String of the Experiment name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the statusUrl property: URL to retrieve the Experiment status. - * - * @return the statusUrl value. - */ - String statusUrl(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentCancelOperationResultInner object. - * - * @return the inner object. - */ - ExperimentCancelOperationResultInner innerModel(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsError.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsError.java deleted file mode 100644 index 39adeaad1e032..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsError.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents the Experiment action target details error model. */ -@Immutable -public final class ExperimentExecutionActionTargetDetailsError { - /* - * The error code. - */ - @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY) - private String code; - - /* - * The error message - */ - @JsonProperty(value = "message", access = JsonProperty.Access.WRITE_ONLY) - private String message; - - /** Creates an instance of ExperimentExecutionActionTargetDetailsError class. */ - public ExperimentExecutionActionTargetDetailsError() { - } - - /** - * Get the code property: The error code. - * - * @return the code value. - */ - public String code() { - return this.code; - } - - /** - * Get the message property: The error message. - * - * @return the message value. - */ - public String message() { - return this.message; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsProperties.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsProperties.java deleted file mode 100644 index b238ea3c146e8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionActionTargetDetailsProperties.java +++ /dev/null @@ -1,103 +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; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.time.OffsetDateTime; - -/** Model that represents the Experiment action target details properties model. */ -@Immutable -public final class ExperimentExecutionActionTargetDetailsProperties { - /* - * The status of the execution. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The target for the action. - */ - @JsonProperty(value = "target", access = JsonProperty.Access.WRITE_ONLY) - private String target; - - /* - * String that represents the failed date time. - */ - @JsonProperty(value = "targetFailedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime targetFailedTime; - - /* - * String that represents the completed date time. - */ - @JsonProperty(value = "targetCompletedTime", access = JsonProperty.Access.WRITE_ONLY) - private OffsetDateTime targetCompletedTime; - - /* - * The error of the action. - */ - @JsonProperty(value = "error", access = JsonProperty.Access.WRITE_ONLY) - private ExperimentExecutionActionTargetDetailsError error; - - /** Creates an instance of ExperimentExecutionActionTargetDetailsProperties class. */ - public ExperimentExecutionActionTargetDetailsProperties() { - } - - /** - * Get the status property: The status of the execution. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the target property: The target for the action. - * - * @return the target value. - */ - public String target() { - return this.target; - } - - /** - * Get the targetFailedTime property: String that represents the failed date time. - * - * @return the targetFailedTime value. - */ - public OffsetDateTime targetFailedTime() { - return this.targetFailedTime; - } - - /** - * Get the targetCompletedTime property: String that represents the completed date time. - * - * @return the targetCompletedTime value. - */ - public OffsetDateTime targetCompletedTime() { - return this.targetCompletedTime; - } - - /** - * Get the error property: The error of the action. - * - * @return the error value. - */ - public ExperimentExecutionActionTargetDetailsError error() { - return this.error; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (error() != null) { - error().validate(); - } - } -} 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 deleted file mode 100644 index 7c9b3f5f1e47e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetails.java +++ /dev/null @@ -1,95 +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; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of ExperimentExecutionDetails. */ -public interface ExperimentExecutionDetails { - /** - * 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. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: String of the resource name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the experimentId property: The id of the experiment. - * - * @return the experimentId value. - */ - String experimentId(); - - /** - * Gets the status property: The value of the status of the experiment execution. - * - * @return the status value. - */ - String status(); - - /** - * Gets the failureReason property: The reason why the execution failed. - * - * @return the failureReason value. - */ - String failureReason(); - - /** - * Gets the createdDateTime property: String that represents the created date time. - * - * @return the createdDateTime value. - */ - OffsetDateTime createdDateTime(); - - /** - * Gets the lastActionDateTime property: String that represents the last action date time. - * - * @return the lastActionDateTime value. - */ - OffsetDateTime lastActionDateTime(); - - /** - * Gets the startDateTime property: String that represents the start date time. - * - * @return the startDateTime value. - */ - OffsetDateTime startDateTime(); - - /** - * Gets the stopDateTime property: String that represents the stop date time. - * - * @return the stopDateTime value. - */ - OffsetDateTime stopDateTime(); - - /** - * Gets the runInformation property: The information of the experiment run. - * - * @return the runInformation value. - */ - ExperimentExecutionDetailsPropertiesRunInformation runInformation(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner object. - * - * @return the inner object. - */ - ExperimentExecutionDetailsInner innerModel(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsListResult.java deleted file mode 100644 index 9b96e10d36b84..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentExecutionDetailsInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Experiment execution details and a link for pagination. */ -@Immutable -public final class ExperimentExecutionDetailsListResult { - /* - * List of Experiment execution details. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Experiment execution details. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ExperimentExecutionDetailsListResult class. */ - public ExperimentExecutionDetailsListResult() { - } - - /** - * Get the value property: List of Experiment execution details. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Experiment execution details. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsPropertiesRunInformation.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsPropertiesRunInformation.java deleted file mode 100644 index 11f4e69ec52cc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentExecutionDetailsPropertiesRunInformation.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** The information of the experiment run. */ -@Immutable -public final class ExperimentExecutionDetailsPropertiesRunInformation { - /* - * The steps of the experiment run. - */ - @JsonProperty(value = "steps", access = JsonProperty.Access.WRITE_ONLY) - private List steps; - - /** Creates an instance of ExperimentExecutionDetailsPropertiesRunInformation class. */ - public ExperimentExecutionDetailsPropertiesRunInformation() { - } - - /** - * Get the steps property: The steps of the experiment run. - * - * @return the steps value. - */ - public List steps() { - return this.steps; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (steps() != null) { - steps().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index 3c55db51087b0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Experiment resources and a link for pagination. */ -@Immutable -public final class ExperimentListResult { - /* - * List of Experiment resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Experiment resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ExperimentListResult class. */ - public ExperimentListResult() { - } - - /** - * Get the value property: List of Experiment resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Experiment resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStartOperationResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStartOperationResult.java deleted file mode 100644 index 0db3964c30d31..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStartOperationResult.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner; - -/** An immutable client-side representation of ExperimentStartOperationResult. */ -public interface ExperimentStartOperationResult { - /** - * Gets the name property: String of the Experiment name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the statusUrl property: URL to retrieve the Experiment status. - * - * @return the statusUrl value. - */ - String statusUrl(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentStartOperationResultInner object. - * - * @return the inner object. - */ - ExperimentStartOperationResultInner innerModel(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatus.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatus.java deleted file mode 100644 index 2924619daa9e7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatus.java +++ /dev/null @@ -1,60 +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; - -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import java.time.OffsetDateTime; - -/** An immutable client-side representation of ExperimentStatus. */ -public interface ExperimentStatus { - /** - * 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. - * - * @return the id value. - */ - String id(); - - /** - * Gets the name property: String of the resource name. - * - * @return the name value. - */ - String name(); - - /** - * Gets the status property: String that represents the status of a Experiment. - * - * @return the status value. - */ - String status(); - - /** - * Gets the createdDateUtc property: String that represents the created date time of a Experiment. - * - * @return the createdDateUtc value. - */ - OffsetDateTime createdDateUtc(); - - /** - * Gets the endDateUtc property: String that represents the end date time of a Experiment. - * - * @return the endDateUtc value. - */ - OffsetDateTime endDateUtc(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner object. - * - * @return the inner object. - */ - ExperimentStatusInner innerModel(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatusListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatusListResult.java deleted file mode 100644 index 465ebd010b07f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentStatusListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Experiment statuses and a link for pagination. */ -@Immutable -public final class ExperimentStatusListResult { - /* - * List of Experiment statuses. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Experiment statuses. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of ExperimentStatusListResult class. */ - public ExperimentStatusListResult() { - } - - /** - * Get the value property: List of Experiment statuses. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Experiment statuses. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index 9f36b57da5487..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ExperimentUpdate.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Describes an experiment update. */ -@Fluent -public final class ExperimentUpdate { - /* - * The identity of the experiment resource. - */ - @JsonProperty(value = "identity") - private ResourceIdentity identity; - - /** Creates an instance of ExperimentUpdate class. */ - public ExperimentUpdate() { - } - - /** - * Get the identity property: The identity of the experiment resource. - * - * @return the identity value. - */ - public ResourceIdentity identity() { - return this.identity; - } - - /** - * Set the identity property: The identity of the experiment resource. - * - * @param identity the identity value to set. - * @return the ExperimentUpdate object itself. - */ - public ExperimentUpdate withIdentity(ResourceIdentity identity) { - this.identity = identity; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (identity() != null) { - identity().validate(); - } - } -} 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 deleted file mode 100644 index e5449ba5a57dd..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Experiments.java +++ /dev/null @@ -1,325 +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; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of Experiments. */ -public interface Experiments { - /** - * Get a list of Experiment resources in a subscription. - * - * @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 Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(); - - /** - * Get a list of Experiment resources in a subscription. - * - * @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. - * @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 Experiment resources in a subscription as paginated response with {@link PagedIterable}. - */ - PagedIterable list(Boolean running, String continuationToken, Context context); - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Get a list of Experiment resources in a resource group. - * - * @param resourceGroupName String that represents an Azure resource group. - * @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. - * @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 Experiment resources in a resource group as paginated response with {@link PagedIterable}. - */ - 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. - * @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}. - */ - Response deleteByResourceGroupWithResponse(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. - */ - void deleteByResourceGroup(String resourceGroupName, String experimentName); - - /** - * Get 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 a Experiment resource along with {@link Response}. - */ - Response getByResourceGroupWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Get 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 a Experiment resource. - */ - Experiment getByResourceGroup(String resourceGroupName, String experimentName); - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation along with {@link Response}. - */ - Response cancelWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Cancel a running 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 model that represents the result of a cancel Experiment operation. - */ - ExperimentCancelOperationResult cancel(String resourceGroupName, String experimentName); - - /** - * Start 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 model that represents the result of a start Experiment operation along with {@link Response}. - */ - Response startWithResponse( - String resourceGroupName, String experimentName, Context context); - - /** - * Start 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 model that represents the result of a start Experiment operation. - */ - ExperimentStartOperationResult start(String resourceGroupName, String experimentName); - - /** - * Get a list of statuses of 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 a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - PagedIterable listAllStatuses(String resourceGroupName, String experimentName); - - /** - * Get a list of statuses of 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 a list of statuses of a Experiment resource as paginated response with {@link PagedIterable}. - */ - PagedIterable listAllStatuses(String resourceGroupName, String experimentName, Context context); - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource along with {@link Response}. - */ - Response getStatusWithResponse( - String resourceGroupName, String experimentName, String statusId, Context context); - - /** - * Get a status of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param statusId GUID that represents a Experiment status. - * @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 status of a Experiment resource. - */ - ExperimentStatus getStatus(String resourceGroupName, String experimentName, String statusId); - - /** - * Get a list of execution details of 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 a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - PagedIterable listExecutionDetails(String resourceGroupName, String experimentName); - - /** - * Get a list of execution details of 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 a list of execution details of a Experiment resource as paginated response with {@link PagedIterable}. - */ - PagedIterable listExecutionDetails( - String resourceGroupName, String experimentName, Context context); - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource along with {@link Response}. - */ - Response getExecutionDetailsWithResponse( - String resourceGroupName, String experimentName, String executionDetailsId, Context context); - - /** - * Get an execution detail of a Experiment resource. - * - * @param resourceGroupName String that represents an Azure resource group. - * @param experimentName String that represents a Experiment resource name. - * @param executionDetailsId GUID that represents a Experiment execution detail. - * @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 an execution detail of a Experiment resource. - */ - ExperimentExecutionDetails getExecutionDetails( - String resourceGroupName, String experimentName, String executionDetailsId); - - /** - * Get a Experiment resource. - * - * @param id the resource ID. - * @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 Experiment resource along with {@link Response}. - */ - Experiment getById(String id); - - /** - * Get a Experiment resource. - * - * @param id the resource ID. - * @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 Experiment resource along with {@link Response}. - */ - Response getByIdWithResponse(String id, Context context); - - /** - * Delete a Experiment resource. - * - * @param id the resource ID. - * @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 deleteById(String id); - - /** - * Delete a Experiment resource. - * - * @param id the resource ID. - * @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}. - */ - Response deleteByIdWithResponse(String id, Context context); - - /** - * Begins definition for a new Experiment resource. - * - * @param name resource name. - * @return the first stage of the new Experiment definition. - */ - Experiment.DefinitionStages.Blank define(String name); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.java deleted file mode 100644 index de171a32c6939..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Filter.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Model that represents available filter types that can be applied to a targets list. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = Filter.class) -@JsonTypeName("Filter") -@JsonSubTypes({@JsonSubTypes.Type(name = "Simple", value = SimpleFilter.class)}) -@Immutable -public class Filter { - /** Creates an instance of Filter class. */ - public Filter() { - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/FilterType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/FilterType.java deleted file mode 100644 index 53ee9caa8191a..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/FilterType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Enum that discriminates between filter types. Currently only `Simple` type is supported. */ -public final class FilterType extends ExpandableStringEnum { - /** Static value Simple for FilterType. */ - public static final FilterType SIMPLE = fromString("Simple"); - - /** - * Creates a new instance of FilterType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public FilterType() { - } - - /** - * Creates or finds a FilterType from its string representation. - * - * @param name a name to look for. - * @return the corresponding FilterType. - */ - @JsonCreator - public static FilterType fromString(String name) { - return fromString(name, FilterType.class); - } - - /** - * Gets known FilterType values. - * - * @return known FilterType values. - */ - public static Collection values() { - return values(FilterType.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/KeyValuePair.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/KeyValuePair.java deleted file mode 100644 index 8b63f9050d981..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/KeyValuePair.java +++ /dev/null @@ -1,89 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** A map to describe the settings of an action. */ -@Fluent -public final class KeyValuePair { - /* - * The name of the setting for the action. - */ - @JsonProperty(value = "key", required = true) - private String key; - - /* - * The value of the setting for the action. - */ - @JsonProperty(value = "value", required = true) - private String value; - - /** Creates an instance of KeyValuePair class. */ - public KeyValuePair() { - } - - /** - * Get the key property: The name of the setting for the action. - * - * @return the key value. - */ - public String key() { - return this.key; - } - - /** - * Set the key property: The name of the setting for the action. - * - * @param key the key value to set. - * @return the KeyValuePair object itself. - */ - public KeyValuePair withKey(String key) { - this.key = key; - return this; - } - - /** - * Get the value property: The value of the setting for the action. - * - * @return the value value. - */ - public String value() { - return this.value; - } - - /** - * Set the value property: The value of the setting for the action. - * - * @param value the value value to set. - * @return the KeyValuePair object itself. - */ - public KeyValuePair withValue(String value) { - this.value = value; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (key() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property key in model KeyValuePair")); - } - if (value() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property value in model KeyValuePair")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(KeyValuePair.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java deleted file mode 100644 index 60dbb9084e660..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ListSelector.java +++ /dev/null @@ -1,81 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Model that represents a list selector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("List") -@Fluent -public final class ListSelector extends Selector { - /* - * List of Target references. - */ - @JsonProperty(value = "targets", required = true) - private List targets; - - /** Creates an instance of ListSelector class. */ - public ListSelector() { - } - - /** - * Get the targets property: List of Target references. - * - * @return the targets value. - */ - public List targets() { - return this.targets; - } - - /** - * Set the targets property: List of Target references. - * - * @param targets the targets value to set. - * @return the ListSelector object itself. - */ - public ListSelector withTargets(List targets) { - this.targets = targets; - return this; - } - - /** {@inheritDoc} */ - @Override - public ListSelector withId(String id) { - super.withId(id); - return this; - } - - /** {@inheritDoc} */ - @Override - public ListSelector withFilter(Filter filter) { - super.withFilter(filter); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (targets() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property targets in model ListSelector")); - } else { - targets().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ListSelector.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operation.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operation.java deleted file mode 100644 index b5c9d7060c9d1..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operation.java +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; - -/** An immutable client-side representation of Operation. */ -public interface Operation { - /** - * Gets the name property: The name of the operation, as per Resource-Based Access Control (RBAC). Examples: - * "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action". - * - * @return the name value. - */ - String name(); - - /** - * Gets the isDataAction property: Whether the operation applies to data-plane. This is "true" for data-plane - * operations and "false" for ARM/control-plane operations. - * - * @return the isDataAction value. - */ - Boolean isDataAction(); - - /** - * Gets the display property: Localized display information for this particular operation. - * - * @return the display value. - */ - OperationDisplay display(); - - /** - * Gets the origin property: The intended executor of the operation; as in Resource Based Access Control (RBAC) and - * audit logs UX. Default value is "user,system". - * - * @return the origin value. - */ - Origin origin(); - - /** - * Gets the actionType property: Enum. Indicates the action type. "Internal" refers to actions that are for internal - * only APIs. - * - * @return the actionType value. - */ - ActionType actionType(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.OperationInner object. - * - * @return the inner object. - */ - OperationInner innerModel(); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationDisplay.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationDisplay.java deleted file mode 100644 index c94f5b20ac746..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationDisplay.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.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Localized display information for this particular operation. */ -@Immutable -public final class OperationDisplay { - /* - * The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft - * Compute". - */ - @JsonProperty(value = "provider", access = JsonProperty.Access.WRITE_ONLY) - private String provider; - - /* - * The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job - * Schedule Collections". - */ - @JsonProperty(value = "resource", access = JsonProperty.Access.WRITE_ONLY) - private String resource; - - /* - * The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual - * Machine", "Restart Virtual Machine". - */ - @JsonProperty(value = "operation", access = JsonProperty.Access.WRITE_ONLY) - private String operation; - - /* - * The short, localized friendly description of the operation; suitable for tool tips and detailed views. - */ - @JsonProperty(value = "description", access = JsonProperty.Access.WRITE_ONLY) - private String description; - - /** Creates an instance of OperationDisplay class. */ - public OperationDisplay() { - } - - /** - * Get the provider property: The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring - * Insights" or "Microsoft Compute". - * - * @return the provider value. - */ - public String provider() { - return this.provider; - } - - /** - * Get the resource property: The localized friendly name of the resource type related to this operation. E.g. - * "Virtual Machines" or "Job Schedule Collections". - * - * @return the resource value. - */ - public String resource() { - return this.resource; - } - - /** - * Get the operation property: The concise, localized friendly name for the operation; suitable for dropdowns. E.g. - * "Create or Update Virtual Machine", "Restart Virtual Machine". - * - * @return the operation value. - */ - public String operation() { - return this.operation; - } - - /** - * Get the description property: The short, localized friendly description of the operation; suitable for tool tips - * and detailed views. - * - * @return the description value. - */ - public String description() { - return this.description; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationListResult.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationListResult.java deleted file mode 100644 index 62f3cb4b30bf7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/OperationListResult.java +++ /dev/null @@ -1,62 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.OperationInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** - * A list of REST API operations supported by an Azure Resource Provider. It contains an URL link to get the next set of - * results. - */ -@Immutable -public final class OperationListResult { - /* - * List of operations supported by the resource provider - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to get the next set of operation list results (if there are any). - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of OperationListResult class. */ - public OperationListResult() { - } - - /** - * Get the value property: List of operations supported by the resource provider. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to get the next set of operation list results (if there are any). - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index a0fb76ffe3943..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Operations.java +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.util.Context; - -/** Resource collection API of Operations. */ -public interface Operations { - /** - * Get a list all available Operations. - * - * @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}. - */ - PagedIterable listAll(); - - /** - * Get a list all available Operations. - * - * @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}. - */ - PagedIterable listAll(Context context); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Origin.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Origin.java deleted file mode 100644 index daccb78e7d022..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Origin.java +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** - * The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value - * is "user,system". - */ -public final class Origin extends ExpandableStringEnum { - /** Static value user for Origin. */ - public static final Origin USER = fromString("user"); - - /** Static value system for Origin. */ - public static final Origin SYSTEM = fromString("system"); - - /** Static value user,system for Origin. */ - public static final Origin USER_SYSTEM = fromString("user,system"); - - /** - * Creates a new instance of Origin value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public Origin() { - } - - /** - * Creates or finds a Origin from its string representation. - * - * @param name a name to look for. - * @return the corresponding Origin. - */ - @JsonCreator - public static Origin fromString(String name) { - return fromString(name, Origin.class); - } - - /** - * Gets known Origin values. - * - * @return known Origin values. - */ - public static Collection values() { - return values(Origin.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java deleted file mode 100644 index ce9014ce3401f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/QuerySelector.java +++ /dev/null @@ -1,110 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.List; - -/** Model that represents a query selector. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("Query") -@Fluent -public final class QuerySelector extends Selector { - /* - * Azure Resource Graph (ARG) Query Language query for target resources. - */ - @JsonProperty(value = "queryString", required = true) - private String queryString; - - /* - * Subscription id list to scope resource query. - */ - @JsonProperty(value = "subscriptionIds", required = true) - private List subscriptionIds; - - /** Creates an instance of QuerySelector class. */ - public QuerySelector() { - } - - /** - * Get the queryString property: Azure Resource Graph (ARG) Query Language query for target resources. - * - * @return the queryString value. - */ - public String queryString() { - return this.queryString; - } - - /** - * Set the queryString property: Azure Resource Graph (ARG) Query Language query for target resources. - * - * @param queryString the queryString value to set. - * @return the QuerySelector object itself. - */ - public QuerySelector withQueryString(String queryString) { - this.queryString = queryString; - return this; - } - - /** - * Get the subscriptionIds property: Subscription id list to scope resource query. - * - * @return the subscriptionIds value. - */ - public List subscriptionIds() { - return this.subscriptionIds; - } - - /** - * Set the subscriptionIds property: Subscription id list to scope resource query. - * - * @param subscriptionIds the subscriptionIds value to set. - * @return the QuerySelector object itself. - */ - public QuerySelector withSubscriptionIds(List subscriptionIds) { - this.subscriptionIds = subscriptionIds; - return this; - } - - /** {@inheritDoc} */ - @Override - public QuerySelector withId(String id) { - super.withId(id); - return this; - } - - /** {@inheritDoc} */ - @Override - public QuerySelector withFilter(Filter filter) { - super.withFilter(filter); - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (queryString() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property queryString in model QuerySelector")); - } - if (subscriptionIds() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property subscriptionIds in model QuerySelector")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(QuerySelector.class); -} 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/ResourceIdentity.java deleted file mode 100644 index 7dcd66abfac37..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentity.java +++ /dev/null @@ -1,133 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonInclude; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.Map; - -/** The identity of a resource. */ -@Fluent -public final class ResourceIdentity { - /* - * String of the resource identity type. - */ - @JsonProperty(value = "type", required = true) - private ResourceIdentityType type; - - /* - * 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}'. - */ - @JsonProperty(value = "userAssignedIdentities") - @JsonInclude(value = JsonInclude.Include.NON_NULL, content = JsonInclude.Include.ALWAYS) - private Map userAssignedIdentities; - - /* - * GUID that represents the principal ID of this resource identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private String principalId; - - /* - * GUID that represents the tenant ID of this resource identity. - */ - @JsonProperty(value = "tenantId", access = JsonProperty.Access.WRITE_ONLY) - private String tenantId; - - /** Creates an instance of ResourceIdentity class. */ - public ResourceIdentity() { - } - - /** - * Get the type property: String of the resource identity type. - * - * @return the type value. - */ - public ResourceIdentityType type() { - return this.type; - } - - /** - * Set the type property: String of the resource identity type. - * - * @param type the type value to set. - * @return the ResourceIdentity object itself. - */ - public ResourceIdentity withType(ResourceIdentityType type) { - this.type = type; - return this; - } - - /** - * 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}'. - * - * @return the userAssignedIdentities value. - */ - public Map userAssignedIdentities() { - return this.userAssignedIdentities; - } - - /** - * 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}'. - * - * @param userAssignedIdentities the userAssignedIdentities value to set. - * @return the ResourceIdentity object itself. - */ - public ResourceIdentity withUserAssignedIdentities(Map userAssignedIdentities) { - this.userAssignedIdentities = userAssignedIdentities; - return this; - } - - /** - * Get the principalId property: GUID that represents the principal ID of this resource identity. - * - * @return the principalId value. - */ - public String principalId() { - return this.principalId; - } - - /** - * Get the tenantId property: GUID that represents the tenant ID of this resource identity. - * - * @return the tenantId value. - */ - public String tenantId() { - return this.tenantId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model ResourceIdentity")); - } - if (userAssignedIdentities() != null) { - userAssignedIdentities() - .values() - .forEach( - e -> { - if (e != null) { - e.validate(); - } - }); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(ResourceIdentity.class); -} 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 682743cc21364..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/ResourceIdentityType.java +++ /dev/null @@ -1,54 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonValue; - -/** 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. - */ - @JsonCreator - 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} */ - @JsonValue - @Override - public String toString() { - return this.value; - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java deleted file mode 100644 index 441ca3a984e3c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Selector.java +++ /dev/null @@ -1,138 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import com.fasterxml.jackson.annotation.JsonIgnore; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import java.util.HashMap; -import java.util.Map; - -/** Model that represents a selector in the Experiment resource. */ -@JsonTypeInfo( - use = JsonTypeInfo.Id.NAME, - include = JsonTypeInfo.As.PROPERTY, - property = "type", - defaultImpl = Selector.class) -@JsonTypeName("Selector") -@JsonSubTypes({ - @JsonSubTypes.Type(name = "List", value = ListSelector.class), - @JsonSubTypes.Type(name = "Query", value = QuerySelector.class) -}) -@Fluent -public class Selector { - /* - * String of the selector ID. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /* - * Model that represents available filter types that can be applied to a targets list. - */ - @JsonProperty(value = "filter") - private Filter filter; - - /* - * Model that represents a selector in the Experiment resource. - */ - @JsonIgnore private Map additionalProperties; - - /** Creates an instance of Selector class. */ - public Selector() { - } - - /** - * Get the id property: String of the selector ID. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: String of the selector ID. - * - * @param id the id value to set. - * @return the Selector object itself. - */ - public Selector withId(String id) { - this.id = id; - return this; - } - - /** - * Get the filter property: Model that represents available filter types that can be applied to a targets list. - * - * @return the filter value. - */ - public Filter filter() { - return this.filter; - } - - /** - * Set the filter property: Model that represents available filter types that can be applied to a targets list. - * - * @param filter the filter value to set. - * @return the Selector object itself. - */ - public Selector withFilter(Filter filter) { - this.filter = filter; - return this; - } - - /** - * Get the additionalProperties property: Model that represents a selector in the Experiment resource. - * - * @return the additionalProperties value. - */ - @JsonAnyGetter - 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 Selector object itself. - */ - public Selector withAdditionalProperties(Map additionalProperties) { - this.additionalProperties = additionalProperties; - return this; - } - - @JsonAnySetter - void withAdditionalProperties(String key, Object value) { - if (additionalProperties == null) { - additionalProperties = new HashMap<>(); - } - additionalProperties.put(key, value); - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (id() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property id in model Selector")); - } - if (filter() != null) { - filter().validate(); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Selector.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SelectorType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SelectorType.java deleted file mode 100644 index 1ea697825d764..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SelectorType.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Enum of the selector type. */ -public final class SelectorType extends ExpandableStringEnum { - /** Static value List for SelectorType. */ - public static final SelectorType LIST = fromString("List"); - - /** Static value Query for SelectorType. */ - public static final SelectorType QUERY = fromString("Query"); - - /** - * Creates a new instance of SelectorType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public SelectorType() { - } - - /** - * Creates or finds a SelectorType from its string representation. - * - * @param name a name to look for. - * @return the corresponding SelectorType. - */ - @JsonCreator - public static SelectorType fromString(String name) { - return fromString(name, SelectorType.class); - } - - /** - * Gets known SelectorType values. - * - * @return known SelectorType values. - */ - public static Collection values() { - return values(SelectorType.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java deleted file mode 100644 index 46ff007cc7ab9..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilter.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; - -/** Model that represents a simple target filter. */ -@JsonTypeInfo(use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type") -@JsonTypeName("Simple") -@Fluent -public final class SimpleFilter extends Filter { - /* - * Model that represents the Simple filter parameters. - */ - @JsonProperty(value = "parameters") - private SimpleFilterParameters parameters; - - /** Creates an instance of SimpleFilter class. */ - public SimpleFilter() { - } - - /** - * Get the parameters property: Model that represents the Simple filter parameters. - * - * @return the parameters value. - */ - public SimpleFilterParameters parameters() { - return this.parameters; - } - - /** - * Set the parameters property: Model that represents the Simple filter parameters. - * - * @param parameters the parameters value to set. - * @return the SimpleFilter object itself. - */ - public SimpleFilter withParameters(SimpleFilterParameters parameters) { - this.parameters = parameters; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - @Override - public void validate() { - super.validate(); - if (parameters() != null) { - parameters().validate(); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java deleted file mode 100644 index b3b08c559efe0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/SimpleFilterParameters.java +++ /dev/null @@ -1,51 +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; - -import com.azure.core.annotation.Fluent; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the Simple filter parameters. */ -@Fluent -public final class SimpleFilterParameters { - /* - * List of Azure availability zones to filter targets by. - */ - @JsonProperty(value = "zones") - private List zones; - - /** Creates an instance of SimpleFilterParameters class. */ - public SimpleFilterParameters() { - } - - /** - * Get the zones property: List of Azure availability zones to filter targets by. - * - * @return the zones value. - */ - public List zones() { - return this.zones; - } - - /** - * Set the zones property: List of Azure availability zones to filter targets by. - * - * @param zones the zones value to set. - * @return the SimpleFilterParameters object itself. - */ - public SimpleFilterParameters withZones(List zones) { - this.zones = zones; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java deleted file mode 100644 index a8e01d2246e06..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Step.java +++ /dev/null @@ -1,90 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a step in the Experiment resource. */ -@Fluent -public final class Step { - /* - * String of the step name. - */ - @JsonProperty(value = "name", required = true) - private String name; - - /* - * List of branches. - */ - @JsonProperty(value = "branches", required = true) - private List branches; - - /** Creates an instance of Step class. */ - public Step() { - } - - /** - * Get the name property: String of the step name. - * - * @return the name value. - */ - public String name() { - return this.name; - } - - /** - * Set the name property: String of the step name. - * - * @param name the name value to set. - * @return the Step object itself. - */ - public Step withName(String name) { - this.name = name; - return this; - } - - /** - * Get the branches property: List of branches. - * - * @return the branches value. - */ - public List branches() { - return this.branches; - } - - /** - * Set the branches property: List of branches. - * - * @param branches the branches value to set. - * @return the Step object itself. - */ - public Step withBranches(List branches) { - this.branches = branches; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (name() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property name in model Step")); - } - if (branches() == null) { - throw LOGGER - .logExceptionAsError(new IllegalArgumentException("Missing required property branches in model Step")); - } else { - branches().forEach(e -> e.validate()); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(Step.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/StepStatus.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/StepStatus.java deleted file mode 100644 index c4670d561f380..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/StepStatus.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents the a list of branches and branch statuses. */ -@Immutable -public final class StepStatus { - /* - * The name of the step. - */ - @JsonProperty(value = "stepName", access = JsonProperty.Access.WRITE_ONLY) - private String stepName; - - /* - * The id of the step. - */ - @JsonProperty(value = "stepId", access = JsonProperty.Access.WRITE_ONLY) - private String stepId; - - /* - * The value of the status of the step. - */ - @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY) - private String status; - - /* - * The array of branches. - */ - @JsonProperty(value = "branches", access = JsonProperty.Access.WRITE_ONLY) - private List branches; - - /** Creates an instance of StepStatus class. */ - public StepStatus() { - } - - /** - * Get the stepName property: The name of the step. - * - * @return the stepName value. - */ - public String stepName() { - return this.stepName; - } - - /** - * Get the stepId property: The id of the step. - * - * @return the stepId value. - */ - public String stepId() { - return this.stepId; - } - - /** - * Get the status property: The value of the status of the step. - * - * @return the status value. - */ - public String status() { - return this.status; - } - - /** - * Get the branches property: The array of branches. - * - * @return the branches value. - */ - public List branches() { - return this.branches; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (branches() != null) { - branches().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index 064f0d74239b0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Target.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; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import java.util.Map; - -/** An immutable client-side representation of Target. */ -public interface Target { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * 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: The system metadata of the target resource. - * - * @return the systemData value. - */ - SystemData systemData(); - - /** - * Gets the location property: Location of the target resource. - * - * @return the location value. - */ - String location(); - - /** - * Gets the properties property: The properties of the target resource. - * - * @return the properties value. - */ - Map properties(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.TargetInner object. - * - * @return the inner object. - */ - TargetInner innerModel(); -} 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 deleted file mode 100644 index de6d488fdf68b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Target resources and a link for pagination. */ -@Immutable -public final class TargetListResult { - /* - * List of Target resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Target resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of TargetListResult class. */ - public TargetListResult() { - } - - /** - * Get the value property: List of Target resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Target resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReference.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReference.java deleted file mode 100644 index d6d40028cf072..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReference.java +++ /dev/null @@ -1,89 +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; - -import com.azure.core.annotation.Fluent; -import com.azure.core.util.logging.ClientLogger; -import com.fasterxml.jackson.annotation.JsonProperty; - -/** Model that represents a reference to a Target in the selector. */ -@Fluent -public final class TargetReference { - /* - * Enum of the Target reference type. - */ - @JsonProperty(value = "type", required = true) - private TargetReferenceType type; - - /* - * String of the resource ID of a Target resource. - */ - @JsonProperty(value = "id", required = true) - private String id; - - /** Creates an instance of TargetReference class. */ - public TargetReference() { - } - - /** - * Get the type property: Enum of the Target reference type. - * - * @return the type value. - */ - public TargetReferenceType type() { - return this.type; - } - - /** - * Set the type property: Enum of the Target reference type. - * - * @param type the type value to set. - * @return the TargetReference object itself. - */ - public TargetReference withType(TargetReferenceType type) { - this.type = type; - return this; - } - - /** - * Get the id property: String of the resource ID of a Target resource. - * - * @return the id value. - */ - public String id() { - return this.id; - } - - /** - * Set the id property: String of the resource ID of a Target resource. - * - * @param id the id value to set. - * @return the TargetReference object itself. - */ - public TargetReference withId(String id) { - this.id = id; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (type() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property type in model TargetReference")); - } - if (id() == null) { - throw LOGGER - .logExceptionAsError( - new IllegalArgumentException("Missing required property id in model TargetReference")); - } - } - - private static final ClientLogger LOGGER = new ClientLogger(TargetReference.class); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReferenceType.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReferenceType.java deleted file mode 100644 index 81ed19e0d1235..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetReferenceType.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.models; - -import com.azure.core.util.ExpandableStringEnum; -import com.fasterxml.jackson.annotation.JsonCreator; -import java.util.Collection; - -/** Enum of the Target reference type. */ -public final class TargetReferenceType extends ExpandableStringEnum { - /** Static value ChaosTarget for TargetReferenceType. */ - public static final TargetReferenceType CHAOS_TARGET = fromString("ChaosTarget"); - - /** - * Creates a new instance of TargetReferenceType value. - * - * @deprecated Use the {@link #fromString(String)} factory method. - */ - @Deprecated - public TargetReferenceType() { - } - - /** - * Creates or finds a TargetReferenceType from its string representation. - * - * @param name a name to look for. - * @return the corresponding TargetReferenceType. - */ - @JsonCreator - public static TargetReferenceType fromString(String name) { - return fromString(name, TargetReferenceType.class); - } - - /** - * Gets known TargetReferenceType values. - * - * @return known TargetReferenceType values. - */ - public static Collection values() { - return values(TargetReferenceType.class); - } -} 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 deleted file mode 100644 index ebc7a5164cf01..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetType.java +++ /dev/null @@ -1,82 +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; - -import com.azure.core.management.SystemData; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import java.util.List; - -/** An immutable client-side representation of TargetType. */ -public interface TargetType { - /** - * Gets the id property: Fully qualified resource Id for the resource. - * - * @return the id value. - */ - String id(); - - /** - * 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: The system metadata properties of the target type resource. - * - * @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. - * - * @return the displayName value. - */ - String displayName(); - - /** - * Gets the description property: Localized string of the description. - * - * @return the description value. - */ - String description(); - - /** - * Gets the propertiesSchema property: URL to retrieve JSON schema of the Target Type properties. - * - * @return the propertiesSchema value. - */ - String propertiesSchema(); - - /** - * Gets the resourceTypes property: List of resource types this Target Type can extend. - * - * @return the resourceTypes value. - */ - List resourceTypes(); - - /** - * Gets the inner com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner object. - * - * @return the inner object. - */ - TargetTypeInner innerModel(); -} 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 deleted file mode 100644 index ffb021af968c5..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypeListResult.java +++ /dev/null @@ -1,59 +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; - -import com.azure.core.annotation.Immutable; -import com.azure.resourcemanager.chaos.fluent.models.TargetTypeInner; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.List; - -/** Model that represents a list of Target Type resources and a link for pagination. */ -@Immutable -public final class TargetTypeListResult { - /* - * List of Target Type resources. - */ - @JsonProperty(value = "value", access = JsonProperty.Access.WRITE_ONLY) - private List value; - - /* - * URL to retrieve the next page of Target Type resources. - */ - @JsonProperty(value = "nextLink", access = JsonProperty.Access.WRITE_ONLY) - private String nextLink; - - /** Creates an instance of TargetTypeListResult class. */ - public TargetTypeListResult() { - } - - /** - * Get the value property: List of Target Type resources. - * - * @return the value value. - */ - public List value() { - return this.value; - } - - /** - * Get the nextLink property: URL to retrieve the next page of Target Type resources. - * - * @return the nextLink value. - */ - public String nextLink() { - return this.nextLink; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - if (value() != null) { - value().forEach(e -> e.validate()); - } - } -} 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 deleted file mode 100644 index 8ff793a6ccfaf..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/TargetTypes.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; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; - -/** Resource collection API of TargetTypes. */ -public interface TargetTypes { - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName); - - /** - * Get a list of Target Type resources for given location. - * - * @param locationName String that represents a Location 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 Target Type resources for given location as paginated response with {@link PagedIterable}. - */ - PagedIterable list(String locationName, String continuationToken, Context context); - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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. - * @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 along with {@link Response}. - */ - Response getWithResponse(String locationName, String targetTypeName, Context context); - - /** - * Get a Target Type resources for given location. - * - * @param locationName String that represents a Location resource name. - * @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); -} 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 deleted file mode 100644 index 6187753e73276..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/Targets.java +++ /dev/null @@ -1,181 +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; - -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.http.rest.Response; -import com.azure.core.util.Context; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; - -/** Resource collection API of Targets. */ -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. - * @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 resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list( - String resourceGroupName, String parentProviderNamespace, String parentResourceType, String parentResourceName); - - /** - * 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 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 Target resources that extend a tracked regional resource as paginated response with {@link - * PagedIterable}. - */ - PagedIterable list( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String continuationToken, - Context context); - - /** - * 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 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. - * @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 resource that extends a tracked regional resource along with {@link Response}. - */ - Response getWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context); - - /** - * 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 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 Target resource that extends a tracked regional resource. - */ - Target get( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName); - - /** - * 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 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. - * @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}. - */ - Response deleteWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - Context context); - - /** - * 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 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. - */ - void delete( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName); - - /** - * 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 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}. - */ - Response createOrUpdateWithResponse( - String resourceGroupName, - String parentProviderNamespace, - String parentResourceType, - String parentResourceName, - String targetName, - TargetInner target, - Context context); - - /** - * 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 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); -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/UserAssignedIdentity.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/UserAssignedIdentity.java deleted file mode 100644 index e83eda8f0bcbf..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/UserAssignedIdentity.java +++ /dev/null @@ -1,55 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.models; - -import com.azure.core.annotation.Immutable; -import com.fasterxml.jackson.annotation.JsonProperty; -import java.util.UUID; - -/** User assigned identity properties. */ -@Immutable -public final class UserAssignedIdentity { - /* - * The principal ID of the assigned identity. - */ - @JsonProperty(value = "principalId", access = JsonProperty.Access.WRITE_ONLY) - private UUID principalId; - - /* - * The client ID of the assigned identity. - */ - @JsonProperty(value = "clientId", access = JsonProperty.Access.WRITE_ONLY) - private UUID clientId; - - /** Creates an instance of UserAssignedIdentity class. */ - public UserAssignedIdentity() { - } - - /** - * Get the principalId property: The principal ID of the assigned identity. - * - * @return the principalId value. - */ - public UUID principalId() { - return this.principalId; - } - - /** - * Get the clientId property: The client ID of the assigned identity. - * - * @return the clientId value. - */ - public UUID clientId() { - return this.clientId; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/package-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/package-info.java deleted file mode 100644 index 081adb707661f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/models/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the data models for ChaosManagementClient. Chaos Management Client. */ -package com.azure.resourcemanager.chaos.models; diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/package-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/package-info.java deleted file mode 100644 index 9da2e994a2c79..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/com/azure/resourcemanager/chaos/package-info.java +++ /dev/null @@ -1,6 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -/** Package containing the classes for ChaosManagementClient. Chaos Management Client. */ -package com.azure.resourcemanager.chaos; diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/module-info.java b/sdk/chaos/azure-resourcemanager-chaos/src/main/java/module-info.java deleted file mode 100644 index 0a9080fade2a8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/main/java/module-info.java +++ /dev/null @@ -1,19 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -module com.azure.resourcemanager.chaos { - requires transitive com.azure.core.management; - - exports com.azure.resourcemanager.chaos; - exports com.azure.resourcemanager.chaos.fluent; - exports com.azure.resourcemanager.chaos.fluent.models; - exports com.azure.resourcemanager.chaos.models; - - opens com.azure.resourcemanager.chaos.fluent.models to - com.azure.core, - com.fasterxml.jackson.databind; - opens com.azure.resourcemanager.chaos.models to - com.azure.core, - com.fasterxml.jackson.databind; -} 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 deleted file mode 100644 index f3a68b003d0d3..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateSamples.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.resourcemanager.chaos.fluent.models.CapabilityInner; - -/** Samples for Capabilities CreateOrUpdate. */ -public final class CapabilitiesCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/CreateOrUpdateACapability.json - */ - /** - * Sample code: Create/update a Capability that extends a virtual machine Target resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void createUpdateACapabilityThatExtendsAVirtualMachineTargetResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .capabilities() - .createOrUpdateWithResponse( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-VirtualMachine", - "Shutdown-1.0", - new CapabilityInner(), - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 75587cbcdcb0e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -/** Samples for Capabilities Delete. */ -public final class CapabilitiesDeleteSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/DeleteACapability.json - */ - /** - * Sample code: Delete a Capability that extends a virtual machine Target resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void deleteACapabilityThatExtendsAVirtualMachineTargetResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .capabilities() - .deleteWithResponse( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-VirtualMachine", - "Shutdown-1.0", - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 42f149af0d170..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -/** Samples for Capabilities Get. */ -public final class CapabilitiesGetSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetACapability.json - */ - /** - * Sample code: Get a Capability that extends a virtual machine Target resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void getACapabilityThatExtendsAVirtualMachineTargetResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .capabilities() - .getWithResponse( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-VirtualMachine", - "Shutdown-1.0", - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 87bc7d69df5d7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListSamples.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -/** Samples for Capabilities List. */ -public final class CapabilitiesListSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListCapabilities.json - */ - /** - * Sample code: List all Capabilities that extend a virtual machine Target resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllCapabilitiesThatExtendAVirtualMachineTargetResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .capabilities() - .list( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-VirtualMachine", - null, - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index bdc3f6a3b1dd4..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetSamples.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; - -/** Samples for CapabilityTypes Get. */ -public final class CapabilityTypesGetSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetACapabilityType.json - */ - /** - * Sample code: Get a Capability Type for a virtual machine Target resource on westus2 location. - * - * @param manager Entry point to ChaosManager. - */ - public static void getACapabilityTypeForAVirtualMachineTargetResourceOnWestus2Location( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .capabilityTypes() - .getWithResponse("westus2", "Microsoft-VirtualMachine", "Shutdown-1.0", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 8683c4461229c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListSamples.java +++ /dev/null @@ -1,21 +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; - -/** Samples for CapabilityTypes List. */ -public final class CapabilityTypesListSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListCapabilityTypes.json - */ - /** - * Sample code: List all Capability Types for a virtual machine Target resource on westus2 location. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllCapabilityTypesForAVirtualMachineTargetResourceOnWestus2Location( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.capabilityTypes().list("westus2", "Microsoft-VirtualMachine", null, com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 657bc092a19c7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments Cancel. */ -public final class ExperimentsCancelSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/CancelAExperiment.json - */ - /** - * Sample code: Cancel a running Experiment. - * - * @param manager Entry point to ChaosManager. - */ - public static void cancelARunningExperiment(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().cancelWithResponse("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index cf11afb85804d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateSamples.java +++ /dev/null @@ -1,73 +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.resourcemanager.chaos.models.Branch; -import com.azure.resourcemanager.chaos.models.ContinuousAction; -import com.azure.resourcemanager.chaos.models.KeyValuePair; -import com.azure.resourcemanager.chaos.models.ListSelector; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.Step; -import com.azure.resourcemanager.chaos.models.TargetReference; -import com.azure.resourcemanager.chaos.models.TargetReferenceType; -import java.time.Duration; -import java.util.Arrays; - -/** Samples for Experiments CreateOrUpdate. */ -public final class ExperimentsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/CreateOrUpdateAExperiment.json - */ - /** - * Sample code: Create/update a Experiment in a resource group. - * - * @param manager Entry point to ChaosManager. - */ - public static void createUpdateAExperimentInAResourceGroup(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .experiments() - .define("exampleExperiment") - .withRegion("eastus2euap") - .withExistingResourceGroup("exampleRG") - .withSteps( - Arrays - .asList( - new Step() - .withName("step1") - .withBranches( - Arrays - .asList( - new Branch() - .withName("branch1") - .withActions( - Arrays - .asList( - new ContinuousAction() - .withName("urn:csci:microsoft:virtualMachine:shutdown/1.0") - .withDuration(Duration.parse("PT10M")) - .withParameters( - Arrays - .asList( - new KeyValuePair() - .withKey("fakeTokenPlaceholder") - .withValue("false"))) - .withSelectorId("selector1"))))))) - .withSelectors( - Arrays - .asList( - new ListSelector() - .withId("selector1") - .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)) - .create(); - } -} 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 deleted file mode 100644 index 4779dffa41158..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteSamples.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; - -/** Samples for Experiments Delete. */ -public final class ExperimentsDeleteSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/DeleteAExperiment.json - */ - /** - * Sample code: Delete a Experiment in a resource group. - * - * @param manager Entry point to ChaosManager. - */ - public static void deleteAExperimentInAResourceGroup(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .experiments() - .deleteByResourceGroupWithResponse("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 4f90f3fe33e0b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupSamples.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; - -/** Samples for Experiments GetByResourceGroup. */ -public final class ExperimentsGetByResourceGroupSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetAExperiment.json - */ - /** - * Sample code: Get a Experiment in a resource group. - * - * @param manager Entry point to ChaosManager. - */ - public static void getAExperimentInAResourceGroup(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .experiments() - .getByResourceGroupWithResponse("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsSamples.java deleted file mode 100644 index 2918e65b9f666..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsSamples.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; - -/** Samples for Experiments GetExecutionDetails. */ -public final class ExperimentsGetExecutionDetailsSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetAExperimentExecutionDetails.json - */ - /** - * Sample code: Get experiment execution details. - * - * @param manager Entry point to ChaosManager. - */ - public static void getExperimentExecutionDetails(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .experiments() - .getExecutionDetailsWithResponse( - "exampleRG", - "exampleExperiment", - "f24500ad-744e-4a26-864b-b76199eac333", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusSamples.java deleted file mode 100644 index 5750f91f66580..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusSamples.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; - -/** Samples for Experiments GetStatus. */ -public final class ExperimentsGetStatusSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetAExperimentStatus.json - */ - /** - * Sample code: Get the status of a Experiment. - * - * @param manager Entry point to ChaosManager. - */ - public static void getTheStatusOfAExperiment(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .experiments() - .getStatusWithResponse( - "exampleRG", - "exampleExperiment", - "50734542-2e64-4e08-814c-cc0e7475f7e4", - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesSamples.java deleted file mode 100644 index 84bef54c007cc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments ListAllStatuses. */ -public final class ExperimentsListAllStatusesSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListExperimentStatuses.json - */ - /** - * Sample code: List all statuses of a Experiment. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllStatusesOfAExperiment(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().listAllStatuses("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 87ea28d68f7a3..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments ListByResourceGroup. */ -public final class ExperimentsListByResourceGroupSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListExperimentsInAResourceGroup.json - */ - /** - * Sample code: List all Experiments in a resource group. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllExperimentsInAResourceGroup(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().listByResourceGroup("exampleRG", null, null, com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsSamples.java deleted file mode 100644 index 854508c20af0c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments ListExecutionDetails. */ -public final class ExperimentsListExecutionDetailsSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListExperimentExecutionsDetails.json - */ - /** - * Sample code: List experiment executions details. - * - * @param manager Entry point to ChaosManager. - */ - public static void listExperimentExecutionsDetails(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().listExecutionDetails("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 7f374c5e47c1f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsListSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments List. */ -public final class ExperimentsListSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListExperimentsInASubscription.json - */ - /** - * Sample code: List all Experiments in a subscription. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllExperimentsInASubscription(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().list(null, null, com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 15a6f369df75e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for Experiments Start. */ -public final class ExperimentsStartSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/StartAExperiment.json - */ - /** - * Sample code: Start a Experiment. - * - * @param manager Entry point to ChaosManager. - */ - public static void startAExperiment(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.experiments().startWithResponse("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index b3162a23ef9c6..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/ExperimentsUpdateSamples.java +++ /dev/null @@ -1,52 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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.UserAssignedIdentity; -import java.util.HashMap; -import java.util.Map; - -/** Samples for Experiments Update. */ -public final class ExperimentsUpdateSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/PatchExperiment.json - */ - /** - * Sample code: Patch an Experiment in a resource group. - * - * @param manager Entry point to ChaosManager. - */ - public static void patchAnExperimentInAResourceGroup(com.azure.resourcemanager.chaos.ChaosManager manager) { - Experiment resource = - manager - .experiments() - .getByResourceGroupWithResponse("exampleRG", "exampleExperiment", com.azure.core.util.Context.NONE) - .getValue(); - resource - .update() - .withIdentity( - new ResourceIdentity() - .withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "/subscriptions/6b052e15-03d3-4f17-b2e1-be7f07588291/resourceGroups/exampleRG/providers/Microsoft.ManagedIdentity/userAssignedIdentity/exampleUMI", - new UserAssignedIdentity()))) - .apply(); - } - - @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/TargetTypesGetSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java deleted file mode 100644 index 817789237b798..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for TargetTypes Get. */ -public final class TargetTypesGetSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetATargetType.json - */ - /** - * Sample code: Get a Target Type for westus2 location. - * - * @param manager Entry point to ChaosManager. - */ - public static void getATargetTypeForWestus2Location(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.targetTypes().getWithResponse("westus2", "Microsoft-Agent", com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index b69d5234b52d7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetTypesListSamples.java +++ /dev/null @@ -1,20 +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; - -/** Samples for TargetTypes List. */ -public final class TargetTypesListSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListTargetTypes.json - */ - /** - * Sample code: List all Target Types for westus2 location. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllTargetTypesForWestus2Location(com.azure.resourcemanager.chaos.ChaosManager manager) { - manager.targetTypes().list("westus2", null, com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index eae54a3598b11..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateSamples.java +++ /dev/null @@ -1,57 +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.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; - -/** Samples for Targets CreateOrUpdate. */ -public final class TargetsCreateOrUpdateSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/CreateOrUpdateATarget.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 { - 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))), - com.azure.core.util.Context.NONE); - } - - @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/TargetsDeleteSamples.java b/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.java deleted file mode 100644 index 6297b0552cdba..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteSamples.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; - -/** Samples for Targets Delete. */ -public final class TargetsDeleteSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/DeleteATarget.json - */ - /** - * Sample code: Delete a Target that extends a virtual machine resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void deleteATargetThatExtendsAVirtualMachineResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .targets() - .deleteWithResponse( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-Agent", - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index 6c4cdd6b39db0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsGetSamples.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; - -/** Samples for Targets Get. */ -public final class TargetsGetSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/GetATarget.json - */ - /** - * Sample code: Get a Target that extends a virtual machine resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void getATargetThatExtendsAVirtualMachineResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .targets() - .getWithResponse( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - "Microsoft-Agent", - com.azure.core.util.Context.NONE); - } -} 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 deleted file mode 100644 index d0f8820df417c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/samples/java/com/azure/resourcemanager/chaos/generated/TargetsListSamples.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; - -/** Samples for Targets List. */ -public final class TargetsListSamples { - /* - * x-ms-original-file: specification/chaos/resource-manager/Microsoft.Chaos/preview/2023-04-15-preview/examples/ListTargets.json - */ - /** - * Sample code: List all Targets that extend a virtual machine resource. - * - * @param manager Entry point to ChaosManager. - */ - public static void listAllTargetsThatExtendAVirtualMachineResource( - com.azure.resourcemanager.chaos.ChaosManager manager) { - manager - .targets() - .list( - "exampleRG", - "Microsoft.Compute", - "virtualMachines", - "exampleVM", - null, - com.azure.core.util.Context.NONE); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ActionTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ActionTests.java deleted file mode 100644 index ce0c80c9c7b23..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ActionTests.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.Action; -import org.junit.jupiter.api.Assertions; - -public final class ActionTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Action model = BinaryData.fromString("{\"type\":\"Action\",\"name\":\"ucww\"}").toObject(Action.class); - Assertions.assertEquals("ucww", model.name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Action model = new Action().withName("ucww"); - model = BinaryData.fromObject(model).toObject(Action.class); - Assertions.assertEquals("ucww", model.name()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/BranchTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/BranchTests.java deleted file mode 100644 index 0d5821eff7f68..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/BranchTests.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.util.BinaryData; -import com.azure.resourcemanager.chaos.models.Action; -import com.azure.resourcemanager.chaos.models.Branch; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class BranchTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Branch model = - BinaryData - .fromString( - "{\"name\":\"uhashsfwx\",\"actions\":[{\"type\":\"Action\",\"name\":\"owzxcu\"},{\"type\":\"Action\",\"name\":\"i\"},{\"type\":\"Action\",\"name\":\"jooxdjebw\"}]}") - .toObject(Branch.class); - Assertions.assertEquals("uhashsfwx", model.name()); - Assertions.assertEquals("owzxcu", model.actions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Branch model = - new Branch() - .withName("uhashsfwx") - .withActions( - Arrays - .asList( - new Action().withName("owzxcu"), - new Action().withName("i"), - new Action().withName("jooxdjebw"))); - model = BinaryData.fromObject(model).toObject(Branch.class); - Assertions.assertEquals("uhashsfwx", model.name()); - Assertions.assertEquals("owzxcu", model.actions().get(0).name()); - } -} 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 243890d92386e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,76 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.fluent.models.CapabilityInner; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilitiesCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publisher\":\"mhairsbrgzdwmsw\",\"targetType\":\"pqwd\",\"description\":\"gicccnxqhuex\",\"parametersSchema\":\"ttlstvlzywemhz\",\"urn\":\"csdtclusiypbs\"},\"id\":\"gytguslfead\",\"name\":\"ygqukyhejh\",\"type\":\"isxgfp\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "wpusdsttwvogv", - "bejdcn", - "qqmoaku", - "gm", - "zr", - "rdgrtw", - 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 363326342f5b8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesDeleteWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilitiesDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "owtlmnguxawqald", - "yuuximerqfobwyzn", - "bykutw", - "fhpagmhrskdsnf", - "sd", - "akgtdlmkkzevdlh", - 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 46fbb0c731e0c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesGetWithResponseMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilitiesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"properties\":{\"publisher\":\"oqouicybxarzgszu\",\"targetType\":\"x\",\"description\":\"q\",\"parametersSchema\":\"idoamciodhkha\",\"urn\":\"khnzbonlw\"},\"id\":\"toego\",\"name\":\"dwbwhkszzcmrvexz\",\"type\":\"vbtqgsfraoyzk\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "oefki", - "rvtp", - "qujmqlgkf", - "tndoaongbjc", - "tujitcjedft", - "waezkojvd", - 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 36c4d3f313999..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilitiesListMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Capability; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilitiesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"properties\":{\"publisher\":\"kgjubgdknnqvsazn\",\"targetType\":\"tor\",\"description\":\"sgsahmkycgr\",\"parametersSchema\":\"wjue\",\"urn\":\"eburu\"},\"id\":\"dmovsm\",\"name\":\"l\",\"type\":\"wabm\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("vglsbjjca", "vxb", "t", "udutnco", "mr", "xqtvcofu", 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 46b73882dea59..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 c81a42399e57d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 a40c0f86e689a..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 35b9529de72b4..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeInnerTests.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.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 e5e3f3b7faf8c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypeListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 eea6de5793390..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesRuntimePropertiesTests.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.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 b71a9ea9af7f4..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypePropertiesTests.java +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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 7c2792d51d76d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.CapabilityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilityTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"budurgkakmo\",\"properties\":{\"publisher\":\"jjklff\",\"targetType\":\"ouw\",\"displayName\":\"gzrf\",\"description\":\"eyebizikayuhql\",\"parametersSchema\":\"bs\",\"urn\":\"bqwrvtldgm\",\"kind\":\"gvmpipaslthaqfx\",\"azureRbacActions\":[\"wutwbdsre\",\"pdrhne\",\"yowqkdwytisibir\"],\"azureRbacDataActions\":[\"ikpzimejza\",\"lfzxiavrmbzonoki\"],\"runtimeProperties\":{\"kind\":\"q\"}},\"id\":\"irgzp\",\"name\":\"rlazszrnw\",\"type\":\"iin\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("jivfxzsjabib", "ystawfsdjpvkvp", "jxbkzbzkdvn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("budurgkakmo", 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 923eb083647da..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/CapabilityTypesListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.CapabilityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class CapabilityTypesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"ujzra\",\"properties\":{\"publisher\":\"w\",\"targetType\":\"r\",\"displayName\":\"swibyr\",\"description\":\"l\",\"parametersSchema\":\"shfwpracstwity\",\"urn\":\"evxccedcp\",\"kind\":\"dyodnwzxltj\",\"azureRbacActions\":[\"hlt\",\"ugcxnavvwxq\",\"byqunyow\"],\"azureRbacDataActions\":[\"mdjrkvfgbvfvp\",\"bodacizsjq\",\"hkr\",\"ibdeibq\"],\"runtimeProperties\":{\"kind\":\"kghv\"}},\"id\":\"ndzwmkrefa\",\"name\":\"pjorwkqnyhg\",\"type\":\"ij\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("lolp", "vk", "r", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ujzra", response.iterator().next().location()); - } -} 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 0f89985b10bb8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/DelayActionTests.java +++ /dev/null @@ -1,30 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"PT114H40M51S\",\"name\":\"qoaxoruzfgs\"}") - .toObject(DelayAction.class); - Assertions.assertEquals("qoaxoruzfgs", model.name()); - Assertions.assertEquals(Duration.parse("PT114H40M51S"), model.duration()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - DelayAction model = new DelayAction().withName("qoaxoruzfgs").withDuration(Duration.parse("PT114H40M51S")); - model = BinaryData.fromObject(model).toObject(DelayAction.class); - Assertions.assertEquals("qoaxoruzfgs", model.name()); - Assertions.assertEquals(Duration.parse("PT114H40M51S"), model.duration()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentCancelOperationResultInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentCancelOperationResultInnerTests.java deleted file mode 100644 index 3293201e1cd1f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentCancelOperationResultInnerTests.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.ExperimentCancelOperationResultInner; - -public final class ExperimentCancelOperationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentCancelOperationResultInner model = - BinaryData - .fromString("{\"name\":\"kpycgklwndnhjd\",\"statusUrl\":\"whvylw\"}") - .toObject(ExperimentCancelOperationResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentCancelOperationResultInner model = new ExperimentCancelOperationResultInner(); - model = BinaryData.fromObject(model).toObject(ExperimentCancelOperationResultInner.class); - } -} 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 f06010ff8196f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"bkdmo\",\"id\":\"postmgrcfbunrm\",\"name\":\"jhhkxbp\",\"properties\":{\"experimentId\":\"mjh\",\"status\":\"j\",\"failureReason\":\"gudivkrtswbxqz\",\"createdDateTime\":\"2021-10-26T13:42:02Z\",\"lastActionDateTime\":\"2021-01-16T06:43:01Z\",\"startDateTime\":\"2021-04-01T03:47:56Z\",\"stopDateTime\":\"2021-07-06T14:56:49Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"ivetvtcq\",\"stepId\":\"tdo\",\"status\":\"cbxvwvxyslqbh\",\"branches\":[{},{},{}]},{\"stepName\":\"blytk\",\"stepId\":\"mpew\",\"status\":\"fbkrvrnsvs\",\"branches\":[{},{}]}]}}}") - .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/ExperimentExecutionDetailsListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsListResultTests.java deleted file mode 100644 index 112d5bd3a7871..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetailsListResult; - -public final class ExperimentExecutionDetailsListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionDetailsListResult model = - BinaryData - .fromString( - "{\"value\":[{\"type\":\"wroyqbexrmcq\",\"id\":\"ycnojvknmefqsg\",\"name\":\"ah\",\"properties\":{\"experimentId\":\"y\",\"status\":\"pvgqzcjrvxdjzlm\",\"failureReason\":\"xkvugfhzov\",\"createdDateTime\":\"2021-04-06T17:45:34Z\",\"lastActionDateTime\":\"2021-08-30T15:15:07Z\",\"startDateTime\":\"2021-08-29T21:49:24Z\",\"stopDateTime\":\"2021-02-16T01:55:44Z\",\"runInformation\":{\"steps\":[{}]}}},{\"type\":\"rnxipei\",\"id\":\"jzuaejxdultskzbb\",\"name\":\"zumveekgpwo\",\"properties\":{\"experimentId\":\"kfpbs\",\"status\":\"ofd\",\"failureReason\":\"uusdttouwa\",\"createdDateTime\":\"2021-08-12T22:43:04Z\",\"lastActionDateTime\":\"2021-11-05T01:57:54Z\",\"startDateTime\":\"2021-09-30T23:19:15Z\",\"stopDateTime\":\"2021-03-07T10:01:38Z\",\"runInformation\":{\"steps\":[{}]}}},{\"type\":\"bxwyjsflhhcaa\",\"id\":\"jixisxyawjoyaqcs\",\"name\":\"jpkiidzyexznelix\",\"properties\":{\"experimentId\":\"ztfolhbnxk\",\"status\":\"laulppg\",\"failureReason\":\"tpnapnyiropuhpig\",\"createdDateTime\":\"2021-05-18T16:57:02Z\",\"lastActionDateTime\":\"2021-06-13T20:05:29Z\",\"startDateTime\":\"2021-09-08T14:57:52Z\",\"stopDateTime\":\"2021-09-24T06:30:02Z\",\"runInformation\":{\"steps\":[{},{},{}]}}},{\"type\":\"jvc\",\"id\":\"ynqwwncwzzhxgk\",\"name\":\"mgucna\",\"properties\":{\"experimentId\":\"eoellwptfdygp\",\"status\":\"b\",\"failureReason\":\"ceopzfqrhhuaopp\",\"createdDateTime\":\"2021-12-04T10:32:02Z\",\"lastActionDateTime\":\"2021-11-26T20:29:16Z\",\"startDateTime\":\"2021-08-22T01:14:41Z\",\"stopDateTime\":\"2021-02-19T08:33:13Z\",\"runInformation\":{\"steps\":[{},{}]}}}],\"nextLink\":\"xcto\"}") - .toObject(ExperimentExecutionDetailsListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentExecutionDetailsListResult model = new ExperimentExecutionDetailsListResult(); - model = BinaryData.fromObject(model).toObject(ExperimentExecutionDetailsListResult.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 b9a1d40035e4e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesRunInformationTests.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.ExperimentExecutionDetailsPropertiesRunInformation; - -public final class ExperimentExecutionDetailsPropertiesRunInformationTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentExecutionDetailsPropertiesRunInformation model = - BinaryData - .fromString( - "{\"steps\":[{\"stepName\":\"thuma\",\"stepId\":\"lbg\",\"status\":\"duiertgcc\",\"branches\":[{\"branchName\":\"olpsslqlf\",\"branchId\":\"dnbbglzps\",\"status\":\"ydmcwyhzdxssa\",\"actions\":[{},{},{},{}]},{\"branchName\":\"nvdfznuda\",\"branchId\":\"vxzbncb\",\"status\":\"lpstdbhhxsrzdz\",\"actions\":[{},{},{}]},{\"branchName\":\"scdntnevf\",\"branchId\":\"jmygtdsslswtmwer\",\"status\":\"fzp\",\"actions\":[{},{},{}]}]},{\"stepName\":\"mwabnetshhszhedp\",\"stepId\":\"wiwubm\",\"status\":\"besldnkwwtppjflc\",\"branches\":[{\"branchName\":\"okonzmnsikvmkqz\",\"branchId\":\"qkdltfz\",\"status\":\"hhvh\",\"actions\":[{}]},{\"branchName\":\"odkwobd\",\"branchId\":\"xtibqdxbxwakbog\",\"status\":\"ndlkzgxhurip\",\"actions\":[{},{}]},{\"branchName\":\"dxunkbebxmubyyn\",\"branchId\":\"lrb\",\"status\":\"koievseo\",\"actions\":[{}]},{\"branchName\":\"l\",\"branchId\":\"muwlauwzizxbm\",\"status\":\"cjefuzmu\",\"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 2c0484cfdefcc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentExecutionDetailsPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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( - "{\"experimentId\":\"hxcr\",\"status\":\"fovasr\",\"failureReason\":\"v\",\"createdDateTime\":\"2021-07-10T06:08:41Z\",\"lastActionDateTime\":\"2021-03-07T17:24:46Z\",\"startDateTime\":\"2021-11-17T10:32:18Z\",\"stopDateTime\":\"2021-05-02T16:44:33Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"rxbpyb\",\"stepId\":\"fbjfdtwssotftpvj\",\"status\":\"exilzznfqqnvwpmq\",\"branches\":[{\"branchName\":\"oujmkcjhwqytj\",\"branchId\":\"bnw\",\"status\":\"wgdrjervnaenqp\",\"actions\":[{},{},{},{}]},{\"branchName\":\"doy\",\"branchId\":\"ifthnz\",\"status\":\"dslgnayqigynduh\",\"actions\":[{},{},{}]}]}]}}") - .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/ExperimentInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java deleted file mode 100644 index 1784f51e727f0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentInnerTests.java +++ /dev/null @@ -1,190 +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.Action; -import com.azure.resourcemanager.chaos.models.Branch; -import com.azure.resourcemanager.chaos.models.Filter; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -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\":\"None\",\"userAssignedIdentities\":{\"udwtiukbl\":{\"principalId\":\"a61f533d-4cb4-48c5-b497-037970f7a5e4\",\"clientId\":\"a2b0ed87-2549-4a89-a548-e0201ea73b97\"},\"kpoc\":{\"principalId\":\"42cfbeff-7124-4ed5-9328-09adb1b652ac\",\"clientId\":\"dfd5c108-4321-42c2-a063-44f4503fa5fa\"},\"z\":{\"principalId\":\"a42405b6-1569-4569-ad74-4ffedceb4851\",\"clientId\":\"206e8550-f951-4176-b6b6-464869be91a1\"}},\"principalId\":\"o\",\"tenantId\":\"ukgjnpiucgygevq\"},\"properties\":{\"steps\":[{\"name\":\"typmrbpizcdrqjsd\",\"branches\":[{\"name\":\"dnfyhxdeoejzicwi\",\"actions\":[{\"type\":\"Action\",\"name\":\"jttgzf\"},{\"type\":\"Action\",\"name\":\"ishc\"},{\"type\":\"Action\",\"name\":\"khaj\"}]},{\"name\":\"eyeam\",\"actions\":[{\"type\":\"Action\",\"name\":\"hagalpbuxwgipwh\"}]},{\"name\":\"nowkgshw\",\"actions\":[{\"type\":\"Action\",\"name\":\"kix\"},{\"type\":\"Action\",\"name\":\"bin\"},{\"type\":\"Action\",\"name\":\"eputtmrywnuzoqf\"}]},{\"name\":\"iyqzrnk\",\"actions\":[{\"type\":\"Action\",\"name\":\"vyxlwhzlsicohoqq\"},{\"type\":\"Action\",\"name\":\"wvl\"},{\"type\":\"Action\",\"name\":\"yav\"},{\"type\":\"Action\",\"name\":\"hheunmmqhgyx\"}]}]},{\"name\":\"konocu\",\"branches\":[{\"name\":\"klyaxuconu\",\"actions\":[{\"type\":\"Action\",\"name\":\"zf\"},{\"type\":\"Action\",\"name\":\"beypewrmjmw\"}]},{\"name\":\"vjektcxsenh\",\"actions\":[{\"type\":\"Action\",\"name\":\"rsffrzpwvlqdqgbi\"}]},{\"name\":\"ylihkaetckt\",\"actions\":[{\"type\":\"Action\",\"name\":\"civfsnkymuctq\"},{\"type\":\"Action\",\"name\":\"jf\"},{\"type\":\"Action\",\"name\":\"ebrjcxe\"}]}]},{\"name\":\"fuwutttxf\",\"branches\":[{\"name\":\"rbirphxe\",\"actions\":[{\"type\":\"Action\",\"name\":\"yva\"}]},{\"name\":\"fnljky\",\"actions\":[{\"type\":\"Action\",\"name\":\"j\"},{\"type\":\"Action\",\"name\":\"uujqgidokgjljyo\"},{\"type\":\"Action\",\"name\":\"gvcl\"},{\"type\":\"Action\",\"name\":\"bgsncghkjeszzhb\"}]},{\"name\":\"jhtxfvgxbfsmxne\",\"actions\":[{\"type\":\"Action\",\"name\":\"pvecxgodeb\"},{\"type\":\"Action\",\"name\":\"qkkrb\"},{\"type\":\"Action\",\"name\":\"pukgriwflzlfb\"},{\"type\":\"Action\",\"name\":\"zpuzycisp\"}]},{\"name\":\"qzahmgkbrp\",\"actions\":[{\"type\":\"Action\",\"name\":\"dhibnuq\"}]}]},{\"name\":\"kpikadrgvt\",\"branches\":[{\"name\":\"gnbuy\",\"actions\":[{\"type\":\"Action\",\"name\":\"ijggmebfsiar\"},{\"type\":\"Action\",\"name\":\"utrc\"}]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"na\",\"filter\":{\"type\":\"Filter\"},\"\":{\"bh\":\"datajrunmpxtt\"}},{\"type\":\"Selector\",\"id\":\"bnlankxmyskpb\",\"filter\":{\"type\":\"Filter\"},\"\":{\"lqidyby\":\"datatkcxywnytnrsy\",\"haaxdbabphl\":\"dataczfc\",\"yazttbtwwrqpue\":\"datarqlfktsthsucocmn\",\"xibxujwbhqwalm\":\"datackzywbiexzfeyue\"}}],\"startOnCreation\":false},\"location\":\"oxaepd\",\"tags\":{\"bavxbniwdjswzt\":\"ancuxrhd\",\"xbzpfzab\":\"dbpgnxytxhp\"},\"id\":\"lcuhxwtctyqiklb\",\"name\":\"ovplw\",\"type\":\"bhvgy\"}") - .toObject(ExperimentInner.class); - Assertions.assertEquals("oxaepd", model.location()); - Assertions.assertEquals("ancuxrhd", model.tags().get("bavxbniwdjswzt")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.steps().get(0).name()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("jttgzf", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("na", model.selectors().get(0).id()); - Assertions.assertEquals(false, model.startOnCreation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentInner model = - new ExperimentInner() - .withLocation("oxaepd") - .withTags(mapOf("bavxbniwdjswzt", "ancuxrhd", "xbzpfzab", "dbpgnxytxhp")) - .withIdentity( - new ResourceIdentity() - .withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf( - "udwtiukbl", - new UserAssignedIdentity(), - "kpoc", - new UserAssignedIdentity(), - "z", - new UserAssignedIdentity()))) - .withSteps( - Arrays - .asList( - new Step() - .withName("typmrbpizcdrqjsd") - .withBranches( - Arrays - .asList( - new Branch() - .withName("dnfyhxdeoejzicwi") - .withActions( - Arrays - .asList( - new Action().withName("jttgzf"), - new Action().withName("ishc"), - new Action().withName("khaj"))), - new Branch() - .withName("eyeam") - .withActions(Arrays.asList(new Action().withName("hagalpbuxwgipwh"))), - new Branch() - .withName("nowkgshw") - .withActions( - Arrays - .asList( - new Action().withName("kix"), - new Action().withName("bin"), - new Action().withName("eputtmrywnuzoqf"))), - new Branch() - .withName("iyqzrnk") - .withActions( - Arrays - .asList( - new Action().withName("vyxlwhzlsicohoqq"), - new Action().withName("wvl"), - new Action().withName("yav"), - new Action().withName("hheunmmqhgyx"))))), - new Step() - .withName("konocu") - .withBranches( - Arrays - .asList( - new Branch() - .withName("klyaxuconu") - .withActions( - Arrays - .asList( - new Action().withName("zf"), - new Action().withName("beypewrmjmw"))), - new Branch() - .withName("vjektcxsenh") - .withActions(Arrays.asList(new Action().withName("rsffrzpwvlqdqgbi"))), - new Branch() - .withName("ylihkaetckt") - .withActions( - Arrays - .asList( - new Action().withName("civfsnkymuctq"), - new Action().withName("jf"), - new Action().withName("ebrjcxe"))))), - new Step() - .withName("fuwutttxf") - .withBranches( - Arrays - .asList( - new Branch() - .withName("rbirphxe") - .withActions(Arrays.asList(new Action().withName("yva"))), - new Branch() - .withName("fnljky") - .withActions( - Arrays - .asList( - new Action().withName("j"), - new Action().withName("uujqgidokgjljyo"), - new Action().withName("gvcl"), - new Action().withName("bgsncghkjeszzhb"))), - new Branch() - .withName("jhtxfvgxbfsmxne") - .withActions( - Arrays - .asList( - new Action().withName("pvecxgodeb"), - new Action().withName("qkkrb"), - new Action().withName("pukgriwflzlfb"), - new Action().withName("zpuzycisp"))), - new Branch() - .withName("qzahmgkbrp") - .withActions(Arrays.asList(new Action().withName("dhibnuq"))))), - new Step() - .withName("kpikadrgvt") - .withBranches( - Arrays - .asList( - new Branch() - .withName("gnbuy") - .withActions( - Arrays - .asList( - new Action().withName("ijggmebfsiar"), - new Action().withName("utrc"))))))) - .withSelectors( - Arrays - .asList( - new Selector() - .withId("na") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")), - new Selector() - .withId("bnlankxmyskpb") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")))) - .withStartOnCreation(false); - model = BinaryData.fromObject(model).toObject(ExperimentInner.class); - Assertions.assertEquals("oxaepd", model.location()); - Assertions.assertEquals("ancuxrhd", model.tags().get("bavxbniwdjswzt")); - Assertions.assertEquals(ResourceIdentityType.NONE, model.identity().type()); - Assertions.assertEquals("typmrbpizcdrqjsd", model.steps().get(0).name()); - Assertions.assertEquals("dnfyhxdeoejzicwi", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("jttgzf", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("na", model.selectors().get(0).id()); - Assertions.assertEquals(false, model.startOnCreation()); - } - - @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 6dd342d32aa78..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"d694953e-da23-4a8d-b5a3-ef1669e288a2\",\"clientId\":\"cbb943cc-5830-4289-9a2f-da96d0b3054a\"},\"fizuckyf\":{\"principalId\":\"ee5be475-8484-4b37-b4a1-0ffbb9314704\",\"clientId\":\"c0be5ec7-b9cc-47cd-8c95-8efb8ab6bef1\"}},\"principalId\":\"rfidfvzwdz\",\"tenantId\":\"tymw\"},\"properties\":{\"steps\":[{\"name\":\"dkfthwxmnt\",\"branches\":[{\"name\":\"waopvkmijcmmxd\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"fufsrpymzi\",\"filter\":{\"type\":\"Filter\"},\"\":{\"wmdwzjeiachboo\":\"datazcxtbzsgfyccsn\",\"ypyqrimzinp\":\"dataflnrosfqpteehzz\",\"dqxhcrmnohjtckwh\":\"dataswjdkirso\",\"gr\":\"datasoifiyipjxsqw\"}},{\"type\":\"Selector\",\"id\":\"bznorcjxvsnby\",\"filter\":{\"type\":\"Filter\"},\"\":{\"cyshurzafbljjgp\":\"datanmoc\"}}],\"startOnCreation\":false},\"location\":\"qcjm\",\"tags\":{\"bqidtqaj\":\"a\",\"khbzhfepgzg\":\"yulpkudjkr\",\"zloc\":\"e\"},\"id\":\"scpai\",\"name\":\"rhhbcs\",\"type\":\"l\"},{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"odxobnbdxkqpxok\":{\"principalId\":\"1f099396-1006-4d2d-9f92-72e1a6060dff\",\"clientId\":\"bcc6c36d-0eb9-4fcb-8fb9-0fb41a5b5d27\"},\"onpimexgstxg\":{\"principalId\":\"05ee082d-e1d1-4fc6-81d0-95dbe012f24c\",\"clientId\":\"db5b4bf4-f0b0-4027-b4f8-feda2cc97fd9\"},\"dg\":{\"principalId\":\"494cc7dc-ef6d-47c6-badb-66d55deb9331\",\"clientId\":\"3e73a6d8-5ec7-4c9e-a09b-66416fbf57a4\"}},\"principalId\":\"ajrmvdjwzrlovmc\",\"tenantId\":\"hijco\"},\"properties\":{\"steps\":[{\"name\":\"ctbzaq\",\"branches\":[{\"name\":\"sycbkbfk\",\"actions\":[]},{\"name\":\"ukdkexxppofmxa\",\"actions\":[]},{\"name\":\"c\",\"actions\":[]}]},{\"name\":\"jpgd\",\"branches\":[{\"name\":\"ocjjxhvpmouexh\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"xibqeojnx\",\"filter\":{\"type\":\"Filter\"},\"\":{\"btwnpzaoqvuhrhcf\":\"dataddntwndei\",\"pyeicxm\":\"datacyddglmjthjqk\"}},{\"type\":\"Selector\",\"id\":\"ciwqvhk\",\"filter\":{\"type\":\"Filter\"},\"\":{\"og\":\"dataigdtopbob\",\"w\":\"datam\",\"a\":\"dataa\",\"iotkftutqxl\":\"datahrzayvvtpgvdf\"}}],\"startOnCreation\":true},\"location\":\"lefgugnxk\",\"tags\":{\"tthzrvqd\":\"qmi\",\"ehoqfbowskan\":\"abhjybi\"},\"id\":\"ktzlcuiywg\",\"name\":\"ywgndrv\",\"type\":\"nhzgpphrcgyn\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"m\":{\"principalId\":\"476e19ab-99eb-40d4-afdf-b8b3c91159ee\",\"clientId\":\"fbbd8d1e-0d13-48d9-89a8-770ebfc1179e\"},\"ofsx\":{\"principalId\":\"f7142431-862f-40ab-9a70-4341d6d34c60\",\"clientId\":\"661e2bcc-d2f9-4563-a367-0b8fddde9665\"}},\"principalId\":\"evgbmqjq\",\"tenantId\":\"c\"},\"properties\":{\"steps\":[{\"name\":\"mivkwlzuvcc\",\"branches\":[{\"name\":\"nfnbacfionlebxe\",\"actions\":[]},{\"name\":\"qgtz\",\"actions\":[]}]},{\"name\":\"dpnqbq\",\"branches\":[{\"name\":\"xrjfeallnwsub\",\"actions\":[]},{\"name\":\"snjampmng\",\"actions\":[]},{\"name\":\"zscxaqwo\",\"actions\":[]},{\"name\":\"chcbonqvpkvlrxnj\",\"actions\":[]}]},{\"name\":\"ase\",\"branches\":[{\"name\":\"heoflokeyyienjbd\",\"actions\":[]},{\"name\":\"wtgrhpdjpj\",\"actions\":[]},{\"name\":\"masxazjpqyegu\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"hb\",\"filter\":{\"type\":\"Filter\"},\"\":{\"zvdudgwdslfhotwm\":\"datajj\"}},{\"type\":\"Selector\",\"id\":\"ynpwlbj\",\"filter\":{\"type\":\"Filter\"},\"\":{\"nltyfsoppusuesnz\":\"datacftadeh\",\"xzdmohctb\":\"datadejbavo\"}},{\"type\":\"Selector\",\"id\":\"vudwx\",\"filter\":{\"type\":\"Filter\"},\"\":{\"gujjugwdkcglh\":\"datavo\",\"ofqweykhmenevfye\":\"datalazjdyggdtjixhbk\",\"dcsi\":\"datafwhybcibvy\"}},{\"type\":\"Selector\",\"id\":\"ynnaam\",\"filter\":{\"type\":\"Filter\"},\"\":{\"iqscjeypv\":\"dataeh\",\"gm\":\"dataezrkgqhcjrefo\",\"yyvxyqjpkcattpn\":\"dataqsl\",\"v\":\"datajcrcczsqpjhvmda\"}}],\"startOnCreation\":true},\"location\":\"ounqecano\",\"tags\":{\"rpmopjmc\":\"pfhyhl\"},\"id\":\"atuokthfuiu\",\"name\":\"odsfcpkvxodpuozm\",\"type\":\"zydagfuaxbezyiuo\"},{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"wz\":{\"principalId\":\"553b7af2-caea-4f7e-8708-4113725c7e0f\",\"clientId\":\"6a91372d-f022-4b5e-b1ac-17c2039d1263\"},\"sm\":{\"principalId\":\"119fde70-223d-49d1-bf05-b90bfb53bec6\",\"clientId\":\"4a9ebd2a-94a3-4b14-b4f6-9d9d2b55d834\"},\"reximoryocfs\":{\"principalId\":\"fec08330-339f-4701-abd7-ff1a32043da5\",\"clientId\":\"b401908a-87e9-4d08-b905-ef423a7b1d96\"}},\"principalId\":\"s\",\"tenantId\":\"ddystkiiuxhqy\"},\"properties\":{\"steps\":[{\"name\":\"xorrqnb\",\"branches\":[{\"name\":\"czvyifq\",\"actions\":[]},{\"name\":\"vkd\",\"actions\":[]}]},{\"name\":\"jsllrmv\",\"branches\":[{\"name\":\"f\",\"actions\":[]}]},{\"name\":\"atkpnp\",\"branches\":[{\"name\":\"exxbczwtr\",\"actions\":[]},{\"name\":\"wiqzbqjvsovmyo\",\"actions\":[]},{\"name\":\"acspkwl\",\"actions\":[]}]},{\"name\":\"zdobpxjmflbvvnch\",\"branches\":[{\"name\":\"cciw\",\"actions\":[]},{\"name\":\"zjuqkhrsaj\",\"actions\":[]},{\"name\":\"wkuofoskghsauu\",\"actions\":[]},{\"name\":\"mjmvxieduugidyjr\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"byao\",\"filter\":{\"type\":\"Filter\"},\"\":{\"slkevle\":\"datacsonpclhoco\"}}],\"startOnCreation\":false},\"location\":\"fbuhfmvfaxkffe\",\"tags\":{\"m\":\"hl\"},\"id\":\"zy\",\"name\":\"shxmzsbbzoggigrx\",\"type\":\"burvjxxjnspy\"}],\"nextLink\":\"tko\"}") - .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 b1dc96cbb73ed..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentPropertiesTests.java +++ /dev/null @@ -1,103 +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.Action; -import com.azure.resourcemanager.chaos.models.Branch; -import com.azure.resourcemanager.chaos.models.Filter; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -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( - "{\"steps\":[{\"name\":\"bbaumnyquped\",\"branches\":[{\"name\":\"jn\",\"actions\":[{\"type\":\"Action\",\"name\":\"ckhsmtxpsieb\"},{\"type\":\"Action\",\"name\":\"fhvpesaps\"},{\"type\":\"Action\",\"name\":\"rdqmhjjdhtldwkyz\"}]},{\"name\":\"uutkncw\",\"actions\":[{\"type\":\"Action\",\"name\":\"wsvlxotogtwrupqs\"},{\"type\":\"Action\",\"name\":\"vnm\"},{\"type\":\"Action\",\"name\":\"cykvceo\"}]},{\"name\":\"eil\",\"actions\":[{\"type\":\"Action\",\"name\":\"notyfjfcnjbkcn\"},{\"type\":\"Action\",\"name\":\"dhbt\"},{\"type\":\"Action\",\"name\":\"kphywpnvjto\"}]},{\"name\":\"nermcl\",\"actions\":[{\"type\":\"Action\",\"name\":\"lphox\"},{\"type\":\"Action\",\"name\":\"scrpabgyepsbjt\"}]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"qugxywpmueefjzwf\",\"filter\":{\"type\":\"Filter\"},\"\":{\"xtccmg\":\"datajidsuyonobglaoc\",\"wfudwpzntxhdzhl\":\"dataudxytlmoyrx\",\"hckfrlhrx\":\"dataqj\"}}],\"startOnCreation\":false}") - .toObject(ExperimentProperties.class); - Assertions.assertEquals("bbaumnyquped", model.steps().get(0).name()); - Assertions.assertEquals("jn", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("ckhsmtxpsieb", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("qugxywpmueefjzwf", model.selectors().get(0).id()); - Assertions.assertEquals(false, model.startOnCreation()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentProperties model = - new ExperimentProperties() - .withSteps( - Arrays - .asList( - new Step() - .withName("bbaumnyquped") - .withBranches( - Arrays - .asList( - new Branch() - .withName("jn") - .withActions( - Arrays - .asList( - new Action().withName("ckhsmtxpsieb"), - new Action().withName("fhvpesaps"), - new Action().withName("rdqmhjjdhtldwkyz"))), - new Branch() - .withName("uutkncw") - .withActions( - Arrays - .asList( - new Action().withName("wsvlxotogtwrupqs"), - new Action().withName("vnm"), - new Action().withName("cykvceo"))), - new Branch() - .withName("eil") - .withActions( - Arrays - .asList( - new Action().withName("notyfjfcnjbkcn"), - new Action().withName("dhbt"), - new Action().withName("kphywpnvjto"))), - new Branch() - .withName("nermcl") - .withActions( - Arrays - .asList( - new Action().withName("lphox"), - new Action().withName("scrpabgyepsbjt"))))))) - .withSelectors( - Arrays - .asList( - new Selector() - .withId("qugxywpmueefjzwf") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")))) - .withStartOnCreation(false); - model = BinaryData.fromObject(model).toObject(ExperimentProperties.class); - Assertions.assertEquals("bbaumnyquped", model.steps().get(0).name()); - Assertions.assertEquals("jn", model.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("ckhsmtxpsieb", model.steps().get(0).branches().get(0).actions().get(0).name()); - Assertions.assertEquals("qugxywpmueefjzwf", model.selectors().get(0).id()); - Assertions.assertEquals(false, model.startOnCreation()); - } - - @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/ExperimentStartOperationResultInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStartOperationResultInnerTests.java deleted file mode 100644 index f3c44a5518fcc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStartOperationResultInnerTests.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.ExperimentStartOperationResultInner; - -public final class ExperimentStartOperationResultInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentStartOperationResultInner model = - BinaryData - .fromString("{\"name\":\"tdhxujznbmpowuwp\",\"statusUrl\":\"qlveualupjmkh\"}") - .toObject(ExperimentStartOperationResultInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentStartOperationResultInner model = new ExperimentStartOperationResultInner(); - model = BinaryData.fromObject(model).toObject(ExperimentStartOperationResultInner.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusInnerTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusInnerTests.java deleted file mode 100644 index 0cff857fd16a7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusInnerTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusInner; - -public final class ExperimentStatusInnerTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentStatusInner model = - BinaryData - .fromString( - "{\"type\":\"zjuzgwyz\",\"id\":\"txon\",\"name\":\"ts\",\"properties\":{\"status\":\"cbpwxqpsrknft\",\"createdDateUtc\":\"2021-04-20T10:14:36Z\",\"endDateUtc\":\"2021-01-01T20:16:55Z\"}}") - .toObject(ExperimentStatusInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentStatusInner model = new ExperimentStatusInner(); - model = BinaryData.fromObject(model).toObject(ExperimentStatusInner.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusListResultTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusListResultTests.java deleted file mode 100644 index f21726586306b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.models.ExperimentStatusListResult; - -public final class ExperimentStatusListResultTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentStatusListResult model = - BinaryData - .fromString( - "{\"value\":[{\"type\":\"bcswsrt\",\"id\":\"iplrbpbewtghfgb\",\"name\":\"gw\",\"properties\":{\"status\":\"lvqhjkbegibtnmx\",\"createdDateUtc\":\"2021-04-16T06:52:16Z\",\"endDateUtc\":\"2021-03-05T02:51:46Z\"}}],\"nextLink\":\"loayqcgw\"}") - .toObject(ExperimentStatusListResult.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentStatusListResult model = new ExperimentStatusListResult(); - model = BinaryData.fromObject(model).toObject(ExperimentStatusListResult.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusPropertiesTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusPropertiesTests.java deleted file mode 100644 index 3629658444e0f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentStatusPropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.util.BinaryData; -import com.azure.resourcemanager.chaos.fluent.models.ExperimentStatusProperties; - -public final class ExperimentStatusPropertiesTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ExperimentStatusProperties model = - BinaryData - .fromString( - "{\"status\":\"hprwmdyv\",\"createdDateUtc\":\"2021-07-01T04:16:54Z\",\"endDateUtc\":\"2021-07-25T12:29:44Z\"}") - .toObject(ExperimentStatusProperties.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentStatusProperties model = new ExperimentStatusProperties(); - model = BinaryData.fromObject(model).toObject(ExperimentStatusProperties.class); - } -} 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 5b13428e765d9..0000000000000 --- 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\":\"UserAssigned\",\"userAssignedIdentities\":{\"it\":{\"principalId\":\"c1000e40-cee2-4311-b04e-e94747e05df2\",\"clientId\":\"147b9e75-fe91-49c9-b34f-5121d73c6b63\"},\"jawgqwg\":{\"principalId\":\"ab61a5da-1f68-4580-84f9-7d0dbb3c39a1\",\"clientId\":\"8744a7df-7546-485d-b3a1-c096cb036fad\"}},\"principalId\":\"ni\",\"tenantId\":\"x\"}}") - .toObject(ExperimentUpdate.class); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ExperimentUpdate model = - new ExperimentUpdate() - .withIdentity( - new ResourceIdentity() - .withType(ResourceIdentityType.USER_ASSIGNED) - .withUserAssignedIdentities( - mapOf("it", new UserAssignedIdentity(), "jawgqwg", new UserAssignedIdentity()))); - model = BinaryData.fromObject(model).toObject(ExperimentUpdate.class); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, model.identity().type()); - } - - @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/ExperimentsCancelWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelWithResponseMockTests.java deleted file mode 100644 index 043aa45b9f925..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCancelWithResponseMockTests.java +++ /dev/null @@ -1,66 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentCancelOperationResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsCancelWithResponseMockTests { - @Test - public void testCancelWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"name\":\"xkk\",\"statusUrl\":\"h\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ChaosManager manager = - ChaosManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExperimentCancelOperationResult response = - manager - .experiments() - .cancelWithResponse("sgogczhonnxk", "lgnyhmo", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateWithResponseMockTests.java deleted file mode 100644 index 47326d7582c92..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,146 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Branch; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.Filter; -import com.azure.resourcemanager.chaos.models.ResourceIdentity; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import com.azure.resourcemanager.chaos.models.Selector; -import com.azure.resourcemanager.chaos.models.Step; -import com.azure.resourcemanager.chaos.models.UserAssignedIdentity; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"None\",\"userAssignedIdentities\":{\"fgmblrrilbywdxsm\":{\"principalId\":\"6981a6ea-7d5f-43e8-a7e5-588b5fc19ebd\",\"clientId\":\"4800dd1a-97e6-4b07-81ad-e83847e391ab\"}},\"principalId\":\"cwrwfs\",\"tenantId\":\"fnynszqujizdvoqy\"},\"properties\":{\"steps\":[{\"name\":\"byowbblgyavutp\",\"branches\":[{\"name\":\"joxoism\",\"actions\":[]},{\"name\":\"ksbpimlqoljx\",\"actions\":[]}]},{\"name\":\"cgxxlxs\",\"branches\":[{\"name\":\"gcvizqzdwlvwlyou\",\"actions\":[]},{\"name\":\"fgfb\",\"actions\":[]}]},{\"name\":\"jub\",\"branches\":[{\"name\":\"hgkfmin\",\"actions\":[]}]},{\"name\":\"g\",\"branches\":[{\"name\":\"zfttsttktlahb\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"ctxtgzukxi\",\"filter\":{\"type\":\"Filter\"},\"\":{\"qqxhrnxrxcpj\":\"datatg\",\"dzf\":\"dataisavok\",\"atnwxyiopi\":\"dataazivjlfrqttbajl\"}},{\"type\":\"Selector\",\"id\":\"kqqfk\",\"filter\":{\"type\":\"Filter\"},\"\":{\"ibrxkp\":\"dataxkdmligo\",\"bteoybf\":\"dataloazuruocbgoo\",\"jgslordilmyww\":\"datajxakv\"}},{\"type\":\"Selector\",\"id\":\"kgkxn\",\"filter\":{\"type\":\"Filter\"},\"\":{\"yvudtjuewbci\":\"datab\",\"xccybvpa\":\"dataxuuwhcj\"}},{\"type\":\"Selector\",\"id\":\"akkud\",\"filter\":{\"type\":\"Filter\"},\"\":{\"stcyohpfkyrkdbd\":\"datawjplma\",\"nobaiyhddviacegf\":\"dataiogsjkmnwq\"}}],\"startOnCreation\":true},\"location\":\"tfpmvmemfnczdw\",\"tags\":{\"db\":\"alxlllchp\"},\"id\":\"evwrdnhfuk\",\"name\":\"vsjcswsmystuluqy\",\"type\":\"fcvlerch\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("hmkxmaehvbb") - .withRegion("sivfomilo") - .withExistingResourceGroup("eydbsd") - .withSteps( - Arrays - .asList( - new Step() - .withName("tgk") - .withBranches( - Arrays - .asList( - new Branch().withName("tvdxeclzedqb").withActions(Arrays.asList()), - new Branch().withName("vh").withActions(Arrays.asList()), - new Branch().withName("lhpl").withActions(Arrays.asList()))), - new Step() - .withName("dqkdlwwqfbu") - .withBranches( - Arrays.asList(new Branch().withName("kxtrq").withActions(Arrays.asList()))))) - .withSelectors( - Arrays - .asList( - new Selector() - .withId("smlmbtxhwgfwsrta") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")), - new Selector() - .withId("qgzsles") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")), - new Selector() - .withId("ewzcjznmwcp") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")), - new Selector() - .withId("w") - .withFilter(new Filter()) - .withAdditionalProperties(mapOf("type", "Selector")))) - .withTags(mapOf("dieuzaofj", "dufiq", "otcubi", "hvcyyysfg")) - .withIdentity( - new ResourceIdentity() - .withType(ResourceIdentityType.SYSTEM_ASSIGNED) - .withUserAssignedIdentities( - mapOf( - "n", - new UserAssignedIdentity(), - "axkgx", - new UserAssignedIdentity(), - "ckpyklyhplu", - new UserAssignedIdentity()))) - .withStartOnCreation(false) - .create(); - - Assertions.assertEquals("tfpmvmemfnczdw", response.location()); - Assertions.assertEquals("alxlllchp", response.tags().get("db")); - Assertions.assertEquals(ResourceIdentityType.NONE, response.identity().type()); - Assertions.assertEquals("byowbblgyavutp", response.steps().get(0).name()); - Assertions.assertEquals("joxoism", response.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("ctxtgzukxi", response.selectors().get(0).id()); - Assertions.assertEquals(true, response.startOnCreation()); - } - - @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/ExperimentsDeleteByResourceGroupWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteByResourceGroupWithResponseMockTests.java deleted file mode 100644 index cf6fe4809dad4..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsDeleteByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsDeleteByResourceGroupWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ChaosManager manager = - ChaosManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - manager - .experiments() - .deleteByResourceGroupWithResponse("tmmjihyeozph", "wau", com.azure.core.util.Context.NONE); - } -} 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 2e1d19da88a17..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetByResourceGroupWithResponseMockTests.java +++ /dev/null @@ -1,77 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsGetByResourceGroupWithResponseMockTests { - @Test - public void testGetByResourceGroupWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"identity\":{\"type\":\"SystemAssigned\",\"userAssignedIdentities\":{\"hojujbypelmcuv\":{\"principalId\":\"9151e949-2c21-426f-abce-12c7400f217f\",\"clientId\":\"89c26f2a-1891-48ed-a922-34da940492e4\"},\"bjx\":{\"principalId\":\"21310cad-a62d-4c74-a0b6-3431369872d4\",\"clientId\":\"84b97f4c-56da-4844-b613-5ce0881ac388\"},\"n\":{\"principalId\":\"4337f343-9ed0-4d83-b3ac-d1427c752f37\",\"clientId\":\"6f3e5a61-5997-47a6-a0d9-6bd2ba0ac851\"}},\"principalId\":\"r\",\"tenantId\":\"o\"},\"properties\":{\"steps\":[{\"name\":\"ttpkiwkkbnujrywv\",\"branches\":[{\"name\":\"lbfpncurd\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"wiithtywub\",\"filter\":{\"type\":\"Filter\"},\"\":{\"qknfd\":\"datah\",\"ihxumwctondzj\":\"datatwjchrdg\",\"fdlwg\":\"datauu\",\"gseinq\":\"dataytsbwtovv\"}}],\"startOnCreation\":true},\"location\":\"fxqknpirgneptt\",\"tags\":{\"mqnrojlpijnkr\":\"sniffc\",\"zronasxift\":\"frddhcrati\"},\"id\":\"zq\",\"name\":\"zh\",\"type\":\"tw\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("qncygupkvi", "mdscwxqupev", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("fxqknpirgneptt", response.location()); - Assertions.assertEquals("sniffc", response.tags().get("mqnrojlpijnkr")); - Assertions.assertEquals(ResourceIdentityType.SYSTEM_ASSIGNED, response.identity().type()); - Assertions.assertEquals("ttpkiwkkbnujrywv", response.steps().get(0).name()); - Assertions.assertEquals("lbfpncurd", response.steps().get(0).branches().get(0).name()); - Assertions.assertEquals("wiithtywub", response.selectors().get(0).id()); - Assertions.assertEquals(true, response.startOnCreation()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsWithResponseMockTests.java deleted file mode 100644 index e5f9388f7908b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetExecutionDetailsWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsGetExecutionDetailsWithResponseMockTests { - @Test - public void testGetExecutionDetailsWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"type\":\"jv\",\"id\":\"imwkslircizj\",\"name\":\"ydfce\",\"properties\":{\"experimentId\":\"lhvygdyftu\",\"status\":\"twnawjslbiwkojgc\",\"failureReason\":\"tsf\",\"createdDateTime\":\"2021-10-17T10:06:27Z\",\"lastActionDateTime\":\"2021-07-03T06:16:35Z\",\"startDateTime\":\"2021-03-07T16:28:02Z\",\"stopDateTime\":\"2021-03-23T01:57:59Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"rn\",\"stepId\":\"x\",\"status\":\"uwrykqgaifmvikl\",\"branches\":[{}]},{\"stepName\":\"khbejdznxc\",\"stepId\":\"srhnjivo\",\"status\":\"tnovqfzgemjdftul\",\"branches\":[{},{}]},{\"stepName\":\"ucea\",\"stepId\":\"mczuo\",\"status\":\"jw\",\"branches\":[{},{}]},{\"stepName\":\"ioknssxmoj\",\"stepId\":\"vpkjpr\",\"status\":\"wcfzqljyxgt\",\"branches\":[{}]}]}}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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() - .getExecutionDetailsWithResponse("ih", "jqgwzp", "fqntcyp", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusWithResponseMockTests.java deleted file mode 100644 index 2ed0efcd18184..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsGetStatusWithResponseMockTests.java +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsGetStatusWithResponseMockTests { - @Test - public void testGetStatusWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"type\":\"uyovw\",\"id\":\"bkfezzxscyhwzdgi\",\"name\":\"jbzbomvzzbtdcq\",\"properties\":{\"status\":\"iyujviylwdshfs\",\"createdDateUtc\":\"2021-10-02T20:28:41Z\",\"endDateUtc\":\"2021-10-15T12:19:25Z\"}}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ChaosManager manager = - ChaosManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExperimentStatus response = - manager - .experiments() - .getStatusWithResponse("omtbghhavgrvkff", "vjzhpjbib", "jmfxumvf", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesMockTests.java deleted file mode 100644 index ef3e9303cf02e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListAllStatusesMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentStatus; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsListAllStatusesMockTests { - @Test - public void testListAllStatuses() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"type\":\"zejntps\",\"id\":\"gioilqu\",\"name\":\"ydxtqm\",\"properties\":{\"status\":\"xorgg\",\"createdDateUtc\":\"2021-04-30T10:21:51Z\",\"endDateUtc\":\"2021-04-20T02:01Z\"}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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().listAllStatuses("rtkfawnopq", "ikyzirtxdy", 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 de214104968e8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListByResourceGroupMockTests.java +++ /dev/null @@ -1,75 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsListByResourceGroupMockTests { - @Test - public void testListByResourceGroup() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"egxuvwzf\":{\"principalId\":\"da161d78-ceb8-493f-9d63-bd293c67a9d7\",\"clientId\":\"8593d58d-2ab7-4555-8cf4-bdd8dce1e247\"},\"lmctlpd\":{\"principalId\":\"655b6693-b1d9-475f-8bd0-4e041a8c52af\",\"clientId\":\"0d139c1e-327d-460e-9d22-5c4e25708cbf\"},\"tvgbmhrixkwmy\":{\"principalId\":\"74be79ee-70d8-411d-be02-a93159dba7d0\",\"clientId\":\"2f7ab16a-eda0-4e1f-9fe6-530b35ab4f50\"},\"jvegrhbpnaixexcc\":{\"principalId\":\"91aed7d7-9704-4376-bc1a-a760e3fe20b1\",\"clientId\":\"a765f368-dd76-4d56-ab35-eb7db505bcd4\"}},\"principalId\":\"reaxhcexdr\",\"tenantId\":\"qahqkghtpwijn\"},\"properties\":{\"steps\":[{\"name\":\"jsvfycxzbfvoowv\",\"branches\":[{\"name\":\"mtg\",\"actions\":[]},{\"name\":\"qp\",\"actions\":[]},{\"name\":\"y\",\"actions\":[]}]},{\"name\":\"s\",\"branches\":[{\"name\":\"on\",\"actions\":[]},{\"name\":\"myhgfipnsxkmc\",\"actions\":[]},{\"name\":\"a\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"rrjreafxtsgu\",\"filter\":{\"type\":\"Filter\"},\"\":{\"xwslolbqpv\":\"datalik\",\"crpw\":\"datazlmvfelfktgp\",\"brnjwmw\":\"dataxeznoi\"}},{\"type\":\"Selector\",\"id\":\"pn\",\"filter\":{\"type\":\"Filter\"},\"\":{\"gzxnfaazpxdtnk\":\"dataejjoqkagfhsxtta\",\"wuenvr\":\"datamkqjj\"}}],\"startOnCreation\":false},\"location\":\"ou\",\"tags\":{\"xqtnq\":\"rebqaaysjk\"},\"id\":\"tezlwff\",\"name\":\"iakp\",\"type\":\"pqqmted\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("uhbxvvy", true, "s", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ou", response.iterator().next().location()); - Assertions.assertEquals("rebqaaysjk", response.iterator().next().tags().get("xqtnq")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("jsvfycxzbfvoowv", response.iterator().next().steps().get(0).name()); - Assertions.assertEquals("mtg", response.iterator().next().steps().get(0).branches().get(0).name()); - Assertions.assertEquals("rrjreafxtsgu", response.iterator().next().selectors().get(0).id()); - Assertions.assertEquals(false, response.iterator().next().startOnCreation()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsMockTests.java deleted file mode 100644 index d5cf83de372b0..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListExecutionDetailsMockTests.java +++ /dev/null @@ -1,65 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentExecutionDetails; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsListExecutionDetailsMockTests { - @Test - public void testListExecutionDetails() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"type\":\"otmrfhir\",\"id\":\"ymoxoftpipiwyczu\",\"name\":\"a\",\"properties\":{\"experimentId\":\"jlihhyus\",\"status\":\"kasdvlm\",\"failureReason\":\"dgzxulucvpamrsr\",\"createdDateTime\":\"2021-12-07T21:14:58Z\",\"lastActionDateTime\":\"2021-03-05T11:45:05Z\",\"startDateTime\":\"2021-04-24T08:08:26Z\",\"stopDateTime\":\"2021-08-09T16:10:18Z\",\"runInformation\":{\"steps\":[{\"stepName\":\"ytxifqjzgxmrh\",\"stepId\":\"lw\",\"status\":\"esutrgjupauutpw\",\"branches\":[{},{},{},{}]}]}}}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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().listExecutionDetails("ye", "rymsgaojfmw", com.azure.core.util.Context.NONE); - } -} 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 738ebdd5cb5bb..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsListMockTests.java +++ /dev/null @@ -1,74 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Experiment; -import com.azure.resourcemanager.chaos.models.ResourceIdentityType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"identity\":{\"type\":\"UserAssigned\",\"userAssignedIdentities\":{\"flsjc\":{\"principalId\":\"4c7cbc3d-2c6e-4727-90a1-2ea9cc668963\",\"clientId\":\"afc8e789-a7dc-4f45-b17c-935e06e1b82e\"},\"zfjvfbgofe\":{\"principalId\":\"51256333-c15d-4f4c-a031-9c3f734caccc\",\"clientId\":\"bb3f4b67-5151-454c-a2db-cce7d9187729\"},\"grqmqhldvrii\":{\"principalId\":\"175e5096-c854-4e01-946d-940bbdd2b69d\",\"clientId\":\"9681afac-8c36-4d6e-bf43-abf10867808f\"},\"nalghfkvtvsexso\":{\"principalId\":\"1910718a-d2d1-428c-b5e8-c8f657406e06\",\"clientId\":\"4d435627-1e68-4c9c-aa27-ea75fb2fd655\"}},\"principalId\":\"el\",\"tenantId\":\"hhahhxvrhmzkwpjg\"},\"properties\":{\"steps\":[{\"name\":\"spughftqsxhq\",\"branches\":[{\"name\":\"j\",\"actions\":[]},{\"name\":\"ukndxdigrjgu\",\"actions\":[]},{\"name\":\"fzdm\",\"actions\":[]}]},{\"name\":\"yqtfihwh\",\"branches\":[{\"name\":\"tzingamvpph\",\"actions\":[]}]},{\"name\":\"szqzudphqamv\",\"branches\":[{\"name\":\"fwynwcvtbvkay\",\"actions\":[]},{\"name\":\"mtnvyq\",\"actions\":[]}]},{\"name\":\"atkzwpcnpw\",\"branches\":[{\"name\":\"jaesgvvsccya\",\"actions\":[]},{\"name\":\"g\",\"actions\":[]},{\"name\":\"qfhwyg\",\"actions\":[]}]}],\"selectors\":[{\"type\":\"Selector\",\"id\":\"vdnkfxusem\",\"filter\":{\"type\":\"Filter\"},\"\":{\"svuo\":\"datamuhapfcqdpsqxqv\",\"mfe\":\"datamgccelvezrypq\",\"ob\":\"datakerqwkyh\"}},{\"type\":\"Selector\",\"id\":\"pg\",\"filter\":{\"type\":\"Filter\"},\"\":{\"ccsnjvcdwxlpq\":\"dataowepbqpcrfkb\"}}],\"startOnCreation\":false},\"location\":\"tn\",\"tags\":{\"dhtmdvypgikd\":\"jsyingwfqatm\",\"hlhkjoqrvqqaatj\":\"szywkbirryu\"},\"id\":\"nrvgoupmfiibfgg\",\"name\":\"ioolvrwxkvtkkgll\",\"type\":\"wjygvjayvblmhvk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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(true, "pwp", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("tn", response.iterator().next().location()); - Assertions.assertEquals("jsyingwfqatm", response.iterator().next().tags().get("dhtmdvypgikd")); - Assertions.assertEquals(ResourceIdentityType.USER_ASSIGNED, response.iterator().next().identity().type()); - Assertions.assertEquals("spughftqsxhq", response.iterator().next().steps().get(0).name()); - Assertions.assertEquals("j", response.iterator().next().steps().get(0).branches().get(0).name()); - Assertions.assertEquals("vdnkfxusem", response.iterator().next().selectors().get(0).id()); - Assertions.assertEquals(false, response.iterator().next().startOnCreation()); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartWithResponseMockTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartWithResponseMockTests.java deleted file mode 100644 index 64411fae9d610..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ExperimentsStartWithResponseMockTests.java +++ /dev/null @@ -1,66 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.ExperimentStartOperationResult; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class ExperimentsStartWithResponseMockTests { - @Test - public void testStartWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{\"name\":\"nsvbuswdv\",\"statusUrl\":\"ybycnunvj\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(202); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - ChaosManager manager = - ChaosManager - .configure() - .withHttpClient(httpClient) - .authenticate( - tokenRequestContext -> Mono.just(new AccessToken("this_is_a_token", OffsetDateTime.MAX)), - new AzureProfile("", "", AzureEnvironment.AZURE)); - - ExperimentStartOperationResult response = - manager - .experiments() - .startWithResponse("rghxjb", "hqxvcxgfrpdsofbs", com.azure.core.util.Context.NONE) - .getValue(); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/FilterTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/FilterTests.java deleted file mode 100644 index 991b41981fce2..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/FilterTests.java +++ /dev/null @@ -1,21 +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.Filter; - -public final class FilterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Filter model = BinaryData.fromString("{\"type\":\"Filter\"}").toObject(Filter.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Filter model = new Filter(); - model = BinaryData.fromObject(model).toObject(Filter.class); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ListSelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ListSelectorTests.java deleted file mode 100644 index cae3c1379937d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ListSelectorTests.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.Filter; -import com.azure.resourcemanager.chaos.models.ListSelector; -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 ListSelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - ListSelector model = - BinaryData - .fromString( - "{\"type\":\"List\",\"targets\":[{\"type\":\"ChaosTarget\",\"id\":\"lcvydy\"},{\"type\":\"ChaosTarget\",\"id\":\"tdooaoj\"}],\"id\":\"niodkooeb\",\"filter\":{\"type\":\"Filter\"},\"\":{\"vdkcrodtj\":\"datahemms\",\"lfoakg\":\"datanfwjlfltkacjvefk\"}}") - .toObject(ListSelector.class); - Assertions.assertEquals("niodkooeb", model.id()); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.targets().get(0).type()); - Assertions.assertEquals("lcvydy", model.targets().get(0).id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ListSelector model = - new ListSelector() - .withId("niodkooeb") - .withFilter(new Filter()) - .withTargets( - Arrays - .asList( - new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("lcvydy"), - new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("tdooaoj"))); - model = BinaryData.fromObject(model).toObject(ListSelector.class); - Assertions.assertEquals("niodkooeb", model.id()); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.targets().get(0).type()); - Assertions.assertEquals("lcvydy", model.targets().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 0901257abf493..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationDisplayTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"crkvcikhnv\",\"resource\":\"mqg\",\"operation\":\"queziky\",\"description\":\"gxk\"}") - .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 b52a85b77253f..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationInnerTests.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.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\":\"abikns\",\"isDataAction\":false,\"display\":{\"provider\":\"xbldtlwwrlkdmtn\",\"resource\":\"ok\",\"operation\":\"llxdyhgs\",\"description\":\"cogjltdtbn\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}") - .toObject(OperationInner.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - OperationInner model = new OperationInner().withDisplay(new OperationDisplay()); - model = BinaryData.fromObject(model).toObject(OperationInner.class); - } -} diff --git a/sdk/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 2e2dbd89789b7..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/OperationListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"wifto\",\"isDataAction\":true,\"display\":{\"provider\":\"uvksgplsaknynfsy\",\"resource\":\"jphuopxodlqi\",\"operation\":\"torzih\",\"description\":\"osjswsr\"},\"origin\":\"system\",\"actionType\":\"Internal\"},{\"name\":\"pzbchck\",\"isDataAction\":true,\"display\":{\"provider\":\"ox\",\"resource\":\"suiizynkedyat\",\"operation\":\"yhqmibzyhwi\",\"description\":\"mypyynpcdpu\"},\"origin\":\"user,system\",\"actionType\":\"Internal\"}],\"nextLink\":\"z\"}") - .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/QuerySelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/QuerySelectorTests.java deleted file mode 100644 index 3060354b6f502..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/QuerySelectorTests.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.Filter; -import com.azure.resourcemanager.chaos.models.QuerySelector; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class QuerySelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - QuerySelector model = - BinaryData - .fromString( - "{\"type\":\"Query\",\"queryString\":\"blylsyxkqjnsj\",\"subscriptionIds\":[\"vti\"],\"id\":\"gxsds\",\"filter\":{\"type\":\"Filter\"},\"\":{\"icvi\":\"datapsbzkfzbeyvpn\",\"jjxd\":\"datav\",\"ztzp\":\"datarbuukzclewyhmlwp\"}}") - .toObject(QuerySelector.class); - Assertions.assertEquals("gxsds", model.id()); - Assertions.assertEquals("blylsyxkqjnsj", model.queryString()); - Assertions.assertEquals("vti", model.subscriptionIds().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - QuerySelector model = - new QuerySelector() - .withId("gxsds") - .withFilter(new Filter()) - .withQueryString("blylsyxkqjnsj") - .withSubscriptionIds(Arrays.asList("vti")); - model = BinaryData.fromObject(model).toObject(QuerySelector.class); - Assertions.assertEquals("gxsds", model.id()); - Assertions.assertEquals("blylsyxkqjnsj", model.queryString()); - Assertions.assertEquals("vti", model.subscriptionIds().get(0)); - } -} 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 c3e3fa007ec9b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/ResourceIdentityTests.java +++ /dev/null @@ -1,47 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"None\",\"userAssignedIdentities\":{\"mkfssxqukkfplgm\":{\"principalId\":\"6999b89d-259f-44cf-ad3c-6d5076e3df83\",\"clientId\":\"326a00cb-dd9f-43b5-9b3f-416045e6fc59\"},\"nkjzkdeslpvlop\":{\"principalId\":\"3e8374dc-0257-4d89-a7ff-a9bd17a713d7\",\"clientId\":\"a9819cbc-ee4b-42dc-b115-cf907ae81f14\"}},\"principalId\":\"yighxpk\",\"tenantId\":\"zb\"}") - .toObject(ResourceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - ResourceIdentity model = - new ResourceIdentity() - .withType(ResourceIdentityType.NONE) - .withUserAssignedIdentities( - mapOf("mkfssxqukkfplgm", new UserAssignedIdentity(), "nkjzkdeslpvlop", new UserAssignedIdentity())); - model = BinaryData.fromObject(model).toObject(ResourceIdentity.class); - Assertions.assertEquals(ResourceIdentityType.NONE, model.type()); - } - - @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/SelectorTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SelectorTests.java deleted file mode 100644 index 3c8d1d3090adc..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SelectorTests.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.Filter; -import com.azure.resourcemanager.chaos.models.Selector; -import java.util.HashMap; -import java.util.Map; -import org.junit.jupiter.api.Assertions; - -public final class SelectorTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Selector model = - BinaryData - .fromString( - "{\"type\":\"Selector\",\"id\":\"vo\",\"filter\":{\"type\":\"Filter\"},\"\":{\"jrwjueiotwm\":\"dataeuecivyhzceuoj\"}}") - .toObject(Selector.class); - Assertions.assertEquals("vo", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Selector model = - new Selector().withId("vo").withFilter(new Filter()).withAdditionalProperties(mapOf("type", "Selector")); - model = BinaryData.fromObject(model).toObject(Selector.class); - Assertions.assertEquals("vo", model.id()); - } - - @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/SimpleFilterParametersTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterParametersTests.java deleted file mode 100644 index 36134b883bd4c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterParametersTests.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.SimpleFilterParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SimpleFilterParametersTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimpleFilterParameters model = - BinaryData - .fromString("{\"zones\":[\"jaltolmnc\",\"sobqw\",\"sdbnwdcfhucqdpf\"]}") - .toObject(SimpleFilterParameters.class); - Assertions.assertEquals("jaltolmnc", model.zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimpleFilterParameters model = - new SimpleFilterParameters().withZones(Arrays.asList("jaltolmnc", "sobqw", "sdbnwdcfhucqdpf")); - model = BinaryData.fromObject(model).toObject(SimpleFilterParameters.class); - Assertions.assertEquals("jaltolmnc", model.zones().get(0)); - } -} diff --git a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterTests.java deleted file mode 100644 index 51953d40b2d9a..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/SimpleFilterTests.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.SimpleFilter; -import com.azure.resourcemanager.chaos.models.SimpleFilterParameters; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class SimpleFilterTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - SimpleFilter model = - BinaryData - .fromString( - "{\"type\":\"Simple\",\"parameters\":{\"zones\":[\"ckw\",\"fz\",\"whxxbuyqax\",\"feqztppriol\"]}}") - .toObject(SimpleFilter.class); - Assertions.assertEquals("ckw", model.parameters().zones().get(0)); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - SimpleFilter model = - new SimpleFilter() - .withParameters( - new SimpleFilterParameters().withZones(Arrays.asList("ckw", "fz", "whxxbuyqax", "feqztppriol"))); - model = BinaryData.fromObject(model).toObject(SimpleFilter.class); - Assertions.assertEquals("ckw", model.parameters().zones().get(0)); - } -} 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 b810f5ac48c6e..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepStatusTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"tdum\",\"stepId\":\"p\",\"status\":\"ebmnzbtbhjpglk\",\"branches\":[{\"branchName\":\"dneu\",\"branchId\":\"fphsdyhtozfikdow\",\"status\":\"uuvxz\",\"actions\":[{\"actionName\":\"ithhqzon\",\"actionId\":\"ggbhcohfwds\",\"status\":\"ka\",\"startTime\":\"2021-05-13T01:39:31Z\",\"endTime\":\"2021-03-15T03:19:59Z\",\"targets\":[{},{},{}]},{\"actionName\":\"acffgdkzzewkfvhq\",\"actionId\":\"a\",\"status\":\"vpnpp\",\"startTime\":\"2021-10-20T12:14:16Z\",\"endTime\":\"2021-03-21T05:49:29Z\",\"targets\":[{},{},{}]},{\"actionName\":\"hdlxyjrxsagafcn\",\"actionId\":\"gwq\",\"status\":\"nedgfbc\",\"startTime\":\"2021-07-29T10:41:12Z\",\"endTime\":\"2021-05-31T02:02:01Z\",\"targets\":[{},{},{},{}]},{\"actionName\":\"eqdcv\",\"actionId\":\"hvoodsotbobzd\",\"status\":\"cjwvn\",\"startTime\":\"2021-06-06T16:32:33Z\",\"endTime\":\"2021-11-29T05:13:59Z\",\"targets\":[{}]}]},{\"branchName\":\"cxrslpmutwuoe\",\"branchId\":\"pkhjwni\",\"status\":\"sluicpdggkzz\",\"actions\":[{\"actionName\":\"mpaxmodfvuefywsb\",\"actionId\":\"vmwy\",\"status\":\"fouyf\",\"startTime\":\"2021-03-21T19:22:18Z\",\"endTime\":\"2021-01-14T19:12:22Z\",\"targets\":[{},{},{},{}]},{\"actionName\":\"yzvqt\",\"actionId\":\"ubex\",\"status\":\"zksmondj\",\"startTime\":\"2021-10-31T06:50:30Z\",\"endTime\":\"2021-06-21T21:58:07Z\",\"targets\":[{},{},{},{}]},{\"actionName\":\"mg\",\"actionId\":\"pkwhojvpa\",\"status\":\"gxysmocmbqfqvm\",\"startTime\":\"2021-03-02T11:08:18Z\",\"endTime\":\"2021-10-15T15:22:20Z\",\"targets\":[{},{},{}]},{\"actionName\":\"helxprglya\",\"actionId\":\"dckcbc\",\"status\":\"jrjxgciqibrhosx\",\"startTime\":\"2021-10-09T16:21:07Z\",\"endTime\":\"2021-07-12T05:33:05Z\",\"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/StepTests.java b/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepTests.java deleted file mode 100644 index 9ff1ab7b0debd..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/StepTests.java +++ /dev/null @@ -1,64 +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.Action; -import com.azure.resourcemanager.chaos.models.Branch; -import com.azure.resourcemanager.chaos.models.Step; -import java.util.Arrays; -import org.junit.jupiter.api.Assertions; - -public final class StepTests { - @org.junit.jupiter.api.Test - public void testDeserialize() throws Exception { - Step model = - BinaryData - .fromString( - "{\"name\":\"yvpycanuzbpzk\",\"branches\":[{\"name\":\"kuwbcrnwb\",\"actions\":[{\"type\":\"Action\",\"name\":\"hhseyv\"},{\"type\":\"Action\",\"name\":\"us\"},{\"type\":\"Action\",\"name\":\"tslhspkdeem\"},{\"type\":\"Action\",\"name\":\"ofmxagkvtmelmqkr\"}]},{\"name\":\"ahvljuaha\",\"actions\":[{\"type\":\"Action\",\"name\":\"hcdhmdual\"},{\"type\":\"Action\",\"name\":\"exq\"}]},{\"name\":\"vfadmws\",\"actions\":[{\"type\":\"Action\",\"name\":\"r\"},{\"type\":\"Action\",\"name\":\"vxpvgomz\"},{\"type\":\"Action\",\"name\":\"fmisg\"}]},{\"name\":\"bnbbeldawkz\",\"actions\":[{\"type\":\"Action\",\"name\":\"liourqhak\"}]}]}") - .toObject(Step.class); - Assertions.assertEquals("yvpycanuzbpzk", model.name()); - Assertions.assertEquals("kuwbcrnwb", model.branches().get(0).name()); - Assertions.assertEquals("hhseyv", model.branches().get(0).actions().get(0).name()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - Step model = - new Step() - .withName("yvpycanuzbpzk") - .withBranches( - Arrays - .asList( - new Branch() - .withName("kuwbcrnwb") - .withActions( - Arrays - .asList( - new Action().withName("hhseyv"), - new Action().withName("us"), - new Action().withName("tslhspkdeem"), - new Action().withName("ofmxagkvtmelmqkr"))), - new Branch() - .withName("ahvljuaha") - .withActions( - Arrays.asList(new Action().withName("hcdhmdual"), new Action().withName("exq"))), - new Branch() - .withName("vfadmws") - .withActions( - Arrays - .asList( - new Action().withName("r"), - new Action().withName("vxpvgomz"), - new Action().withName("fmisg"))), - new Branch() - .withName("bnbbeldawkz") - .withActions(Arrays.asList(new Action().withName("liourqhak"))))); - model = BinaryData.fromObject(model).toObject(Step.class); - Assertions.assertEquals("yvpycanuzbpzk", model.name()); - Assertions.assertEquals("kuwbcrnwb", model.branches().get(0).name()); - Assertions.assertEquals("hhseyv", model.branches().get(0).actions().get(0).name()); - } -} 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 c1daa9a9f480d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetInnerTests.java +++ /dev/null @@ -1,42 +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\":\"wzsyyceuzs\",\"properties\":{\"ytdw\":\"databjudpfrxtrthzv\"},\"id\":\"qbrqubpaxhexiili\",\"name\":\"pdtii\",\"type\":\"q\"}") - .toObject(TargetInner.class); - Assertions.assertEquals("wzsyyceuzs", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetInner model = - new TargetInner().withLocation("wzsyyceuzs").withProperties(mapOf("ytdw", "databjudpfrxtrthzv")); - model = BinaryData.fromObject(model).toObject(TargetInner.class); - Assertions.assertEquals("wzsyyceuzs", model.location()); - } - - @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 6385cf4acceff..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"xllrxcyjm\",\"properties\":{\"hhyxxrw\":\"datadsuvarmywdmjsjqb\"},\"id\":\"yc\",\"name\":\"duhpk\",\"type\":\"kgymareqnajxqug\"},{\"location\":\"ycubeddgs\",\"properties\":{\"i\":\"datafwqmzqalkrmn\"},\"id\":\"pxacqqudfn\",\"name\":\"yxbaaabjyvayf\",\"type\":\"imrzrtuzqog\"}],\"nextLink\":\"xnevfdnwn\"}") - .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 c72d0b847dd0a..0000000000000 --- 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\":\"fpagaowpulp\"}").toObject(TargetReference.class); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.type()); - Assertions.assertEquals("fpagaowpulp", model.id()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetReference model = new TargetReference().withType(TargetReferenceType.CHAOS_TARGET).withId("fpagaowpulp"); - model = BinaryData.fromObject(model).toObject(TargetReference.class); - Assertions.assertEquals(TargetReferenceType.CHAOS_TARGET, model.type()); - Assertions.assertEquals("fpagaowpulp", 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 8a541eb0485a1..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeInnerTests.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.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\":\"mszkkfo\",\"properties\":{\"displayName\":\"eyfkzikfja\",\"description\":\"eaivxwczel\",\"propertiesSchema\":\"irels\",\"resourceTypes\":[\"enwabfatk\",\"ddxbjhwuaanoz\"]},\"id\":\"osphyoul\",\"name\":\"jrvxaglrv\",\"type\":\"mjwosytx\"}") - .toObject(TargetTypeInner.class); - Assertions.assertEquals("mszkkfo", model.location()); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - TargetTypeInner model = new TargetTypeInner().withLocation("mszkkfo"); - model = BinaryData.fromObject(model).toObject(TargetTypeInner.class); - Assertions.assertEquals("mszkkfo", 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 51f7ccc4ade63..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypeListResultTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"melwuipiccjz\",\"properties\":{\"displayName\":\"ivgvvcna\",\"description\":\"hyrnxxmu\",\"propertiesSchema\":\"dndrdvstkwqqtche\",\"resourceTypes\":[\"fmtdaaygdvwvgp\",\"ohgwxrtfudxepxg\",\"qagvrvm\"]},\"id\":\"pkukghi\",\"name\":\"dblx\",\"type\":\"wi\"}],\"nextLink\":\"njhf\"}") - .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 ed3cdb1ef1c9b..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypePropertiesTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"cskfcktqumiekk\",\"description\":\"zikhl\",\"propertiesSchema\":\"jhdgqggebdunyga\",\"resourceTypes\":[\"db\"]}") - .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 377b78914dbc6..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.TargetType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetTypesGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"rkjpvdwxfzwii\",\"properties\":{\"displayName\":\"zjb\",\"description\":\"zsxjrkambtrneg\",\"propertiesSchema\":\"nvuqeqvldspa\",\"resourceTypes\":[\"bkkd\",\"flvestmjlxrrilo\",\"apeewchpxlkt\",\"kuziycsle\"]},\"id\":\"ufuztcktyhjtq\",\"name\":\"dcgzul\",\"type\":\"mmrqz\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("uajlyj", "lvofqzhvfcibyfmo", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("rkjpvdwxfzwii", 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 2e11eb2785b77..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetTypesListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.TargetType; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetTypesListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"ddrihpf\",\"properties\":{\"displayName\":\"qcaaewdaomdjvl\",\"description\":\"x\",\"propertiesSchema\":\"zb\",\"resourceTypes\":[\"geivsiykzkdncj\",\"xonbzoggculapz\"]},\"id\":\"y\",\"name\":\"pgogtqxepny\",\"type\":\"b\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("qbmfpjbabwidf", "xsspuunnoxyhk", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("ddrihpf", 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 8d4a4a118be0d..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsCreateOrUpdateWithResponseMockTests.java +++ /dev/null @@ -1,93 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.fluent.models.TargetInner; -import com.azure.resourcemanager.chaos.models.Target; -import java.nio.ByteBuffer; -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 org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetsCreateOrUpdateWithResponseMockTests { - @Test - public void testCreateOrUpdateWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"faxvxil\",\"properties\":{\"hnze\":\"datatg\"},\"id\":\"qxtjjfzqlqhyca\",\"name\":\"odggx\",\"type\":\"beesmieknlra\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "ymbrnysuxmpraf", - "g", - "khocxvdfffwaf", - "roud", - "spave", - new TargetInner() - .withLocation("vkbunzozudh") - .withProperties(mapOf("bzydvfvfcj", "datagkmoyxcdyuibhmfd")), - com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("faxvxil", response.location()); - } - - @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 3d42aa00371b2..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsDeleteWithResponseMockTests.java +++ /dev/null @@ -1,69 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetsDeleteWithResponseMockTests { - @Test - public void testDeleteWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = "{}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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( - "hzvhxnkomtkubo", - "ppnvdxz", - "hihfrbbcevqagtlt", - "hlfkqojpy", - "vgtrdcnifmzzs", - 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 d0a7d51049a1c..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsGetWithResponseMockTests.java +++ /dev/null @@ -1,70 +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.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Target; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetsGetWithResponseMockTests { - @Test - public void testGetWithResponse() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"location\":\"digumbnr\",\"properties\":{\"ezwwv\":\"datauzzptjazysdz\",\"kphhq\":\"dataiqyuvvfo\",\"luwmncst\":\"dataikvylauya\"},\"id\":\"ijf\",\"name\":\"bvpoekrsgsgbdhu\",\"type\":\"qgnjdgkynscli\"}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("iayz", "iykhy", "wf", "jlb", "xqvkjlmxhomdyn", com.azure.core.util.Context.NONE) - .getValue(); - - Assertions.assertEquals("digumbnr", 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 e17ea1d4cad82..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/TargetsListMockTests.java +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.chaos.generated; - -import com.azure.core.credential.AccessToken; -import com.azure.core.http.HttpClient; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.HttpResponse; -import com.azure.core.http.rest.PagedIterable; -import com.azure.core.management.AzureEnvironment; -import com.azure.core.management.profile.AzureProfile; -import com.azure.resourcemanager.chaos.ChaosManager; -import com.azure.resourcemanager.chaos.models.Target; -import java.nio.ByteBuffer; -import java.nio.charset.StandardCharsets; -import java.time.OffsetDateTime; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.mockito.ArgumentCaptor; -import org.mockito.Mockito; -import reactor.core.publisher.Flux; -import reactor.core.publisher.Mono; - -public final class TargetsListMockTests { - @Test - public void testList() throws Exception { - HttpClient httpClient = Mockito.mock(HttpClient.class); - HttpResponse httpResponse = Mockito.mock(HttpResponse.class); - ArgumentCaptor httpRequest = ArgumentCaptor.forClass(HttpRequest.class); - - String responseStr = - "{\"value\":[{\"location\":\"wytpzdmovz\",\"properties\":{\"wzqa\":\"datava\",\"gzuriglaecxndt\":\"dataf\"},\"id\":\"cokpv\",\"name\":\"mlqtmldgxob\",\"type\":\"irclnpk\"}]}"; - - Mockito.when(httpResponse.getStatusCode()).thenReturn(200); - Mockito.when(httpResponse.getHeaders()).thenReturn(new HttpHeaders()); - Mockito - .when(httpResponse.getBody()) - .thenReturn(Flux.just(ByteBuffer.wrap(responseStr.getBytes(StandardCharsets.UTF_8)))); - Mockito - .when(httpResponse.getBodyAsByteArray()) - .thenReturn(Mono.just(responseStr.getBytes(StandardCharsets.UTF_8))); - Mockito - .when(httpClient.send(httpRequest.capture(), Mockito.any())) - .thenReturn( - Mono - .defer( - () -> { - Mockito.when(httpResponse.getRequest()).thenReturn(httpRequest.getValue()); - return Mono.just(httpResponse); - })); - - 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("rr", "vpglydz", "krvq", "ev", "oepry", com.azure.core.util.Context.NONE); - - Assertions.assertEquals("wytpzdmovz", 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 64ca03406fdb8..0000000000000 --- a/sdk/chaos/azure-resourcemanager-chaos/src/test/java/com/azure/resourcemanager/chaos/generated/UserAssignedIdentityTests.java +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.resourcemanager.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\":\"f0587e23-7bf1-4453-bbb9-ab410faf672c\",\"clientId\":\"94a39a62-5bd2-4857-bd90-537aa9ca7742\"}") - .toObject(UserAssignedIdentity.class); - } - - @org.junit.jupiter.api.Test - public void testSerialize() throws Exception { - UserAssignedIdentity model = new UserAssignedIdentity(); - model = BinaryData.fromObject(model).toObject(UserAssignedIdentity.class); - } -}